[Python-Dev] descriptor as instance attribute (original) (raw)
Jon Wells jon at sandgate.com
Mon Jan 9 15:32:13 CET 2012
- Previous message: [Python-Dev] py3benchmark not working
- Next message: [Python-Dev] descriptor as instance attribute
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I can't find an answer to this grovelling through get user info. on descriptors.
Assuming desc() is a data descriptor class why are the following not the same???
class poop(object):
var = desc()
and
class poop(object):
def __init__(self):
self.var = desc()
In the second form the descriptor protocol for access to 'var' is ignored.
Would seem to not make sense to me.
jon.
- Previous message: [Python-Dev] py3benchmark not working
- Next message: [Python-Dev] descriptor as instance attribute
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]