Created
February 18, 2019 17:05
-
-
Save cjw296/450bdd5aaf9c3156b8e4df7dde81c76f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> class Wut(object): | |
... __slots__ = ('a',) | |
... | |
>>> Wut() | |
<__main__.Wut object at 0x7ffff7f55b40> | |
>>> Wut().b = 1 | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
AttributeError: 'Wut' object has no attribute 'b' | |
>>> class Eva(Wut): pass | |
... | |
>>> Eva().b = 1 | |
>>> Eva() | |
<__main__.Eva object at 0x7ffff1be8098> | |
>>> vars(Eva()) | |
{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment