add compileall stubs to 3 and add types to the ones in 2#1023
Merged
ambv merged 2 commits intopython:masterfrom Mar 18, 2017
Merged
add compileall stubs to 3 and add types to the ones in 2#1023ambv merged 2 commits intopython:masterfrom
ambv merged 2 commits intopython:masterfrom
Conversation
Didn't merge the stubs because all functions have additional parameters since 3.2, so there would be no shared code between 2 and 3.
Contributor
|
Good call! |
JukkaL
reviewed
Mar 18, 2017
| if sys.version_info < (3, 5): | ||
| def compile_dir(dir: _Path, maxlevels: int = ..., ddir: _Path = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ...) -> None: ... | ||
| else: | ||
| def compile_dir(dir: _Path, maxlevels: int = ..., ddir: _Path = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ..., workers: int = ...) -> None: ... |
Contributor
There was a problem hiding this comment.
According to https://docs.python.org/3/library/compileall.html, ddir is Optional.
| def compile_dir(dir: _Path, maxlevels: int = ..., ddir: _Path = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ...) -> None: ... | ||
| else: | ||
| def compile_dir(dir: _Path, maxlevels: int = ..., ddir: _Path = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ..., workers: int = ...) -> None: ... | ||
| def compile_file(fullname: _Path, ddir: _Path = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ...) -> None: ... |
Contributor
There was a problem hiding this comment.
Again, ddir is optional (probably everywhere in this module).
| _Path = Union[str, bytes] | ||
|
|
||
| # fx can be any object with a 'search' method; once we have Protocols we can change the type | ||
| def compile_dir(dir: _Path, maxlevels: int = ..., ddir: _Path = ..., force: bool = ..., rx: Optional[Pattern] = ..., quiet: int = ...) -> None: ... |
Contributor
There was a problem hiding this comment.
Looks like ddir should be Optional.
Member
Author
|
Opening a new PR to address Jukka's comments. |
Merged
hswong3i
pushed a commit
to alvistack/python-typeshed
that referenced
this pull request
May 25, 2025
…ersion (python#1024) As pointed out in python#1023, there is no risk of incompatibility, since the requires-python field will prevent installation on older Python versions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Didn't merge the stubs because all functions have additional parameters since 3.2,
so there would be no shared code between 2 and 3.