Add a note explaining how PEP 252 enables a different solution.

This commit is contained in:
Guido van Rossum 2001-08-01 18:43:34 +00:00
parent d90c6d41a7
commit 3ba9f35d1b
1 changed files with 18 additions and 1 deletions

View File

@ -25,7 +25,7 @@ Introduction
Justification
Scenario 1:
cenario 1:
You have a deployed class that works on an attribute named
"stdout". After a while, you think it would be better to
@ -210,6 +210,23 @@ Caveats
variable such as __XXX.
Note
The descriptor mechanism described in PEP 252 is powerful enough
to support this more directly. A 'getset' constructor may be
added to the language making this possible:
class C:
def get_x(self):
return self.__x
def set_x(self, v):
self.__x = v
x = getset(get_x, set_x)
Additional syntactic sugar might be added, or a naming convention
could be recognized.
Local Variables:
mode: indented-text