Skip to content
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

Document SyntaxError args and interpretation for f-string fields #88488

Closed
terryjreedy opened this issue Jun 6, 2021 · 4 comments
Closed

Document SyntaxError args and interpretation for f-string fields #88488

terryjreedy opened this issue Jun 6, 2021 · 4 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir

Comments

@terryjreedy
Copy link
Member

BPO 44322
Nosy @terryjreedy, @ammaraskar, @pablogsal, @miss-islington
PRs
  • bpo-44322: Document more SyntaxError details. #26562
  • [3.10] bpo-44322: Document more SyntaxError details. (GH-26562) #26569
  • [3.9] bpo-44322: Document more SyntaxError details. (GH-26562) #26570
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-06-07.05:24:11.204>
    created_at = <Date 2021-06-06.18:08:02.252>
    labels = ['3.11', '3.9', '3.10', 'docs']
    title = 'Document SyntaxError args and interpretation for f-string fields'
    updated_at = <Date 2021-06-07.05:24:11.203>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2021-06-07.05:24:11.203>
    actor = 'terry.reedy'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2021-06-07.05:24:11.204>
    closer = 'terry.reedy'
    components = ['Documentation']
    creation = <Date 2021-06-06.18:08:02.252>
    creator = 'terry.reedy'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44322
    keywords = ['patch']
    message_count = 4.0
    messages = ['395208', '395240', '395241', '395244']
    nosy_count = 5.0
    nosy_names = ['terry.reedy', 'docs@python', 'ammar2', 'pablogsal', 'miss-islington']
    pr_nums = ['26562', '26569', '26570']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue44322'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @terryjreedy
    Copy link
    Member Author

    Document that SyntaxError args[1] is a tuple of the other attributes and how the meaning of the attributes is adjusted when the syntax error is in an f-string field replacement expression. Also add compile() to the list of builtins that can raise SyntaxError.

    PR to follow immediately. I wrote most of the text so that it works for 3.9 and 3.10+, with the new end info. In the example, the main part of the message changed from "invalid syntax" to "invalid syntax. Perhaps you forgot a comma?". I hid that with '...' but each could be given in the respective versions. args[1] changes from "('', 1, 4, '(a b)\n')" to "('', 1, 2, '(a b)\n', 1, 5)" and that will have to be changed in a 3.9 backport.

    Spinoff from bpo-43705. I will create a separate issue for using this information in IDLE.

    @terryjreedy terryjreedy added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Jun 6, 2021
    @terryjreedy terryjreedy added docs Documentation in the Doc dir 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Jun 6, 2021
    @terryjreedy terryjreedy added the docs Documentation in the Doc dir label Jun 6, 2021
    @terryjreedy
    Copy link
    Member Author

    New changeset 67dfa6f by Terry Jan Reedy in branch 'main':
    bpo-44322: Document more SyntaxError details. (GH-26562)
    67dfa6f

    @terryjreedy
    Copy link
    Member Author

    New changeset 2af690f by Miss Islington (bot) in branch '3.10':
    bpo-44322: Document more SyntaxError details. (GH-26562)
    2af690f

    @terryjreedy
    Copy link
    Member Author

    New changeset d5f8bd6 by Terry Jan Reedy in branch '3.9':
    [3.9] bpo-44322: Document more SyntaxError details. (GH-26562)
    d5f8bd6

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant