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

SyntaxError on 1not in... #90976

Closed
pxeger mannequin opened this issue Feb 21, 2022 · 6 comments
Closed

SyntaxError on 1not in... #90976

pxeger mannequin opened this issue Feb 21, 2022 · 6 comments
Labels
3.10 only security fixes 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@pxeger
Copy link
Mannequin

pxeger mannequin commented Feb 21, 2022

BPO 46820
Nosy @serhiy-storchaka, @lysnikolaou, @pablogsal, @miss-islington, @pxeger
PRs
  • bpo-46820: Fix a SyntaxError in a numeric literal followed by "not in" #31479
  • [3.10] bpo-46820: Fix a SyntaxError in a numeric literal followed by "not in" (GH-31479) #31493
  • bpo-46820: Refactor tests for ambiguous end of numerical literal #31494
  • [3.10] bpo-46820: Refactor tests for ambiguous end of numerical literal (GH-31494) #31566
  • 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 2022-02-25.13:09:25.795>
    created_at = <Date 2022-02-21.17:50:03.941>
    labels = ['interpreter-core', 'type-bug', '3.10', '3.11']
    title = 'SyntaxError on `1not in...`'
    updated_at = <Date 2022-02-25.13:09:25.794>
    user = 'https://github.com/pxeger'

    bugs.python.org fields:

    activity = <Date 2022-02-25.13:09:25.794>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-02-25.13:09:25.795>
    closer = 'serhiy.storchaka'
    components = ['Parser']
    creation = <Date 2022-02-21.17:50:03.941>
    creator = 'pxeger'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46820
    keywords = ['patch']
    message_count = 6.0
    messages = ['413664', '413672', '413696', '413697', '413969', '413971']
    nosy_count = 5.0
    nosy_names = ['serhiy.storchaka', 'lys.nikolaou', 'pablogsal', 'miss-islington', 'pxeger']
    pr_nums = ['31479', '31493', '31494', '31566']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue46820'
    versions = ['Python 3.10', 'Python 3.11']

    @pxeger
    Copy link
    Mannequin Author

    pxeger mannequin commented Feb 21, 2022

    The following code gives a SyntaxError in 3.10, but used to work fine before (I have tested it in 2.7, 3.8, 3.9):

    1not in [2, 3]
    

    It seems to be only the not in syntax which is affected; all other keywords still work correctly:

    1in [2, 3]
    1or 2
    1and 2
    1if 1else 1
    1is 1
    

    I know this syntax is deprecated in 3.10 (bpo-43833), but it still needs to work for now, so that old code written like this can keep working.

    @pxeger pxeger mannequin added 3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Feb 21, 2022
    @serhiy-storchaka
    Copy link
    Member

    Good catch. Thank you for your report Patrick.

    @serhiy-storchaka
    Copy link
    Member

    New changeset 090e5c4 by Serhiy Storchaka in branch 'main':
    bpo-46820: Fix a SyntaxError in a numeric literal followed by "not in" (GH-31479)
    090e5c4

    @serhiy-storchaka
    Copy link
    Member

    New changeset f20ac2e by Miss Islington (bot) in branch '3.10':
    bpo-46820: Fix a SyntaxError in a numeric literal followed by "not in" (GH-31479) (GH-31493)
    f20ac2e

    @serhiy-storchaka
    Copy link
    Member

    New changeset 98c3bea by Serhiy Storchaka in branch 'main':
    bpo-46820: Refactor tests for ambiguous end of numerical literal (GH-31494)
    98c3bea

    @miss-islington
    Copy link
    Contributor

    New changeset c7a0fd2 by Miss Islington (bot) in branch '3.10':
    bpo-46820: Refactor tests for ambiguous end of numerical literal (GH-31494)
    c7a0fd2

    @serhiy-storchaka serhiy-storchaka added the 3.11 only security fixes label Feb 25, 2022
    @serhiy-storchaka serhiy-storchaka added the 3.11 only security fixes label Feb 25, 2022
    @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.10 only security fixes 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants