[issue1265] pdb bug with "with" statement

2007-11-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: > BTW**2: I've noticed that abc.py's __instancecheck__ gets called a lot > at times when I don't expect it. Can you research this a bit? In classobject.c, method_call() calls PyObject_IsInstance() on the first arg when the method is unbound. This happens

[issue1265] pdb bug with "with" statement

2007-11-12 Thread Guido van Rossum
Guido van Rossum added the comment: PPSS. When backporting, a note in Misc/NEWS is appreciated. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list ma

[issue1265] pdb bug with "with" statement

2007-11-12 Thread Guido van Rossum
Guido van Rossum added the comment: BTW: if you can show (e.g. with your unittest) that this indeed breaks in 2.6 and 2.5, please do backport it. BTW**2: I've noticed that abc.py's __instancecheck__ gets called a lot at times when I don't expect it. Can you research this a bit? ___

[issue1265] pdb bug with "with" statement

2007-11-12 Thread Guido van Rossum
Guido van Rossum added the comment: Good work indeed! Here's another way: >>> class C: ... @property ... def __class__(self): return D ... >>> class D: pass ... >>> C().__class__ >>> __ Tracker <[EMAIL PROTECTED]> __

[issue1265] pdb bug with "with" statement

2007-11-12 Thread Christian Heimes
Christian Heimes added the comment: Good work Amaury! :) I also wonder how type(cls) != cls.__class__ is possible with new style classes. So far I found only one way and it ain't beautiful: >>> class Meta(type): ... def __getattribute__(self, key): ... if key == "__class__": return

[issue1265] pdb bug with "with" statement

2007-11-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: __instancecheck__ should be simpler: all classes are new-style, how is it possible to have different results for instance.__class__ and type(instance) ? __ Tracker <[EMAIL PROTECTED]>

[issue1265] pdb bug with "with" statement

2007-11-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Corrected by revision 58958. "with" is innocent. The problem is this function in abc.py which uses a generator expression: def __instancecheck__(cls, instance): """Override for isinstance(instance, cls).""" return any(cls.__subclasschec

[issue1265] pdb bug with "with" statement

2007-11-02 Thread Christian Heimes
Christian Heimes added the comment: The bug makes debugging a crux :( -- priority: -> high resolution: -> accepted type: -> behavior __ Tracker <[EMAIL PROTECTED]> __ __

[issue1265] pdb bug with "with" statement

2007-10-11 Thread Guido van Rossum
Changes by Guido van Rossum: -- nosy: +gvanrossum __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue1265] pdb bug with "with" statement

2007-10-11 Thread Christian Heimes
New submission from Christian Heimes: found a pretty annoying bug caused by with blocks. A with block terminates the debugging session and the program keeps running. It's not possible to go to the next line with 'n'. 's' steps into the open() call. # pdbtest.py import pdb pdb.set_trace() print("