4 ms·
Yeah, it's possible. My bigger point, which I should've made explicit: Python with nested scopes and classes has two ways to make an object. (Originally it had
by abecedarius 12y ago
Yeah, it's possible. My bigger point, which I should've made explicit:
Python with nested scopes and classes has two ways to make an object. (Originally it had only classes.) A Python-like language with just one way of defining objects, using nested scopes like my "def window:" above, would be simpler and more concise and more Pythonic (in the sense that there's one and only one obvious way to do it). It's obviously too late to call that language Python, which disappoints me.
When the obvious way to do it is very different depending on how many methods an object gets (a function for one, a class for more), refactorings like my example get kind of annoying.