-
-
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
pkg_resources
: Types from assignments and aliases
#11511
pkg_resources
: Types from assignments and aliases
#11511
Conversation
@@ -248,7 +326,7 @@ class NullProvider: | |||
def metadata_listdir(self, name: str) -> list[str]: ... | |||
def run_script(self, script_name: str, namespace: dict[str, Any]) -> None: ... | |||
|
|||
# Doesn't actually extend NullProvider | |||
# Doesn't actually extend NullProvider, solves a typing issue in pytype_test.py |
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.
idk if that's still true, but that was the original reasoning, where some method returned a Distribution which was missing a property that NullProvider has.
This comment has been minimized.
This comment has been minimized.
pkg_resoruces
: Types from assignments and aliasespkg_resources
: Types from assignments and aliases
def get_supported_platform() -> str: ... | ||
def compatible_platforms(provided: str | None, required: str | None) -> bool: ... | ||
def get_default_cache() -> str: ... | ||
def get_importer(path_item: str) -> _Importer: ... |
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.
You also removed this on another PR, not sure why.
Otherwise this PR looks good.
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.
It's a re-import, (moved all the way to the top of the file).
Both PRs touched it because this change was relevant to both (it's now an import alias and it removes the _Importer class)
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.
Ah right, I missed that.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Extracted from #11455
Updated types that are either simplified or improved by using an assignement