Skip to content

Sync vendored typeshed stubs#14030

Merged
AlexWaygood merged 2 commits intomainfrom
typeshedbot/sync-typeshed
Nov 1, 2024
Merged

Sync vendored typeshed stubs#14030
AlexWaygood merged 2 commits intomainfrom
typeshedbot/sync-typeshed

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Nov 1, 2024

Close and reopen this PR to trigger CI

@github-actions github-actions bot requested a review from carljm as a code owner November 1, 2024 00:29
@github-actions github-actions bot added the internal An internal refactor or improvement label Nov 1, 2024
@AlexWaygood AlexWaygood closed this Nov 1, 2024
@AlexWaygood AlexWaygood reopened this Nov 1, 2024
@AlexWaygood
Copy link
Member

AlexWaygood commented Nov 1, 2024

Two changes to our tests were required:

  • Add types.ModuleType.__doc__ python/typeshed#12918 means that we now understand that __doc__ is present in the global namespace of all modules (good!)

  • naming and inheritance for importlib python/typeshed#12775 means that we no longer understand what the type of types.ModuleType.__spec__ is (bad!).

    This is because typeshed annotates types.ModuleType.__spec__ as ModuleSpec | None in types.pyi, and ModuleSpec is imported from importlib.machinery in types.pyi, and importlib/machinery.pyi now re-exports ModuleSpec from importlib._bootstrap, and importlib/_bootstrap.pyi re-exports ModuleSpec from _frozen_importlib via a * import, and we don't understand * imports yet.

    I'm not sure it's absolutely necessary for the stubs to have quite so much indirection here... but that's a conversation we'd have to have over at typeshed. Whatever the case, even if there are no changes at typeshed, we should fix this regression in type inference naturally when we add support for * imports.

@AlexWaygood AlexWaygood merged commit 7c2da4f into main Nov 1, 2024
@AlexWaygood AlexWaygood deleted the typeshedbot/sync-typeshed branch November 1, 2024 10:51
@github-actions
Copy link
Contributor Author

github-actions bot commented Nov 1, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

TomerBin pushed a commit to TomerBin/ruff that referenced this pull request Nov 3, 2024
Co-authored-by: typeshedbot <>
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant