In the below list of attributes,
>>> dir(object)
['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
__eq__
, __ne__
& __hash__
are not shown as attributes. They are attributes of meta class type
>>> dir(type)
[... '__eq__', .... '__hash__', ... '__ne__', ...]
>>>
and object
is not in is-a
relation with type
>>> issubclass(object, type)
False
>>> issubclass(type, object)
True
But, I see these attributes part of object
,
>>> object.__eq__
<method-wrapper '__eq__' of type object at 0x905b80>
>>> object.__ne__
<method-wrapper '__ne__' of type object at 0x905b80>
>>> object.__hash__
<slot wrapper '__hash__' of 'object' objects>
>>>
This allows,
class X(object):
pass
class X
to override these attributes.
Question:
Are these attributes of object
?