Re: __dict__ strangeness

2006-03-20 Thread Alan Franzoni
Georg Brandl on comp.lang.python said: > It's 2.4.2, on Linux. The 2.5 SVN trunk has the same symptom. Yes, I confirm this. I think I had done something strange on my system (probably misspelled something). -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia email per contattarmi. Rrem

Re: __dict__ strangeness

2006-03-18 Thread Ziga Seilnacht
Georg Brandl wrote: > Hi, > > can someone please tell me that this is correct and why: > > >>> class C(object): > ... pass > ... > >>> c = C() > >>> c.a = 1 > >>> c.__dict__ > {'a': 1} > >>> c.__dict__ = {} > >>> c.a > Traceback (most recent call last): > File "", line 1, in ? > AttributeErr

Re: __dict__ strangeness

2006-03-18 Thread Alex Martelli
Georg Brandl <[EMAIL PROTECTED]> wrote: > [moving to python-dev] > > Alex Martelli wrote: > > Georg Brandl <[EMAIL PROTECTED]> wrote: > > > >> can someone please tell me that this is correct and why: > > > > IMHO, it is not correct: it is a Python bug (and it would be nice to fix > > it in 2.5)

Re: __dict__ strangeness

2006-03-18 Thread Georg Brandl
[moving to python-dev] Alex Martelli wrote: > Georg Brandl <[EMAIL PROTECTED]> wrote: > >> can someone please tell me that this is correct and why: > > IMHO, it is not correct: it is a Python bug (and it would be nice to fix > it in 2.5). Fine. Credits go to Michal Kwiatkowski for discovering t

Re: __dict__ strangeness

2006-03-18 Thread Alex Martelli
Georg Brandl <[EMAIL PROTECTED]> wrote: > can someone please tell me that this is correct and why: IMHO, it is not correct: it is a Python bug (and it would be nice to fix it in 2.5). > >>> class C(object): > ... pass > ... > >>> c = C() > >>> c.a = 1 > >>> c.__dict__ > {'a': 1} > >>> c.__di

Re: __dict__ strangeness

2006-03-18 Thread Georg Brandl
Alan Franzoni wrote: > Georg Brandl on comp.lang.python said: > > d.__dict__ >> {} > > Which Python version, on which system? I can see the properly inserted > attribute in __dict__, both with old style and new style classes. It's 2.4.2, on Linux. The 2.5 SVN trunk has the same symptom. Ge

Re: __dict__ strangeness

2006-03-18 Thread Alan Franzoni
Georg Brandl on comp.lang.python said: d.__dict__ > {} Which Python version, on which system? I can see the properly inserted attribute in __dict__, both with old style and new style classes. -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia email per contattarmi. Rremove .xyz

__dict__ strangeness

2006-03-18 Thread Georg Brandl
Hi, can someone please tell me that this is correct and why: >>> class C(object): ... pass ... >>> c = C() >>> c.a = 1 >>> c.__dict__ {'a': 1} >>> c.__dict__ = {} >>> c.a Traceback (most recent call last): File "", line 1, in ? AttributeError: 'C' object has no attribute 'a' >>> >>> class D