Message399820
As the original author of _PyErr_ChainExceptions() (issue21715) I am not sure that its name and signature are optimal. It did not matter while it was internal function because we could change them at any moment, but for public API the design should be more thoughtful.
Is passing three arguments convenient enough? Would not be better to pass them as a single argument like in _PyErr_ChainStackItem()? Is the function name good? Should we provide several similar functions for setting __context__, __cause__ and both?
There are other, more specialized, helpers: _PyErr_FormatFromCause() and _PyErr_TrySetFromCause().
There are also some flaws in setting __context__ and __cause__ (see issue39725). Perhaps we will design better concept of chaining exceptions in future. |
|
Date |
User |
Action |
Args |
2021-08-18 04:09:59 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pablogsal |
2021-08-18 04:09:59 | serhiy.storchaka | set | messageid: <1629259799.39.0.447835066598.issue44938@roundup.psfhosted.org> |
2021-08-18 04:09:59 | serhiy.storchaka | link | issue44938 messages |
2021-08-18 04:09:59 | serhiy.storchaka | create | |
|