What are the reasons for using type(obj).method() instead of obj.method()?
What are the reasons for using type(obj).method() instead of obj.method()? Question: I’ve seen a couple of times methods being called on the type of an object instead of the object itself. What might the reasons for that be, especially with special methods? Example from documentation: "For instance, if a class defines a method named _getitem_(), …