Possible PEP: Improve classmethod/staticmethod syntax

Aahz aahz at pythoncraft.com
Wed Jun 4 18:28:25 CEST 2003


In article <bbl189$fs9$1 at driftwood.ccs.carleton.ca>,
Sean Ross <frobozz_electric at hotmail.com> wrote:
>
>Where the property attribute would signal the interpreter to look for nested
>functions 'get', 'set', and possibly 'del'. You would only be required to
>define the methods you want, but they would have to follow this form. So,
>for instance, creating a read-only property could look something like this:
>
>def bar(self)[property]:
>    def get():
>        return self.__bar

No, Guido will insist on requiring a definition of a set function that
raises an exception if you want to make it read-only.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra




More information about the Python-list mailing list