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

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

Where Is The Python Documentation For The Special Methods? (__init__, __new__, __len__, ...)

Where is a complete list of the special double-underscore/dunder methods that can be used in classe… Read more Where Is The Python Documentation For The Special Methods? (__init__, __new__, __len__, ...)

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

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?

How To Override A Magic Method For The Current Script Without A Class?

How to override a magic method for the current script? def __setattr__(name, value): __dict__[n… Read more How To Override A Magic Method For The Current Script Without A Class?