Detect target name in descriptor __set__ method

Rhodri James rhodri at wildebst.demon.co.uk
Wed Jul 22 10:01:09 EDT 2009


On Wed, 22 Jul 2009 06:02:55 +0100, Gabriel Genellina  
<gagsl-py2 at yahoo.com.ar> 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 Masses



More information about the Python-list mailing list