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


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

Re: Breaking into descriptors

Started byDave Angel <davea@davea.name>
First post2013-02-28 13:01 -0500
Last post2013-02-28 13:01 -0500
Articles 1 — 1 participant

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

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Breaking into descriptors Dave Angel <davea@davea.name> - 2013-02-28 13:01 -0500

#40148 — Re: Breaking into descriptors

FromDave Angel <davea@davea.name>
Date2013-02-28 13:01 -0500
SubjectRe: Breaking into descriptors
Message-ID<mailman.2660.1362074502.2939.python-list@python.org>
On 02/28/2013 12:24 PM, Demian Brecht wrote:
> 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?
>
>

It halts (breaks) for me, in Python 2.7.3 on Linux

  > /home/davea/temppython/demian.py(8)__get__()
  -> return self.do_something()
  (Pdb) up
  > /home/davea/temppython/demian.py(19)<module>()
  -> obj = C().foo
  (Pdb)


-- 
DaveA

[toc] | [standalone]


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


csiph-web