diff -r 0b2d4089180c Doc/reference/datamodel.rst --- a/Doc/reference/datamodel.rst Wed Apr 10 17:01:38 2013 -0400 +++ b/Doc/reference/datamodel.rst Sat Apr 13 14:34:23 2013 -0400 @@ -1346,7 +1346,7 @@ .. XXX explain how descriptors interfere here! -.. method:: object.__getattr__(self, name) +.. method:: someclass.__getattr__(self, name) Called when an attribute lookup has not found the attribute in the usual places (i.e. it is not an instance attribute nor is it found in the class tree for @@ -1364,7 +1364,7 @@ over attribute access. -.. method:: object.__getattribute__(self, name) +.. method:: someclass.__getattribute__(self, name) Called unconditionally to implement attribute accesses for instances of the class. If the class also defines :meth:`__getattr__`, the latter will not be @@ -1373,7 +1373,7 @@ or raise an :exc:`AttributeError` exception. In order to avoid infinite recursion in this method, its implementation should always call the base class method with the same name to access any attributes it needs, for example, - ``object.__getattribute__(self, name)``. + ``somebaseclass.__getattribute__(self, name)``. .. note:: @@ -1382,7 +1382,7 @@ See :ref:`special-lookup`. -.. method:: object.__setattr__(self, name, value) +.. method:: someclass.__setattr__(self, name, value) Called when an attribute assignment is attempted. This is called instead of the normal mechanism (i.e. store the value in the instance dictionary). @@ -1390,16 +1390,16 @@ If :meth:`__setattr__` wants to assign to an instance attribute, it should call the base class method with the same name, for example, - ``object.__setattr__(self, name, value)``. - - -.. method:: object.__delattr__(self, name) + ``somebaseclass.__setattr__(self, name, value)``. + + +.. method:: someclass.__delattr__(self, name) Like :meth:`__setattr__` but for attribute deletion instead of assignment. This should only be implemented if ``del obj.name`` is meaningful for the object. -.. method:: object.__dir__(self) +.. method:: someclass.__dir__(self) Called when :func:`dir` is called on the object. A sequence must be returned. :func:`dir` converts the returned sequence to a list and sorts it. @@ -1418,7 +1418,7 @@ class' :attr:`__dict__`. -.. method:: object.__get__(self, instance, owner) +.. method:: someclass.__get__(self, instance, owner) Called to get the attribute of the owner class (class attribute access) or of an instance of that class (instance attribute access). *owner* is always the owner @@ -1428,13 +1428,13 @@ exception. -.. method:: object.__set__(self, instance, value) +.. method:: someclass.__set__(self, instance, value) Called to set the attribute on an instance *instance* of the owner class to a new value, *value*. -.. method:: object.__delete__(self, instance) +.. method:: someclass.__delete__(self, instance) Called to delete the attribute on an instance *instance* of the owner class.