Skip to content

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

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

Merged
merged 2 commits into from
Mar 18, 2017

Conversation

JelleZijlstra
Copy link
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
Contributor

ambv commented Mar 18, 2017

Good call!

@ambv ambv merged commit efdf2f1 into python:master 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: ...
Copy link
Contributor

Choose a reason for hiding this comment

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

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
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).

_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
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
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