Skip to content Skip to sidebar Skip to footer
Showing posts with the label Magic Methods

Why Is __getattribute__ Not Invoked On An Implicit __getitem__-invocation?

While trying to wrap arbitrary objects, I came across a problem with dictionaries and lists. Invest… Read more Why Is __getattribute__ Not Invoked On An Implicit __getitem__-invocation?

Is It Possible To Transform Default Class Dunder Methods Into Class Methods?

To give you some context, yesterday I came across this post. I found the problem quite interesting,… Read more Is It Possible To Transform Default Class Dunder Methods Into Class Methods?

Why Are Explicit Calls To Magic Methods Slower Than "sugared" Syntax?

I was messing around with a small custom data object that needs to be hashable, comparable, and fas… Read more Why Are Explicit Calls To Magic Methods Slower Than "sugared" Syntax?