Page MenuHomeSoftware Heritage
Paste P762

(An Untitled Masterwork)
ActivePublic

Authored by vlorentz on Sep 13 2020, 8:59 PM.
>>> bar
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'bar' is not defined
>>> class Foo:
... global bar
... bar = 42
...
>>> bar
42
>>> Foo.bar
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: type object 'Foo' has no attribute 'bar'