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

PEP 709 behavior change around mangling #104604

Closed
JelleZijlstra opened this issue May 18, 2023 · 2 comments
Closed

PEP 709 behavior change around mangling #104604

JelleZijlstra opened this issue May 18, 2023 · 2 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@JelleZijlstra
Copy link
Member

Another bug with comprehension inlining.

I made the fuzzer (carljm/compgenerator#1) use __a and __b as names in the hope of finding bugs around name mangling and got this one:

class __a:
    __a = (1)[[__a for __b in [1]]] = 1

On #104602:

>>> class __a:
...     __a = (1)[[__a for __b in [1]]] = 1
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in __a
TypeError: 'int' object does not support item assignment

On 3.11:

>>> class __a:
...     __a = (1)[[__a for __b in [1]]] = 1
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in __a
  File "<stdin>", line 2, in <listcomp>
NameError: name '_a__a' is not defined. Did you mean: '_a__b'?

I think that means we're missing some name mangling, but haven't thought too deeply about this yet.

@JelleZijlstra JelleZijlstra added the type-bug An unexpected behavior, bug, or error label May 18, 2023
@JelleZijlstra
Copy link
Member Author

cc @carljm

@carljm carljm self-assigned this May 18, 2023
@JelleZijlstra
Copy link
Member Author

JelleZijlstra commented May 18, 2023

Actually this is just the class scoping change. It doesn't reproduce any more after #104528; looks like I forgot to merge that in before starting the fuzzer. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants