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.

Author serhiy.storchaka
Recipients pablogsal, serhiy.storchaka
Date 2021-08-18.04:09:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629259799.39.0.447835066598.issue44938@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-08-18 04:09:59serhiy.storchakasetrecipients: + serhiy.storchaka, pablogsal
2021-08-18 04:09:59serhiy.storchakasetmessageid: <1629259799.39.0.447835066598.issue44938@roundup.psfhosted.org>
2021-08-18 04:09:59serhiy.storchakalinkissue44938 messages
2021-08-18 04:09:59serhiy.storchakacreate