Rejection notice (with Barry's agreement).

This commit is contained in:
Guido van Rossum 2000-12-08 15:36:03 +00:00
parent a9af2cc689
commit eea626cb8d
1 changed files with 20 additions and 0 deletions

View File

@ -602,6 +602,26 @@ References
[9] http://python.sourceforge.net/peps/pep-0213.html
Rejection
There are serious problems with the recursion-protection feature.
As described here it's not thread-safe, and a thread-safe solution
has other problems. In general, it's not clear how helpful the
recursion-protection feature is; it makes it hard to write code
that needs to be callable inside __findattr__ as well as outside
it. But without the recursion-protection, it's hard to implement
__findattr__ at all (since __findattr__ would invoke itself
recursively for every attribute it tries to access). There seems
to be no good solution here.
It's also dubious how useful it is to support __findattr__ both
for getting and for setting attributes -- __setattr__ gets called
in all cases alrady.
The examples can all be implemented using __getattr__ if care is
taken not to store instance variables under their own names.
Copyright
This document has been placed in the Public Domain.