GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — new throw() / athrow() syntax w/ single value is not clearly documented or noted as new in python 3.12 · Issue #105269 · python/cpython

new throw() / athrow() syntax w/ single value is not clearly documented or noted as new in python 3.12 #105269

New issue
Copy link
New issue
Copy link
Closed
Closed
new throw() / athrow() syntax w/ single value is not clearly documented or noted as new in python 3.12#105269
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir

Description

@zzzeek
zzzeek
opened on Jun 3, 2023
Issue body actions

Documentation

the docs at

cpython/Doc/reference/expressions.rst

Line 755 in 94a1eea

.. coroutinemethod:: agen.athrow(value)
does not note that the single arg 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]])
, even though you can actually pass the "value" as the first argument to 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

Activity

  1. zzzeek
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Jun 3, 2023
  2. terryjreedy commented on Jun 3, 2023

    @terryjreedy
    terryjreedy
    on Jun 3, 2023
    Member
    More actions

    @gvanrossum @iritkatriel Questions about (doc of) athrow(v) vs. athrow(t, v) vs athrow(t,b,t) and versions.

  3. iritkatriel commented on Jun 3, 2023

    @iritkatriel
    iritkatriel
    on Jun 3, 2023
    Member
    More actions

    @zzzeek Would you like to make a patch with doc updates?

  4. zzzeek commented on Jun 3, 2023

    @zzzeek
    zzzeek
    on Jun 3, 2023
    Author
    More actions

    @zzzeek Would you like to make a patch with doc updates?

    if you could tell me what the docs would say? Is there any change in behavior for athrow(value) vs. athrow(type, value, tback)? I vaguely recall similar functions where these are in fact equivalent but my co-maintainer @CaselIT is not sure

  5. iritkatriel commented on Jun 3, 2023

    @iritkatriel
    iritkatriel
    on Jun 3, 2023
    Member
    More actions

    @zzzeek Would you like to make a patch with doc updates?

    if you could tell me what the docs would say? Is there any change in behavior for athrow(value) vs. athrow(type, value, tback)? I vaguely recall similar functions where these are in fact equivalent but my co-maintainer @CaselIT is not sure

    If there is then please file a bug report.

  6. zzzeek commented on Jun 3, 2023

    @zzzeek
    zzzeek
    on Jun 3, 2023
    Author
    More actions

    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.

  7. iritkatriel commented on Jun 4, 2023

    @iritkatriel
    iritkatriel
    on Jun 4, 2023
    Member
    More actions

    No this issue is fine for the documentation.

  8. CaselIT commented on Jun 4, 2023

    @CaselIT
    CaselIT
    on Jun 4, 2023
    More actions

    @zzzeek Would you like to make a patch with doc updates?

    if you could tell me what the docs would say? Is there any change in behavior for athrow(value) vs. athrow(type, value, tback)? I vaguely recall similar functions where these are in fact equivalent but my co-maintainer @CaselIT is not sure

    If there is then please file a bug report.

    so the idea here is to document also for version previous to 3.12 the call signature athrow(value)? so copy paste the 3.12 documentation minus the deprecation?

    Reacted by Irit Katriel
  9. CaselIT commented on Jun 7, 2023

    @CaselIT
    CaselIT
    on Jun 7, 2023
    More actions

    I've created this PR #105468 to 3.11 branch.
    Should I also create backports to other branches? Down to what version?

  10. iritkatriel commented on Jun 7, 2023

    @iritkatriel
    iritkatriel
    on Jun 7, 2023
    Member
    More actions

    Thank you. We may be able to do automatic backports so hold off for now.

    Reacted by Federico Caselli
  11. iritkatriel
    added a commit that references this issue on Jun 7, 2023

    [3.11] Add single value `agen.athrow(value)` signature to the 3.11 docs

    acf3916
  12. miss-islington
    added 4 commits that reference this issue on Jun 7, 2023

    [3.11] Add single value `agen.athrow(value)` signature to the 3.11 docs

    e710647

    [3.11] Add single value `agen.athrow(value)` signature to the 3.11 docs

    75d23b2

    [3.11] Add single value `agen.athrow(value)` signature to the 3.11 docs

    57d62fc

    [3.11] Add single value `agen.athrow(value)` signature to the 3.11 docs

    fedd99e
  13. iritkatriel commented on Jun 7, 2023

    @iritkatriel
    iritkatriel
    on Jun 7, 2023
    Member
    More actions

    Thank you @zzzeek and @CaselIT !

    Reacted by Federico Caselli
  14. iritkatriel
    closed this as completedon Jun 7, 2023
  15. ned-deily
    added a commit that references this issue on Jun 28, 2023

    [3.7] Add single value `agen.athrow(value)` signature to the 3.11 docs …

    4970a1c
  16. ambv
    added 3 commits that reference this issue on Jul 5, 2023

    [3.10] [3.11] Add single value `agen.athrow(value)` signature to the …

    1851443

    [3.9] [3.11] Add single value `agen.athrow(value)` signature to the 3…

    ce93371

    [3.8] [3.11] Add single value `agen.athrow(value)` signature to the 3…

    db42de4
  17. carlosroman
    added a commit that references this issue on Oct 11, 2023

    [3.9] [3.11] Add single value `agen.athrow(value)` signature to the 3…

    76ad60f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.