Message229887
I think the reason this patch hasn't been discussed well is that it only changes the behavior for traceback.*_tb functions that only deal with tracebacks. I commented on the review page that we don't have to change the behavior of traceback.*_stack functions to make it obvious. Let me show an example:
import sys
def a():
b()
def b():
c()
def c():
d()
def d():
def e():
print_stack(limit=2) # Last 2 entries
''' Output:
File "file", line 331, in d
e()
File "file", line 328, in e
print_stack(limit=2) # Last 2 entries '''
raise Exception
e()
try:
a()
except Exception:
print_exc(limit=2) # 2 entries from the caller
''' Output:
Traceback (most recent call last):
File "file", line 336, in <module>
a()
File "file", line 318, in a
b()
Exception '''
If we decide to unify the behavior of *_tb and *_stack functions, the change will break some existing code, although the breakage will be purely cosmetic. |
|
Date |
User |
Action |
Args |
2014-10-23 18:17:10 | vaultah | set | recipients:
+ vaultah, serhiy.storchaka |
2014-10-23 18:17:10 | vaultah | set | messageid: <1414088230.61.0.979888125545.issue22619@psf.upfronthosting.co.za> |
2014-10-23 18:17:10 | vaultah | link | issue22619 messages |
2014-10-23 18:17:10 | vaultah | create | |
|