[Python-Dev] PEP 318: Properties (original) (raw)
Jewett, Jim J jim.jewett at eds.com
Sun Apr 4 19:45:16 EDT 2004
- Previous message: [Python-Dev] from ...sys import path
- Next message: [Python-Dev] PEP 318: Properties
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Skip:
How would this be interpreted?
x = 42
def x(self) [propget]: "Doc string for x" _return self.x
That is, there is already an (otherwise invalid) 'x' in the calling scope when propget() is called. Do the property doodads just need to be bulletproofed or should an exception be raised?
Guido:
It's broken. I expect this to raise an exception at some point. Beyond that, who cares?
If so, then this decorator is a bad idea.
I would expect 42 to be the initial value of the property x.
I could learn that properties are different, and this won't work, but... this would be a very unexpected result. At the very least, an explicit exception should be raised at definition time.
-jJ
- Previous message: [Python-Dev] from ...sys import path
- Next message: [Python-Dev] PEP 318: Properties
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]