(no title)
murkt
|
10 months ago
This is a pretty simple and useful feature. I wouldn’t say that it bloats the language too much. Descriptors and metaclasses are much more complicated and have a lot more implications and have been in the language for a veeeeery long time. Is it decades already?
nu11ptr|10 months ago
murkt|10 months ago
pansa2|10 months ago
tetha|10 months ago
I'm just glad you don't have to think or even use this as a normal user of the language, most of the time or at all.
kccqzy|10 months ago
I have a feeling that if metaclasses and descriptors were to be proposed today it would be laughed out of the PEP process completely.
pansa2|10 months ago
I think you need at least one of these. Modern Python eschews metaclasses but descriptors are everywhere. Without them you couldn’t have @classmethod, @staticmethod nor @property - or at least, you couldn’t generalise custom method lookup and all three of those would need to be special cases.
The alternative approach is to drop descriptors and make method lookup much simpler, but then you need metaclasses (see: static methods in Ruby).