From 3ba9f35d1b4f9427ad31fbfc3ec1bd1fcf72f7cc Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 1 Aug 2001 18:43:34 +0000 Subject: [PATCH] Add a note explaining how PEP 252 enables a different solution. --- pep-0213.txt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pep-0213.txt b/pep-0213.txt index 6cf7b9064..b45f8738f 100644 --- a/pep-0213.txt +++ b/pep-0213.txt @@ -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