[Python-Dev] Instance variable access and descriptors (original) (raw)
Steven Bethard steven.bethard at gmail.com
Sat Jun 9 23:51:57 CEST 2007
- Previous message: [Python-Dev] Instance variable access and descriptors
- Next message: [Python-Dev] Instance variable access and descriptors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 6/9/07, Eyal Lotem <eyal.lotem at gmail.com> wrote:
I believe that this should be changed, so that Python first looks for the attribute in the instance's dict and only then through the dict's mro. [snip] What do you think?
Are you suggesting that the following code should print "43" instead of "42"? :: >>> class C(object): ... x = property(lambda self: self._x) ... def init(self): ... self._x = 42 ... >>> c = C() >>> c.dict['x'] = 43 >>> c.x 42
If so, this is a pretty substantial backwards incompatibility, and you should probably post this to python-ideas first to hash things out. If people like it there, the right target is probably Python 3000, not Python 2.x.
STeVe
I'm not in-sane. Indeed, I am so far out of sane that you appear a tiny blip on the distant coast of sanity. --- Bucky Katt, Get Fuzzy
- Previous message: [Python-Dev] Instance variable access and descriptors
- Next message: [Python-Dev] Instance variable access and descriptors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]