-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
Documentation
the docs at
cpython/Doc/reference/expressions.rst
Line 755 in 94a1eea
.. coroutinemethod:: agen.athrow(value) |
throw(value)
calling style appears to be new in Python 3.12; docs for 3.11 do not refer to it: cpython/Doc/reference/expressions.rst
Line 743 in 8de607a
.. coroutinemethod:: agen.athrow(type[, value[, traceback]]) |
throw()
. It's not clear to us here if using throw(value)
will work identically on older Python versions. Looking at 396b583 it seems to be possibly 3.11 related, but in #96348 @gvanrossum claims "It allows passing either an exception, or a (type, value, traceback) triple where the value and traceback are optional. ", but this does not seem to be documented and is creating some confusion over here.
the changelog as well as the deprecation warning both refer to the "single arg version" , which will "work" on older py3 versions but has different behavior (Edit: or maybe it doesn't. we're not sure :) ).
can this document be clarified as to what differences, if any, exist between athrow(value)
and athrow(type, value)
and within what Python versions this new style should be accepted as an exact drop-in for the old style? thanks
Linked PRs
- [3.11] Add single value
agen.athrow(value)
signature to the 3.11 docs gh-105269 #105468 - [3.9] [3.11] Add single value
agen.athrow(value)
signature to the 3.11 docs gh-105269 (GH-105468) #105477 - [3.8] [3.11] Add single value
agen.athrow(value)
signature to the 3.11 docs gh-105269 (GH-105468) #105478 - [3.7] [3.11] Add single value
agen.athrow(value)
signature to the 3.11 docs gh-105269 (GH-105468) #105479 - [3.10] [3.11] Add single value
agen.athrow(value)
signature to the 3.11 docs gh-105269 (GH-105468) #105480
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir