-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
pep 484: explicit reexport as intended #4586
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
Conversation
See discussion on typing-sig. This doesn't take care of some third_party libraries, will follow up on those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I found a few blank lines that strike me as excessive (we're not following PEP 8 on purpose).
@@ -268,7 +270,9 @@ class stat_result: | |||
st_type: int | |||
|
|||
if sys.version_info >= (3, 6): | |||
from builtins import _PathLike as PathLike # See comment in builtins | |||
from builtins import _PathLike | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this blank line helps readability.
@@ -3,7 +3,9 @@ | |||
import sys | |||
|
|||
if sys.version_info < (3, 9): | |||
from os import devnull as DEV_NULL | |||
import os | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No blank line here.
third_party/2/six/__init__.pyi
Outdated
@@ -5,7 +5,9 @@ import typing | |||
import unittest | |||
from __builtin__ import unichr as unichr | |||
from functools import wraps as wraps | |||
from StringIO import StringIO as BytesIO, StringIO as StringIO | |||
from StringIO import StringIO as StringIO | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No blank line.
Typeshed has surrendered itself to black, which mandates those blank lines |
Oooh, that last failing test is a fun one. The code flow through mypy is entirely different when defining a type alias instead of renaming on import. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll tentatively approve this, pending a solution for the mypy failures. I think it's a good idea that the re-export ambiguity is being discussed and fixed.
I haven't checked but I think you need to alias generics with something like |
I think this just works and needs builtins._PathLike to not be hardcoded in mypy. Going to attempt the merge dance. |
Yes; I was just about to say that I think it'd be weird to have to add typevars to emulate behavior that would have previously worked in the " |
As a result of python/typeshed#4586
As a result of python/typeshed#4586
…9512) As a result of python/typeshed#4586 Co-authored-by: hauntsaninja <>
…ython#9512) As a result of python/typeshed#4586 Co-authored-by: hauntsaninja <>
See discussion on typing-sig.
This doesn't take care of some third_party libraries, will follow up on
those.