Skip to content Skip to sidebar Skip to footer
Showing posts with the label Magic 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?

How To Overload Python's __bool__ Method?

Possible Duplicate: defining “boolness” of a class in python I thought this should print 'Fal… Read more How To Overload Python's __bool__ Method?