Re: Breaking into descriptors

2013-02-28 Thread Demian Brecht
On Thu, Feb 28, 2013 at 10:01 AM, Dave Angel  wrote:
> It halts (breaks) for me, in Python 2.7.3 on Linux


Okay, now I'm just confused. I ran this in terminal on OSX with both
2.7.3 and 3.4(dev) and both were exhibiting the same behaviour. I've
since closed the terminal and upon trying it in a newly created term,
cannot repro it.

Gremlins.

-- 
Demian Brecht
http://demianbrecht.github.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Breaking into descriptors

2013-02-28 Thread Dave Angel

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)()
 -> obj = C().foo
 (Pdb)


--
DaveA
--
http://mail.python.org/mailman/listinfo/python-list