You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3.11only security fixes3.12only security fixes3.13bugs and security fixesdocsDocumentation in the Doc dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error
(I've tagged this as a "docs" issue because help() is arguably a part of the documentation. Also, some of the docs entries have a similar lack of details. I suppose that could be dealt with separately.)
The help() text for (at least some) builtin exceptions doesn't show the type-specific signature for __init__() (or __new__()), instead showing a generic one with (self, /, *args, **kwargs).
* I derived expected signatures from the content of Objects/exceptions.c.
† The doc entries for OSError, ExceptionGroup, and SyntaxError imply that they each take keyword arguments but they do not.
‡ The doc entries for OSError and SyntaxError do not include the alternate signature.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Footnotes
FYI, I don't mean to pick on ExceptionGroup. It happened to be the one for which I first noticed the problem. ↩
The text was updated successfully, but these errors were encountered:
3.11only security fixes3.12only security fixes3.13bugs and security fixesdocsDocumentation in the Doc dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error
Bug report
Bug description:
(I've tagged this as a "docs" issue because
help()
is arguably a part of the documentation. Also, some of the docs entries have a similar lack of details. I suppose that could be dealt with separately.)The
help()
text for (at least some) builtin exceptions doesn't show the type-specific signature for__init__()
(or__new__()
), instead showing a generic one with(self, /, *args, **kwargs)
.Here's an example (in the REPL) 1:
(The
help()
entry for__new__()
is likewise unhelpful.)There is a similar lack of information in the docs, though a handful of entries have at least some signature information.
All builtin exceptions (best effort catalog):
(incl. additional forms)
have
sig
BaseException
__init__(self, /, *args)
BaseExceptionGroup
__init__(self, msg, excs, /)
__init__(self, value=None, /, *args)
__init__(self, code=None, /, *args)
__init__(self, /, name=None, path=None, name_from=None)
__init__(self, errno, strerror, filename=None, winerror=None, filename2=None, /)
__init__(self, arg=None, /)
__init__(self, /, *args)
__init__(self, /, *args, name=None)
__init__(self, /, *args, name=None, obj=None)
__init__(self, msg, details, /)
__init__(self, msg=None, /, *args)
__init__(self, encoding, obj, start, end, reason, /)
__init__(self, encoding, obj, start, end, reason, /)
__init__(self, obj, start, end, reason, /)
Exception
/BaseException
--* I derived expected signatures from the content of Objects/exceptions.c.
† The doc entries for
OSError
,ExceptionGroup
, and SyntaxError imply that they each take keyword arguments but they do not.‡ The doc entries for
OSError
andSyntaxError
do not include the alternate signature.CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Footnotes
FYI, I don't mean to pick on
ExceptionGroup
. It happened to be the one for which I first noticed the problem. ↩The text was updated successfully, but these errors were encountered: