Breaking into descriptors

Demian Brecht demianbrecht at gmail.com
Thu Feb 28 12:24:04 EST 2013


class MyDescriptor(object):
    def __init__(self):
        self.foo = 'bar'

    def __get__(self, obj, type_):
        import pdb; pdb.set_trace()
        return self.do_something()

    def __set__(self, obj, val):
        self.foo = val

class C(object):
    foo = MyDescriptor()

C().foo

pdb doesn't break into the descriptor's __get__ method on C().foo. Is
this a known limitation of pdb, or possibly a(n) (un)known bug?

Thanks,

-- 
Demian Brecht
http://demianbrecht.github.com



More information about the Python-list mailing list