On Tue, 14 Feb 2006 22:24:12 -0500, rumours say that "Terry Reedy"
<[EMAIL PROTECTED]> might have written:
> id(Parrot.f) == id(Parrot.f)
>> True
> id(Parrot.__dict__) == id(Parrot.__dict__)
>> True
>
>A wrapper is created and passed to id() which returns an int object while
>releasing th
"Carl Banks" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> But wait, it gets weirder.
Not weird at all. Just an artifact of CPython's storage recycling
algorithm.
id(Parrot.f) == id(Parrot.f)
> True
id(Parrot.__dict__) == id(Parrot.__dict__)
> True
A wrapper is crea
On Tue, 14 Feb 2006 13:03:17 +0100, bruno at modulix wrote:
> Steven D'Aprano wrote:
>> I came across this unexpected behaviour of getattr for new style classes.
>> Example:
>>
>>
>class Parrot(object):
>>
>> ... thing = [1,2,3]
>> ...
>>
>getattr(Parrot, "thing") is Parrot.thing
>
Steven D'Aprano wrote:
> >class Parrot(object):
> >>
> >> ... thing = [1,2,3]
> >> ...
> >>
> >getattr(Parrot, "thing") is Parrot.thing
> >>
> >> True
> >>
> >getattr(Parrot, "__dict__") is Parrot.__dict__
> >>
> >> False
> >
> >
> > hint:
> getattr(object, '__dict__')
> >
>
Raymond Hettinger wrote:
> Steven D'Aprano wrote:
> > I came across this unexpected behaviour of getattr for new style classes.
> > Example:
> >
> > >>> class Parrot(object):
> > ... thing = [1,2,3]
> > ...
> > >>> getattr(Parrot, "thing") is Parrot.thing
> > True
> > >>> getattr(Parrot, "__dic
On Tue, 14 Feb 2006 04:11:52 -0800, Raymond Hettinger wrote:
> Steven D'Aprano wrote:
>> I came across this unexpected behaviour of getattr for new style classes.
>> Example:
>>
>> >>> class Parrot(object):
>> ... thing = [1,2,3]
>> ...
>> >>> getattr(Parrot, "thing") is Parrot.thing
>> True
>
Steven D'Aprano wrote:
> I came across this unexpected behaviour of getattr for new style classes.
> Example:
>
> >>> class Parrot(object):
> ... thing = [1,2,3]
> ...
> >>> getattr(Parrot, "thing") is Parrot.thing
> True
> >>> getattr(Parrot, "__dict__") is Parrot.__dict__
> False
>
> I would
Steven D'Aprano wrote:
> I came across this unexpected behaviour of getattr for new style classes.
> Example:
>
>
class Parrot(object):
>
> ... thing = [1,2,3]
> ...
>
getattr(Parrot, "thing") is Parrot.thing
>
> True
>
getattr(Parrot, "__dict__") is Parrot.__dict__
>
> False
I came across this unexpected behaviour of getattr for new style classes.
Example:
>>> class Parrot(object):
... thing = [1,2,3]
...
>>> getattr(Parrot, "thing") is Parrot.thing
True
>>> getattr(Parrot, "__dict__") is Parrot.__dict__
False
I would have expected that the object returned by get