41 lines
672 B
Plaintext
41 lines
672 B
Plaintext
``++__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
|
|
|
|
----
|
|
class MyClass:
|
|
pass
|
|
|
|
__all__ = [
|
|
MyClass # Noncompliant
|
|
]
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
class MyClass:
|
|
pass
|
|
|
|
__all__ = [
|
|
"MyClass"
|
|
]
|
|
----
|
|
|
|
|
|
== See
|
|
|
|
* https://docs.python.org/3/tutorial/modules.html#importing-from-a-package[Python documentation - Importing * From a Package]
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|