Forget slots (https://elfsternberg.com/2009/07/06/python-what-the-hell-is-a-slot/ …), what the hell is a dict? class Evil: __dict__ = None def __init__(self, x, y): self.x = x self.y = y >>> e = Evil(2,3) >>> dir(e) ... stare at it closely ... >>> e.__dict__ >>> e.x 2 >>> e.z ='wat' >>>
-
Show this thread
-
Replying to @dabeaz
Bug in CPython? You can't do this to an instance directly. Also the documentation says that "__dict__" is read-only: https://docs.python.org/3/library/stdtypes.html#special-attributes …pic.twitter.com/UglmQz6fOS
1 reply 0 retweets 0 likes
Replying to @appeltel
That’s not the dict you’re looking for.
7:18 AM - 21 Oct 2018
0 replies
0 retweets
5 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.