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

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?

Python __index__ Special Method

>>> class Thing(object): ... def __index__(self): ... return 1 ... >>&g… Read more Python __index__ Special Method

Reflected Greater Than Magic Methods

I am in need of a reflected magic method 'greater than' and there does not appear to be one… Read more Reflected Greater Than Magic Methods

Defining Magic Methods On Classes

I would like to define a single object that can be iterated over without having to create a class a… Read more Defining Magic Methods On Classes

List Of All Python Dunder Methods - Which Ones Do You Need To Implement To Correctly Proxy An Object?

I'm trying to create an object proxy. Attribute/property lookup can be done by simply implement… Read more List Of All Python Dunder Methods - Which Ones Do You Need To Implement To Correctly Proxy An Object?

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?