Descriptor puzzlement

Terry Reedy tjreedy at
Thu Jan 8 19:55:24 CET 2004

"John Roth" <newsgroups at> wrote in message
news:vvqjj92il4o1d0 at
> Using Python 2.2.3, I create this script:
> [beginning of script]
> class AnObject(object):
>     "This might be a descriptor, but so far it doesn't seem like it"
>     def __init__(self, somedata):
> = somedata
>     def __get__(self, obj, type=None):
>         print "in get method"
>         return
>     def __set__(self, obj, it):
>         print "in set method"
>         self.somedata = it

Did you mean to set to match the __init__ and __get__ methods?
Or am I missing something about the esoterics of properties?

Terry J. Reedy

More information about the Python-list mailing list