Missing miscellaneous magic methods
rhettinger opened this issue · 0 comments
rhettinger commented
The dir magic method is used by the built-in dir() function. All classes inherit this method, but it can be extended or overridden to control what is shown in a dir() listing. The main use case is for classes that add methods dynamically (ORMs and whatnot).
Also, there is a sizeof magic method called by sys.getsizeof().
And there is subclasshook magic method used to create abstract base classes.