Re: __set__ method is not called for class attribute access

2011-08-10 Thread Fuzzyman
On Aug 10, 5:27 pm, Eric Snow wrote: > On Wed, Aug 10, 2011 at 8:33 AM, Fuzzyman wrote: > > On Aug 5, 12:29 pm, Ryan wrote: > >> In the context of descriptors, the __set__ method is not called for > >> class attribute access. __set__ is only > >> called

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Eric Snow
On Wed, Aug 10, 2011 at 8:33 AM, Fuzzyman wrote: > On Aug 5, 12:29 pm, Ryan wrote: >> In the context of descriptors, the __set__ method is not called for >> class attribute access. __set__ is only >> called to set the attribute on an instance instance of the owner class >

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Duncan Booth
Fuzzyman wrote: >> The descriptor protocol only works when a value is being accessed or set >> on an instance and there is no instance attribute of that name so the >> value is fetched from the underlying class. >> > > That's not true. Properties, for example, can be got or set even when > they

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Fuzzyman
On Aug 5, 1:16 pm, Duncan Booth wrote: > Ryan wrote: > > In the context of descriptors, the __set__ method is not called for > > class attribute access. __set__ is only > > called to set the attribute on an instance instance of the owner class > > to a new value, valu

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Fuzzyman
On Aug 5, 12:29 pm, Ryan wrote: > In the context of descriptors, the __set__ method is not called for > class attribute access. __set__ is only > called to set the attribute on an instance instance of the owner class > to a new value, value. WHY? It's an unfortunate asymmetry

Re: __set__ method is not called for class attribute access

2011-08-07 Thread Duncan Booth
Peter Otten <__pete...@web.de> wrote: > Duncan Booth wrote: > >> The descriptor protocol only works when a value is being accessed or set >> on an instance and there is no instance attribute of that name so the >> value is fetched from the underlying class. > > Unlike normal class attributes a d

Re: __set__ method is not called for class attribute access

2011-08-05 Thread Peter Otten
Duncan Booth wrote: > The descriptor protocol only works when a value is being accessed or set > on an instance and there is no instance attribute of that name so the > value is fetched from the underlying class. Unlike normal class attributes a descriptor is not shaded by an instance attribute:

Re: __set__ method is not called for class attribute access

2011-08-05 Thread Duncan Booth
Ryan wrote: > In the context of descriptors, the __set__ method is not called for > class attribute access. __set__ is only > called to set the attribute on an instance instance of the owner class > to a new value, value. WHY? Is there some other mechanism for > accomplishing thi

Re: __set__ method is not called for class attribute access

2011-08-05 Thread Peter Otten
Ryan wrote: > In the context of descriptors, the __set__ method is not called for > class attribute access. __set__ is only > called to set the attribute on an instance instance of the owner class > to a new value, value. WHY? Is there some other mechanism for > accomplishing thi

__set__ method is not called for class attribute access

2011-08-05 Thread Ryan
In the context of descriptors, the __set__ method is not called for class attribute access. __set__ is only called to set the attribute on an instance instance of the owner class to a new value, value. WHY? Is there some other mechanism for accomplishing this outcome. This subtle difference from