Skip to content
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

Fix a few issues with parameter defaults #9572

Merged
merged 1 commit into from
Jan 20, 2023
Merged

Fix a few issues with parameter defaults #9572

merged 1 commit into from
Jan 20, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Jan 20, 2023

Some of these vary depending on the machine you're running on (the ones in sysconfig.pyi, platform.pyi, ctypes/__init__.pyi, multiprocessing/heap.pyi, pydoc.pyi). We might be able to give slightly better defaults for some of these if PyCQA/flake8-pyi#336 (or something like it) is merged.

Some others currently have integer defaults in the stub, but enum defaults at runtime, causing stubtest to complain if you use mypy master (the ones in ssl.pyi, socket.pyi, asyncore.pyi).

The email.parser ones just need some method overrides in the stub that weren't necessary before we added default values.

Refs #8988 (comment), and following comments.

@AlexWaygood
Copy link
Member Author

AlexWaygood commented Jan 20, 2023

I haven't changed any of the more opinionated ones disallowed by PyCQA/flake8-pyi#336, such as a few integer defaults which are simply very big numbers -- I figured we should let the discussion on that PR finish first :)

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@@ -37,9 +37,7 @@ def java_ver(
release: str = "", vendor: str = "", vminfo: tuple[str, str, str] = ..., osinfo: tuple[str, str, str] = ...
) -> tuple[str, str, tuple[str, str, str], tuple[str, str, str]]: ...
def system_alias(system: str, release: str, version: str) -> tuple[str, str, str]: ...
def architecture(
Copy link
Member

Choose a reason for hiding this comment

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

part of me wants to keep this as an easter egg

Copy link
Member Author

Choose a reason for hiding this comment

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

It's iconic

@JelleZijlstra JelleZijlstra merged commit d98d167 into main Jan 20, 2023
@JelleZijlstra JelleZijlstra deleted the bad-defaults branch January 20, 2023 17:48
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.

2 participants