44 lines
763 B
Plaintext
44 lines
763 B
Plaintext
== Why is this an issue?
|
|
|
|
include::../description.adoc[]
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,python]
|
|
----
|
|
def noncompliant():
|
|
def nested_function(): # Noncompliant
|
|
print("nested_function")
|
|
|
|
class NestedClass: # Noncompliant
|
|
def __init__(self):
|
|
print("NestedClass")
|
|
----
|
|
|
|
=== Compliant solution
|
|
|
|
[source,python]
|
|
----
|
|
def compliant():
|
|
def nested_function():
|
|
print("nested_function")
|
|
|
|
class NestedClass:
|
|
def __init__(self):
|
|
print("NestedClass")
|
|
|
|
nested_function()
|
|
NestedClass()
|
|
----
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
include::../highlighting.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|