-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new throw() / athrow() syntax w/ single value is not clearly documented or noted as new in python 3.12 #105269
Comments
@gvanrossum @iritkatriel Questions about (doc of) athrow(v) vs. athrow(t, v) vs athrow(t,b,t) and versions. |
@zzzeek Would you like to make a patch with doc updates? |
If there is then please file a bug report. |
Hi - The bug is, "the documentation does not explain this". I dont understand the documentation, and I dont know how to write the documentation because I don't understand the API. Do I need to file a bug report under a different tag? I had the impression that "documentation bugs" was the appropriate place to post this. |
No this issue is fine for the documentation. |
so the idea here is to document also for version previous to 3.12 the call signature |
I've created this PR #105468 to 3.11 branch. |
Thank you. We may be able to do automatic backports so hold off for now. |
pythongh-105269 (pythonGH-105468) (cherry picked from commit acf3916) Co-authored-by: Federico Caselli <[email protected]>
pythongh-105269 (pythonGH-105468) (cherry picked from commit acf3916) Co-authored-by: Federico Caselli <[email protected]>
pythongh-105269 (pythonGH-105468) (cherry picked from commit acf3916) Co-authored-by: Federico Caselli <[email protected]>
pythongh-105269 (pythonGH-105468) (cherry picked from commit acf3916) Co-authored-by: Federico Caselli <[email protected]>
…gh-105269 (GH-105468) (#105479) (cherry picked from commit acf3916) Co-authored-by: Federico Caselli <[email protected]>
…3.11 docs gh-105269 (GH-105468) (#105480) (cherry picked from commit acf3916) Co-authored-by: Federico Caselli <[email protected]>
….11 docs gh-105269 (GH-105468) (#105477) (cherry picked from commit acf3916) Co-authored-by: Federico Caselli <[email protected]>
….11 docs gh-105269 (GH-105468) (#105478) (cherry picked from commit acf3916) Co-authored-by: Federico Caselli <[email protected]>
….11 docs pythongh-105269 (pythonGH-105468) (python#105477) (cherry picked from commit acf3916) Co-authored-by: Federico Caselli <[email protected]>
Documentation
the docs at
cpython/Doc/reference/expressions.rst
Line 755 in 94a1eea
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
throw()
. It's not clear to us here if usingthrow(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)
andathrow(type, value)
and within what Python versions this new style should be accepted as an exact drop-in for the old style? thanksLinked PRs
agen.athrow(value)
signature to the 3.11 docs gh-105269 #105468agen.athrow(value)
signature to the 3.11 docs gh-105269 (GH-105468) #105477agen.athrow(value)
signature to the 3.11 docs gh-105269 (GH-105468) #105478agen.athrow(value)
signature to the 3.11 docs gh-105269 (GH-105468) #105479agen.athrow(value)
signature to the 3.11 docs gh-105269 (GH-105468) #105480The text was updated successfully, but these errors were encountered: