pep 484: explicit reexport as intended#4586
Conversation
See discussion on typing-sig. This doesn't take care of some third_party libraries, will follow up on those.
gvanrossum
left a comment
There was a problem hiding this comment.
Thanks! I found a few blank lines that strike me as excessive (we're not following PEP 8 on purpose).
| 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.
I don't think this blank line helps readability.
| if sys.version_info < (3, 9): | ||
| from os import devnull as DEV_NULL | ||
| import os | ||
|
|
| from functools import wraps as wraps | ||
| from StringIO import StringIO as BytesIO, StringIO as StringIO | ||
| from StringIO import StringIO as StringIO | ||
|
|
|
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. |
srittau
left a comment
There was a problem hiding this comment.
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.