New submission from Gerrit Holl:
When a decorater contains a `lambda` declaration, using the pdb command
`longlist` will show only the definition of the decorator. The definition of
the function itself is not shown:
cat mini.py
#!/usr/bin/python3.4
def foo(x, y=None):
return x
@foo(foo, lambda a:a)
def spam():
0+0
1+1
1/0
spam()
$ python3.4 -mpdb mini.py
> /tmp/mini.py(3)<module>()
-> def foo(x, y=None):
(Pdb) cont
Traceback (most recent call last):
File "/usr/lib64/python3.4/pdb.py", line 1661, in main
pdb._runscript(mainpyfile)
File "/usr/lib64/python3.4/pdb.py", line 1542, in _runscript
self.run(statement)
File "/usr/lib64/python3.4/bdb.py", line 431, in run
exec(cmd, globals, locals)
File "<string>", line 1, in <module>
File "/tmp/mini.py", line 3, in <module>
def foo(x, y=None):
File "/tmp/mini.py", line 10, in spam
1/0
ZeroDivisionError: division by zero
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /tmp/mini.py(10)spam()
-> 1/0
(Pdb) longlist
6 @foo(foo, lambda a:a)
(Pdb)
The last line illustrates the problem. `longlist` should show the definition
of `spam`, not just the decorator.
----------
messages: 239749
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: pdb's `longlist` shows only decorator if that one contains a lambda
type: behavior
versions: Python 3.4
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue23832>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com