-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Merge stdlib/{2,3}/os/{__init__,path}.pyi #1111
Conversation
To be renamed into stdlib/2and3/os/path.pyi later.
So there's still a problem here -- are you aware that there's also a definition of stat_result in posix.pyi? There are quite a few duplicates there -- it doesn't matter for the constants (e.g. O_APPEND) but it does match for the classes, since I've found code (in our own codebase) using posix.stats_result in type annotations. I expect it may be ditto for posixpath.pyi. |
Anther issue: I found a few expressions like this:
Now arguably this should be replaced with
But the old code should still be considered valid IMO. I'm not sure how to fix this other than making mypy somehow recognize constant definitions like |
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.
See discussion in main thread of PR.
This merge conflicts now because I merged #1103. Currently the stubs for posix.pyi in Python 2 are fairly complete, but the ones in Python 3 just re-export stat_result from os.pyi. In reality the os module mostly re-exports names from posix (or from nt on windows?), so maybe ideally the os stub would just have a big |
I tried bringing everything into posix.pyi but hit a small hitch if I wanted to just do |
I see, that's unfortunate. I can't really think of a better solution than repeating all the names. |
I'm gonna close this PR and split it up into smaller parts. |
This is the full merge of os and os.path in one PR. With this the files are identical and could easily be renamed into
stdlib/2and3