Skip to content

add compileall stubs to 3 and add types to the ones in 2#1023

Merged
ambv merged 2 commits intopython:masterfrom
JelleZijlstra:compileall
Mar 18, 2017
Merged

add compileall stubs to 3 and add types to the ones in 2#1023
ambv merged 2 commits intopython:masterfrom
JelleZijlstra:compileall

Conversation

@JelleZijlstra
Copy link
Copy Markdown
Member

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.

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.
@ambv
Copy link
Copy Markdown
Contributor

ambv commented Mar 18, 2017

Good call!

@ambv ambv merged commit efdf2f1 into python:master Mar 18, 2017
Comment thread stdlib/3/compileall.pyi
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: ...
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread stdlib/3/compileall.pyi
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: ...
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, ddir is optional (probably everywhere in this module).

Comment thread stdlib/2/compileall.pyi
_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: ...
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like ddir should be Optional.

@JelleZijlstra
Copy link
Copy Markdown
Member Author

Opening a new PR to address Jukka's comments.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants