[Python-checkins] CVS: python/nondist/peps pep-0231.txt,1.3,1.4

Guido van Rossum python-dev@python.org
Fri, 8 Dec 2000 07:36:05 -0800


Update of /cvsroot/python/python/nondist/peps
In directory slayer.i.sourceforge.net:/tmp/cvs-serv1430

Modified Files:
	pep-0231.txt 
Log Message:
Rejection notice (with Barry's agreement).


Index: pep-0231.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0231.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** pep-0231.txt	2000/12/02 15:12:35	1.3
--- pep-0231.txt	2000/12/08 15:36:03	1.4
***************
*** 603,606 ****
--- 603,626 ----
  
  
+ 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