Giter Club home page Giter Club logo

Comments (4)

lucyleeow avatar lucyleeow commented on July 3, 2024 1

Thinking about it more, of course it wouldn't work, the outer function is defined but never called until runtime

from in-n-out.

tlambert03 avatar tlambert03 commented on July 3, 2024

Actually I would not expect that to resolve. You've hit on one of the big issues in usage of type annotations at runtime.

This is a long and complicated topic with lots written elsewhere, so I'll just link to relevant peps and you should search them:

Long story short, that usage just won't be supported. You would need to not use __future__.annotations or import at the global level

from in-n-out.

tlambert03 avatar tlambert03 commented on July 3, 2024

You can also read through pydantic/pydantic#2678

Point is, what we're trying to do here (using types at runtime) does have some limitations and caveats, and does kinda rely on a little "participation/cooperation" on the part of the end user, just as it does in pydantic

from in-n-out.

lucyleeow avatar lucyleeow commented on July 3, 2024

Okay interesting, thanks for the info, I'll close this!

from in-n-out.

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.