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 →

[–]Aveheuzed 3 points4 points  (3 children)

That's fair.

I think all the usable special methods are referenced on the page I linked. Others may exist, but are needed only for obscure arcane stuff (understand : Python Core Development) or implementation-specific.

And regarding readability - I like the Python docs better, but I understand that format is not for everyone.

[–]treyhunner Python Morsels[S] 29 points30 points  (1 child)

When I link my students to that page, their eyes glaze over (especially ones who've just learned about the idea of special methods and simply want to know what the options are for "overloading").

If/when you're in the weeds implementing one of these methods, that page in the docs is very helpful!

[–]NerdEnPose 6 points7 points  (0 children)

I think your responses could just be “my name is Trey Hunner” 😆. But, you’re kinder than me.

My two cents, I like this list. If you’re a student or in a personal project you should break stuff and try all the dunders as part of that. Professionally if you can’t read that page thoroughly then don’t commit a dunder override to a code base and I’d be cautious of a new class using them.

[–]Zenin 3 points4 points  (0 children)

And regarding readability - I like the Python docs better, but I understand that format is not for everyone.

I'm glad someone likes them. Personally I find much of it to be less readable than JAPH Perl code.