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_type_check is not respected for string annotations #15307

Open
InSyncWithFoo opened this issue Jan 6, 2025 · 0 comments
Open

@no_type_check is not respected for string annotations #15307

InSyncWithFoo opened this issue Jan 6, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@InSyncWithFoo
Copy link
Contributor

For some reason, the logic implemented in #15215 failed to suppress this (playground):

import typing

@typing.no_type_check
def f(arg: "'A' or ''") -> None: ...
#            ^ F821

According to println!(), when checking the nested expression, the semantic model is in neither NO_TYPE_CHECK nor STRING_TYPE_DEFINITION context.

@InSyncWithFoo InSyncWithFoo changed the title @no_type_check is not respected when the stringified type expression is complex @no_type_check is not respected Jan 6, 2025
@MichaReiser MichaReiser added the bug Something isn't working label Jan 6, 2025
@dhruvmanila dhruvmanila changed the title @no_type_check is not respected @no_type_check is not respected for string annotations Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants