[issue44938] Expose PyErr_ChainExceptions in the stable API

2021-12-10 Thread Gregory P. Smith
Gregory P. Smith added the comment: related: https://www.python.org/dev/peps/pep-0490/ (rejected pep to auto-chain from C API calls) I don't come across it often, but I did just review some code at work today where the chain might have been nice (though not a big deal). -- nosy:

[issue44938] Expose PyErr_ChainExceptions in the stable API

2021-08-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: As long as the cycles don't actually end in a crash or an infinite cycle, I think is fine to not include them in the contact. Even if that were included I don't think is actually a problem. Many APIs in C or C++ require the user to not form cycles,

[issue44938] Expose PyErr_ChainExceptions in the stable API

2021-08-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: I agree with Serhiy that this API isn't necessarily the right one. It's just what happens to be there now. Also, we're still not clear on our stance towards cycles (see the issue25782 discussion). (Maybe the exposed version should result in an error if it

[issue44938] Expose PyErr_ChainExceptions in the stable API

2021-08-18 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Serhiy, what do you suggest we should do then? -- ___ Python tracker ___ ___

[issue44938] Expose PyErr_ChainExceptions in the stable API

2021-08-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 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

[issue44938] Expose PyErr_ChainExceptions in the stable API

2021-08-17 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +26267 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27799 ___ Python tracker

[issue44938] Expose PyErr_ChainExceptions in the stable API

2021-08-17 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : Currently, exception chaining in the C-API must be done by hand. This is a painstaking process that involves several steps and is very easy to do incorrectly. We currently have a private function: _PyErr_ChainExceptions that does this job. Given