Giter Site home page Giter Site logo

Comments (3)

apexys avatar apexys commented on May 28, 2024

Almost forgot: Both variants compile fine through CPython.

from rustpython.

youknowone avatar youknowone commented on May 28, 2024

Thank you for the report!
Somehow, x in "d": lambda x: x +1, doesn't exist in symbol table. How about starting comparing how the symbol put in or not put in by the order?

from rustpython.

apexys avatar apexys commented on May 28, 2024

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

ST stack [SymbolTable(2 symbols, 1 sub scopes), SymbolTable(1 symbols, 0 sub scopes)]
Sub Table Symbols None
ST stack [SymbolTable(2 symbols, 0 sub scopes), SymbolTable(2 symbols, 0 sub scopes), SymbolTable(1 symbols, 0 sub scopes)]

But if I run the non-working version (dict-comp-first), I get

ST stack [SymbolTable(2 symbols, 1 sub scopes), SymbolTable(2 symbols, 1 sub scopes)]

It almost looks like the entry gets put into the symbol table twice.
But why and where does that happen?

from rustpython.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.