[issue8722] Documentation for __getattr__

Paul Davis report at bugs.python.org
Sat May 15 06:10:59 CEST 2010


New submission from Paul Davis <paul.joseph.davis at gmail.com>:

The docs for __getattr__ in the object model section could be more specific on the behavior when a @property raises an AttributeError and there is a custom __getattr__ defined. Specifically, it wasn't exactly clear that __getattr__ would be invoked after a @property was found and evaluated.

The attached script demonstrates the issue on OS X 10.6, Python 2.6.1

I'm thinking something along the lines of:

If the attribute search encounters an AttributeError (perhaps due to a @property raising the error) the search is considered a failure and __getattr__ is invoked.

----------
assignee: docs at python
components: Documentation
files: example.py
messages: 105790
nosy: Paul.Davis, docs at python
priority: normal
severity: normal
status: open
title: Documentation for __getattr__
type: feature request
versions: Python 2.6
Added file: http://bugs.python.org/file17349/example.py

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


More information about the Python-bugs-list mailing list