Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Export import with all

  • all
__all__ = ['a', '_c']

def a():
    return "in a"

b = "value of b"

def _c():
    return "in _c"

def d():
    return "in d"
from my_module2 import *

print(a())     # in a
print(_c())    # in _c

print(b)

# Traceback (most recent call last):
#   File ".../examples/modules/z.py", line 7, in <module>
#     print(b)       # value of b
# NameError: name 'b' is not defined