Matthias Bussonnier added the comment:

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.

----------
nosy: +mbussonn

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26389>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to