| Python Language Reference Manual by Guido van Rossum and Fred L. Drake, Jr. Paperback (6"x9"), 120 pages ISBN 0954161785 RRP £12.95 ($19.95) Sales of this book support the Python Software Foundation! Get a printed copy>>> |
3.4.2.1 More attribute access for new-style classes
The following methods only apply to new-style classes.
__getattribute__(self, name)-
Called unconditionally to implement attribute accesses for instances
of the class. If the class also defines
__getattr__(), the latter will not be called unless__getattribute__()either calls it explicitly or raises anAttributeError. This method should return the (computed) attribute value or raise anAttributeErrorexception. 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)’.
| ISBN 0954161785 | Python Language Reference Manual | See the print edition |