-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
Possible regression in Python3.12 tokenizer #105013
Comments
Bug: python/cpython#105013 Signed-off-by: Sam James <sam@gentoo.org>
The typo seems to be in pyrsistent itself. lambda l: (l, pvector(l))) |
Sorry, I don't follow, where is the typo? Why this works PVectorAndLists = st.lists(st.builds(RefCountTracker)).map(lambda l: (l, pvector(l))) and this doesn't PVectorAndLists = st.lists(st.builds(RefCountTracker)).map(
lambda l: (l, pvector(l))) btw, the wrapped version works in Python3.10 and Python3.11 |
Correction: the third parenthesis comes from the line above (found out preparing a PR for pyrsistent): PVectorAndLists = st.lists(st.builds(RefCountTracker)).map(
lambda l: (l, pvector(l))) |
This is not failing on
|
Actually, both versions work with 3.12 (current):
This shows:
|
Can you provide a reproducer that doesn't use any 3rd party stuff that fails with |
pyrsistent tests still don't work with the tip of import inspect
ordered_pair = (
lambda right: [].map(
lambda length: ()))
print(inspect.getsource(ordered_pair)) The issue seems to be related to reflection and it prints out following error with Python3.12
but Python3.11 prints this:
|
or this one with just one import inspect
l = (
lambda x: ())
print(inspect.getsource(l)) |
It works correctly if I concatenate it to one line l = (lambda x: ()) |
The regression here is not on the
|
Seems that I can execute the test suite correctly with the fix installed:
|
…iline lambdas Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
…ed multiline lambdas
…nthesized multiline lambdas
…ambdas (pythonGH-105021) (cherry picked from commit 3a5be87) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Fixed in #105021 |
I can confirm that this patch alone is sufficient to resolve the collection error in pyrsistent. Python segfaults while running the tests afterwards but FWICS this is another bug that's already fixed in the 3.12 branch. |
@mgorny thanks for testing. |
Bug report
I have encountered a possible regression while I was testing pyrsistent with python3.12_beta1, see tobgu/pyrsistent#275. Tests fail with following error:
It is triggered for this code (see https://github.com/tobgu/pyrsistent/blob/cc90f3e2b339653fde0df422aaf3ccdb3fc1225d/tests/hypothesis_vector_test.py#L48-L49 )
if I concatenate it to one line, everything works. I also tried to backport fix for #104866 as it sounds relevant, but it didn't solved the issue.
Your environment
~amd64
Linked PRs
The text was updated successfully, but these errors were encountered: