[New-bugs-announce] [issue4517] improve __getattribute__ documentation

David W. Lambert report at bugs.python.org
Thu Dec 4 05:34:58 CET 2008


New submission from David W. Lambert <lambertdw at corning.com>:

http://docs.python.org/dev/3.0/reference/datamodel.html#special-lookup

(After fixing the link to http://docs.python.org/3.0 at http://www.python.org/doc/ (and likewise the http://docs.python.org/whatsnew/3.0.html link.)...

The comment that __getattribute__ is "Called unconditionally to 
implement attribute accesses for instances of the class" gave me hope 
that some combination of "meta" "super" and "sub" might let me access 
__getattribute__ for expression eval('obj + another_object') despite the 
special notes.  I realize now the truth is that

"__getattribute__ is NEVER accessible in pure python code when the code 
uses the syntax of a unary or binary operator such as a+b, ~a, len(a)."
See most of the functions in this manual section.
Also name hash, which doesn't find much explicit use but could well be 
the most used python functionality.  Find a smooth way to replace my 
NEVER since code can obviously access __getattribute__ from the special 
function.

Thank you, and great work!

----------
assignee: georg.brandl
components: Documentation
messages: 76867
nosy: LambertDW, georg.brandl
severity: normal
status: open
title: improve __getattribute__ documentation
type: feature request
versions: Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4517>
_______________________________________


More information about the New-bugs-announce mailing list