You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Upgrade typing.type_check_only to be applicable to variables(and maybe import statements) #955
Sure it has an underscore, but seems super sus that there is no mechanism to specify that a variable in a stub is just a type time helper and has no bearing on reality whatsoever.
You can specify explicitly that an import is accessible by importing it with an alias, although this in itself looks extremely hacky/workaroundy.
Also if it were possible to mark something in a stub as 'type time' only, then you could remove all the underscores and make a bunch of types look a lot nicer.
Very much related to python/mypy#11503, where a module import in a stub can be completely fictitious, and there is currently no way to specify it one way or the other.
changed the title [-]Add a method to specify that something is not accessable[/-][+]Upgrade `typing.type_check_only` to be applicable to variables(and maybe import statements)[/+]on Nov 22, 2021
Activity
JelleZijlstra commentedon Nov 22, 2021
https://docs.python.org/3/library/typing.html#typing.type_check_only
KotlinIsland commentedon Nov 22, 2021
Ironically:
Success: no issues found in 1 source file
Okay, that's a pretty good one, it sucks that it's not applicable to variables(TypeVars, type aliases) or import statements.
I'll update the issue.
[-]Add a method to specify that something is not accessable[/-][+]Upgrade `typing.type_check_only` to be applicable to variables(and maybe import statements)[/+]