
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
61 lines
940 B
Plaintext
61 lines
940 B
Plaintext
== Why is this an issue?
|
|
|
|
``++__all__++`` is used to define the list of module's names that should be imported when ``++from package import *++`` is used. For that reason, it may only contain strings.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,python]
|
|
----
|
|
class MyClass:
|
|
pass
|
|
|
|
__all__ = [
|
|
MyClass # Noncompliant
|
|
]
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,python]
|
|
----
|
|
class MyClass:
|
|
pass
|
|
|
|
__all__ = [
|
|
"MyClass"
|
|
]
|
|
----
|
|
|
|
|
|
== Resources
|
|
|
|
* https://docs.python.org/3/tutorial/modules.html#importing-from-a-package[Python documentation - Importing * From a Package]
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Replace this symbol with a string; "__all__" can only contain strings.
|
|
|
|
|
|
=== Highlighting
|
|
|
|
Primary: the wrong symbol in "__all__"
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== is related to: S5807
|
|
|
|
endif::env-github,rspecator-view[]
|