Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #40143 > unrolled thread

Breaking into descriptors

Started byDemian Brecht <demianbrecht@gmail.com>
First post2013-02-28 09:24 -0800
Last post2013-02-28 09:24 -0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Breaking into descriptors Demian Brecht <demianbrecht@gmail.com> - 2013-02-28 09:24 -0800

#40143 — Breaking into descriptors

FromDemian Brecht <demianbrecht@gmail.com>
Date2013-02-28 09:24 -0800
SubjectBreaking into descriptors
Message-ID<mailman.2655.1362072729.2939.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web