-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
PEP 701 – Syntactic formalization of f-strings #102856
Comments
See this for the latest report on errors from @isidentical |
Draft PR for the C tokenizer up: #102855 |
Things for the cleanup of #102855:
|
Ok with #102855 we have the following failing tests:
Most of these are updating error messages, line numbers and other stuff but some may have actual bugs so we should check them. Please, mention which ones are you working on so we don't clash with one another. |
Working on |
Hello, Pablo! |
I can work with |
@Eclips4 @ramvikrams wonderful! Just make PRs against my fork! Report here or ping any of us if you find something that could be a bug (don't just fix the tests blindly because there may be bugs lurking). |
@lysnikolaou can you work on cleaning up the grammar + the actions? @isidentical can you work on cleaning up some of the tokenizer layers? (This is quite a lot so we can probably work together here). |
@pablogsal Lines 779 to 780 in 7f760c2
I think, there's two solutions:
|
Probably we can do this but on the other hand I would prefer to not overcomplicate this so I think (1) is better |
Will do! |
Also, I can take a look at |
All yours! |
I found that no one has claimed I looked at its commit history. This test case is a regression test for crash, so it seems like a good choice to keep the case and update the error message directly. Lines 39 to 40 in 72186aa
Update |
@pablogsal in |
The one failing there is this problem:
which I think is a feature version problem. |
cpython/Lib/test/test_type_comments.py Line 223 in 4695709
We can just change this to 6, and this test will be pass. I don't research this problem, but this solution looks like the simplest. However... supporting syntax of python3.4 && 3.5 looks cinda strange. |
I don't think that will work because we are not doing version checking anymore. See previous comments. The fix is probably to no pass |
Looks like no one is analyzing 4 platforms seem to have met the same problem here. |
@isidentical @lysnikolaou i have pushed some rules for error messages, please take a look and complete them with more if you have some spare cycles. With these the failures in |
I can confirm that the total number of failures has been decrased from 88 to 63. I'll try to see what are the most high impact ones and submit a PR to clear them. |
If anyone intends to work on any of the remaining tasks in |
After looking into the failure in check(b'Python = "\xcf\xb3\xf2\xee\xed" +', 1, 18) Old parser and the new parser raises the same exception (UnicodeDecodeError), but with different col_offset. This is because it was raised by the wrong token. I would consider it a bug in the old parser. Just as this comment mentions, cpython/Parser/string_parser.c Lines 38 to 48 in 64cb1a4
the error token was not correctly set in the old parser. Maybe we should open an issue for the old parse? But the possible fixing might be error-prone, since we might need to keep track of every possible code path. As for the new parser, I think a change in the test case would be fine. |
I am working on an PR to fix
|
Hi, I got some bad news. I have been testing against memory leaks with For example,
These references are most likely to leak during the compilation (such as using We might need to look into that. Update: Memory Leakage fixed by commit pablogsal@d8b12e2 The root cause is that someone forgot to use This is very tricky because Just like an old saying, managing memory by hand is so much pain, and also error-prone. This check can be done, by analyzing the PyObject*s registered to the arena by the time the AST was created, but that is a totally different story. |
Only 12 test left in |
…04824) Co-authored-by: Pablo Galindo Salgado <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
…cs (pythonGH-104824) (cherry picked from commit c45701e) Co-authored-by: Marta Gómez Macías <[email protected]> Co-authored-by: Pablo Galindo Salgado <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
…ocs (GH-104824) (#104847) gh-102856: Add changes related to PEP 701 in 3.12 What's New docs (GH-104824) (cherry picked from commit c45701e) Co-authored-by: Marta Gómez Macías <[email protected]> Co-authored-by: Pablo Galindo Salgado <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
Closing this as we already have a What's New entry, C tokenizer, and Python tokenizer. Let's tackle any small remaining items in separate issues from now on. Probably we need to alter https://docs.python.org/3/reference/lexical_analysis.html#formatted-string-literals. @lysnikolaou can you take a go at that? |
(cherry picked from commit 3e97c00) Co-authored-by: Hugo van Kemenade <[email protected]>
Sure! |
Co-authored-by: Hugo van Kemenade <[email protected]>
…r PEP701 (pythonGH-104861) (cherry picked from commit 8e5b3b9) Co-authored-by: Lysandros Nikolaou <[email protected]>
…er PEP701 (GH-104861) (#104865) (cherry picked from commit 8e5b3b9) Co-authored-by: Lysandros Nikolaou <[email protected]>
Ah great! I didn't know someone would continue PEP 536. Happy that it's happening! Shouldn't PEP 536 be mentioned in this one? |
It's mentioned in the PEP: https://peps.python.org/pep-0701/ Btw as heads up: We don't monitor normally closed issues so is very likely that people won't answer to comments when the issue is closed :) |
Thanks! Seems like I missed the mention then. Perfect! |
Linked PRs
The text was updated successfully, but these errors were encountered: