interactive help on the base object

Steven D'Aprano steve at pearwood.info
Sun Dec 8 21:31:52 EST 2013


On Mon, 09 Dec 2013 01:43:43 +0000, Mark Lawrence wrote about object:

> What methods, if any does it provide?  Are they all abstract? etc???


Pretty much nothing useful :-)

py> dir(object)
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', 
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', 
'__init__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', 
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', 
'__subclasshook__']


What few methods there are typically do nothing, or nothing interesting. 
A few implement basic functionality, e.g. __eq__ performs equality based 
on identity (an object is equal to itself and nothing else).



-- 
Steven



More information about the Python-list mailing list