2020-06-30 12:50:28 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,python]
|
2020-06-30 12:50:28 +02:00
|
|
|
----
|
|
|
|
def noncompliant():
|
|
|
|
def nested_function(): # Noncompliant
|
|
|
|
print("nested_function")
|
|
|
|
|
|
|
|
class NestedClass: # Noncompliant
|
|
|
|
def __init__(self):
|
|
|
|
print("NestedClass")
|
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,python]
|
2020-06-30 12:50:28 +02:00
|
|
|
----
|
|
|
|
def compliant():
|
|
|
|
def nested_function():
|
|
|
|
print("nested_function")
|
|
|
|
|
|
|
|
class NestedClass:
|
|
|
|
def __init__(self):
|
|
|
|
print("NestedClass")
|
|
|
|
|
|
|
|
nested_function()
|
|
|
|
NestedClass()
|
|
|
|
----
|
2021-09-20 15:38:42 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../message.adoc[]
|
|
|
|
|
|
|
|
include::../highlighting.adoc[]
|
|
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|