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

no error when name used before defined #11524

Closed
DetachHead opened this issue Nov 11, 2021 · 3 comments
Closed

no error when name used before defined #11524

DetachHead opened this issue Nov 11, 2021 · 3 comments
Labels
bug mypy got something wrong topic-runtime-semantics mypy doesn't model runtime semantics correctly

Comments

@DetachHead
Copy link
Contributor

DetachHead commented Nov 11, 2021

foo() # runtime NameError: name 'foo' is not defined

def foo():
    ...

https://mypy-play.net/?mypy=latest&python=3.10&gist=bc5b1e2767072f474d0bdf1ff2a8190e

@DetachHead DetachHead added the bug mypy got something wrong label Nov 11, 2021
@daredevil3435
Copy link

I am very curious about this program, could you guide me more I want to contribute. This will be my first time doing it

@KotlinIsland
Copy link
Contributor

Also:

print(a)  # no error
a: int = 1

@JelleZijlstra JelleZijlstra added the topic-runtime-semantics mypy doesn't model runtime semantics correctly label Mar 21, 2022
@JelleZijlstra
Copy link
Member

Duplicate of #686

@JelleZijlstra JelleZijlstra marked this as a duplicate of #686 Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-runtime-semantics mypy doesn't model runtime semantics correctly
Projects
None yet
Development

No branches or pull requests

4 participants