← 输入框|bugs.python.org|刷新

➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 mbussonn
收信人 brett.cannon, martin.panter, mbussonn, terry.reedy
日期 2017-02-27.00:18:55
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1488154735.6.0.874647538489.issue26389@psf.upfronthosting.co.za>
In-reply-to
内容
Just came across that with wanting to use print_exception and got the same idea.

It seem like in print_exception, and format_exception, etype is already ignored and `type(value)` is used, so I think we could also "just" also ignore tb (unless set) and use `value.__traceback__`. Leaving the API to function(None, exception)

I don't see any clean way to migrate to a new API (IMHO a forced `exc kwarg` is not discoverable enough vs a (None, e, e.__traceback__)

A possibility, as `etype` is already unused, would be replace it with etype_or_exception, and in case it's a full exception use it as the sole parameter from which type and tb get extracted. 

Though that feels weird as well, and the Deprecation Cycles would need to be long.

Already emitting deprecation warnings (that etype is ignored) would be good.
历史
日期 用户 动作 参数
2017-02-27 00:18:55mbussonn修改recipients: + mbussonn, brett.cannon, terry.reedy, martin.panter
2017-02-27 00:18:55mbussonn修改messageid: <1488154735.6.0.874647538489.issue26389@psf.upfronthosting.co.za>
2017-02-27 00:18:55mbussonn链接issue26389 messages
2017-02-27 00:18:55mbussonn创建