-
Notifications
You must be signed in to change notification settings - Fork 23
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
Introduce Y042: Enforce private names for type aliases #240
Conversation
I'll look at the typeshed hits in a bit. It looks like there might be too many false positives for this to be merged (but also looks like there might be some true positives in there that should be fixed). |
I would put type aliases into a separate test. Type aliases are more likely to be exported than type vars and users might want to toggle this separately. Also it means we can add this test independently and disable it in typeshed, until fixed if necessary. |
That makes sense, I'll make the change |
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This uncovered a few genuine typeshed bugs (python/typeshed#8248 tackles some, but not all of them; there's more still to work through -- the full typeshed-primer run is at https://github.com/PyCQA/flake8-pyi/runs/7217799410?check_suite_focus=true). But I think there's too many false positives here for this to be mergeable. Ultimately the issue is that this pattern is fairly common in typeshed, if you have a class where the name changed between Python versions: class _Foo: ...
if sys.version_info >= (3, 9):
Foo: TypeAlias = _Foo
else:
Bar: TypeAlias = _Foo |
python/typeshed#8252 fixed the other ones. |
Part of #238