Re: Detect target name in descriptor __set__ method

2009-07-23 Thread Gabriel Genellina
En Thu, 23 Jul 2009 10:19:33 -0300, DG escribió: On Jul 22, 6:05 pm, "Gabriel Genellina" wrote: En Wed, 22 Jul 2009 11:01:09 -0300, Rhodri James   escribió: > On Wed, 22 Jul 2009 06:02:55 +0100, Gabriel Genellina   > wrote: >> class X(object): >>    foo = descriptor() >> x = X() >> x.foo

Re: Detect target name in descriptor __set__ method

2009-07-23 Thread DG
On Jul 23, 8:44 am, Rainer Mansfeld wrote: > Gabriel Genellina schrieb: > > > I have a class attribute 'foo' which is a data descriptor. I create an > > instance of such class. When I say instance.foo = value, the descriptor > > __set__ method is called. Is there any way to obtain the name being >

Re: Detect target name in descriptor __set__ method

2009-07-23 Thread Rainer Mansfeld
Gabriel Genellina schrieb: I have a class attribute 'foo' which is a data descriptor. I create an instance of such class. When I say instance.foo = value, the descriptor __set__ method is called. Is there any way to obtain the name being assigned to? ('foo' in this example). That is, I want to

Re: Detect target name in descriptor __set__ method

2009-07-23 Thread Rhodri James
On Thu, 23 Jul 2009 01:05:55 +0100, Gabriel Genellina wrote: En Wed, 22 Jul 2009 11:01:09 -0300, Rhodri James escribió: On Wed, 22 Jul 2009 06:02:55 +0100, Gabriel Genellina wrote: class X(object): foo = descriptor() x = X() x.foo = "value" Isn't this going to create a brand ne

Re: Detect target name in descriptor __set__ method

2009-07-23 Thread DG
On Jul 23, 7:19 am, DG wrote: > On Jul 22, 6:05 pm, "Gabriel Genellina" > wrote: > > > > > En Wed, 22 Jul 2009 11:01:09 -0300, Rhodri James   > > escribió: > > > > On Wed, 22 Jul 2009 06:02:55 +0100, Gabriel Genellina   > > > wrote: > > > >> class X(object): > > >>    foo = descriptor() > > > >

Re: Detect target name in descriptor __set__ method

2009-07-23 Thread DG
On Jul 22, 6:05 pm, "Gabriel Genellina" wrote: > En Wed, 22 Jul 2009 11:01:09 -0300, Rhodri James   > escribió: > > > On Wed, 22 Jul 2009 06:02:55 +0100, Gabriel Genellina   > > wrote: > > >> class X(object): > >>    foo = descriptor() > > >> x = X() > >> x.foo = "value" > > > Isn't this going t

Re: Detect target name in descriptor __set__ method

2009-07-22 Thread Gabriel Genellina
En Wed, 22 Jul 2009 11:01:09 -0300, Rhodri James escribió: On Wed, 22 Jul 2009 06:02:55 +0100, Gabriel Genellina wrote: class X(object): foo = descriptor() x = X() x.foo = "value" Isn't this going to create a brand new instance attribute x.foo that has nothing to do with the descr

Re: Detect target name in descriptor __set__ method

2009-07-22 Thread Gabriel Genellina
En Wed, 22 Jul 2009 05:31:13 -0300, Jon Clements escribió: On 22 July, 06:02, "Gabriel Genellina" wrote: I have a class attribute 'foo' which is a data descriptor. I create an   instance of such class. When I say instance.foo = value, the descriptor   __set__ method is called. Is there a

Re: Detect target name in descriptor __set__ method

2009-07-22 Thread Rhodri James
On Wed, 22 Jul 2009 06:02:55 +0100, Gabriel Genellina wrote: class X(object): foo = descriptor() x = X() x.foo = "value" Isn't this going to create a brand new instance attribute x.foo that has nothing to do with the descriptor anyway? -- Rhodri James *-* Wildebeest Herder to the M

Re: Detect target name in descriptor __set__ method

2009-07-22 Thread Jon Clements
On 22 July, 06:02, "Gabriel Genellina" wrote: > I have a class attribute 'foo' which is a data descriptor. I create an   > instance of such class. When I say instance.foo = value, the descriptor   > __set__ method is called. Is there any way to obtain the name being   > assigned to? ('foo' in this

Re: Detect target name in descriptor __set__ method

2009-07-21 Thread Wolfgang Rohdewald
On Wednesday 22 July 2009, Wolfgang Rohdewald wrote: > On Wednesday 22 July 2009, Gabriel Genellina wrote: > > x = X() > > x.foo = "value" > > del x.foo sorry, was not yet quite awaken - I read "delete target name" instead of "detect target name" -- Wolfgang -- http://mail.python.org/mailman/li

Re: Detect target name in descriptor __set__ method

2009-07-21 Thread Wolfgang Rohdewald
On Wednesday 22 July 2009, Gabriel Genellina wrote: > x = X() > x.foo = "value" del x.foo -- Wolfgang -- http://mail.python.org/mailman/listinfo/python-list