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
Dictionary order influences parseability #5183
Comments
Almost forgot: Both variants compile fine through CPython. |
Thank you for the report! |
I think its a different problem. On the current main branch, if I run the working version (dict-comp-last), and log the symbol table stack before the code object gets popped in compile_expression->Expr::Lambda after the emit! of the return value , I get
But if I run the non-working version (dict-comp-first), I get
It almost looks like the entry gets put into the symbol table twice. |
Hello everyone,
I'm currently using rustpython to embed an existing python library into a piece of software and I think I might have found a bug.
The goal is to create a dictionary with String keys and Callable entries somewhat like this:
If I try to run this code through the rustpython executable, I get the error message:
This differs from the error I get when I run this code through a VM I constructed myself:
However, when I swap the two lines in the dict, it compiles and runs fine:
I tried looking through the parser to find the place where this happens but had no luck.
Do you have an idea where I could start or what is going wrong?
Thanks a lot for your project!
The text was updated successfully, but these errors were encountered: