Breaking into descriptors

Demian Brecht demianbrecht at
Thu Feb 28 18:24:04 CET 2013

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

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

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

class C(object):
    foo = MyDescriptor()


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?


Demian Brecht

More information about the Python-list mailing list