This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SyntaxError on `1not in...`
Type: behavior Stage: resolved
Components: Parser Versions: Python 3.11, Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: lys.nikolaou, miss-islington, pablogsal, pxeger, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2022-02-21 17:50 by pxeger, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31479 merged serhiy.storchaka, 2022-02-21 19:57
PR 31493 merged miss-islington, 2022-02-22 07:52
PR 31494 merged serhiy.storchaka, 2022-02-22 08:05
PR 31566 merged miss-islington, 2022-02-25 08:25
Messages (6)
msg413664 - (view) Author: Patrick Reader (pxeger) * Date: 2022-02-21 17:50
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 (bpo43833), but it still needs to work for now, so that old code written like this can keep working.
msg413672 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-02-21 19:58
Good catch. Thank you for your report Patrick.
msg413696 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-02-22 07:52
New changeset 090e5c4b946b28f50fce445916c5d3ec45c8f45f by Serhiy Storchaka in branch 'main':
bpo-46820: Fix a SyntaxError in a numeric literal followed by "not in" (GH-31479)
https://github.com/python/cpython/commit/090e5c4b946b28f50fce445916c5d3ec45c8f45f
msg413697 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-02-22 10:00
New changeset f20ac2ed076df63a77f65ff2660148af9f1a9b3c 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)
https://github.com/python/cpython/commit/f20ac2ed076df63a77f65ff2660148af9f1a9b3c
msg413969 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-02-25 08:25
New changeset 98c3bea4d1c7335135e60946d0ec8cd5031fb6c0 by Serhiy Storchaka in branch 'main':
bpo-46820: Refactor tests for ambiguous end of numerical literal (GH-31494)
https://github.com/python/cpython/commit/98c3bea4d1c7335135e60946d0ec8cd5031fb6c0
msg413971 - (view) Author: miss-islington (miss-islington) Date: 2022-02-25 08:50
New changeset c7a0fd2d3fa178c83c269f2b39ebf64a0c5babcd by Miss Islington (bot) in branch '3.10':
bpo-46820: Refactor tests for ambiguous end of numerical literal (GH-31494)
https://github.com/python/cpython/commit/c7a0fd2d3fa178c83c269f2b39ebf64a0c5babcd
History
Date User Action Args
2022-04-11 14:59:56adminsetgithub: 90976
2022-02-25 13:09:25serhiy.storchakasetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.11
2022-02-25 08:50:18miss-islingtonsetmessages: + msg413971
2022-02-25 08:25:26serhiy.storchakasetmessages: + msg413969
2022-02-25 08:25:22miss-islingtonsetpull_requests: + pull_request29688
2022-02-22 10:00:54serhiy.storchakasetmessages: + msg413697
2022-02-22 08:05:32serhiy.storchakasetpull_requests: + pull_request29624
2022-02-22 07:52:09miss-islingtonsetnosy: + miss-islington

pull_requests: + pull_request29623
stage: patch review
2022-02-22 07:52:01serhiy.storchakasetmessages: + msg413696
2022-02-21 19:58:37serhiy.storchakasetmessages: + msg413672
stage: patch review -> (no value)
2022-02-21 19:57:25serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request29608
2022-02-21 17:52:33pablogsalsetnosy: + serhiy.storchaka
2022-02-21 17:50:03pxegercreate