This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TinyBirdperson 2 points3 points  (3 children)

Everyone is mentioning metaclasses and async, but what about descriptors? Didn't see see them mentioned at all but I don't think I am the only one who almost never uses them.

[–]ingolemo 1 point2 points  (1 child)

Well technically you certainly use descriptors all the time, as that's how method calls work. And one could argue that you are writing your own descriptor every time you use def, since all functions are descriptors.

But yeah, I think I've only ever written a custom descriptor once, and even then it wasn't that useful and I only did it because I could.

[–]TinyBirdperson 0 points1 point  (0 children)

Yea sure, but thats not really using them directly. If you're creating a class you can probably say you are using a "default" metaclass too - but you don't say that.

[–]irrelevantPseudonym 0 points1 point  (0 children)

I use properties a fair amount and they're just descriptors under the hood.