import pdb class foo: def __init__(self): # crash on pdb commands: # args # python3: display self # silently fail on pdb commands: p self, pp self pdb.set_trace() foo.bar = "hello" def __repr__(self): return foo.bar class C(object): def __new__(cls, *args, **kwds): # python3: crash on pdb commands: step followed by retval # python2: crash on pdb commands: step, return pdb.set_trace() return object.__new__(cls) def __init__(self, value): self.value = value def __repr__(self): return str(self.value) # Hit 'continue' at the first pdb prompt to test class C. foo() C(123)