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

Sync typeshed #14228

Merged
merged 4 commits into from
Dec 1, 2022
Merged

Sync typeshed #14228

merged 4 commits into from
Dec 1, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 1, 2022

Sync typeshed

Source commit:
python/typeshed@87d2683

Note that you will need to close and re-open the PR in order to trigger CI.

mypybot and others added 4 commits December 1, 2022 00:05
This is allegedly causing large performance problems, see 13821

typeshed/8231 had zero hits on mypy_primer, so it's not the worst thing
to undo. Patching this in typeshed also feels weird, since there's a
more general soundness issue. If a typevar has a bound or constraint, we
might not want to solve it to a Literal.

If we can confirm the performance regression or fix the unsoundness
within mypy, I might pursue upstreaming this in typeshed.

(Reminder: add this to the sync_typeshed script once merged)
Since the plugin provides superior type checking:
#13987 (comment)
@AlexWaygood AlexWaygood closed this Dec 1, 2022
@AlexWaygood AlexWaygood reopened this Dec 1, 2022
@github-actions
Copy link
Contributor Author

github-actions bot commented Dec 1, 2022

Diff from mypy_primer, showing the effect of this PR on open source code:

discord.py (https://github.com/Rapptz/discord.py)
- discord/ext/commands/converter.py:1177: error: Argument 2 to "issubclass" has incompatible type "<typing special form>"; expected "Union[type, UnionType, Tuple[Union[type, UnionType, Tuple[Any, ...]], ...]]"  [arg-type]
+ discord/ext/commands/converter.py:1177: error: Argument 2 to "issubclass" has incompatible type "<typing special form>"; expected "_ClassInfo"  [arg-type]
- discord/ext/commands/hybrid.py:206: error: Argument 2 to "isinstance" has incompatible type "_SpecialForm"; expected "Union[type, UnionType, Tuple[Union[type, UnionType, Tuple[Any, ...]], ...]]"  [arg-type]
+ discord/ext/commands/hybrid.py:206: error: Argument 2 to "isinstance" has incompatible type "_SpecialForm"; expected "_ClassInfo"  [arg-type]

anyio (https://github.com/agronholm/anyio)
+ src/anyio/_backends/_asyncio.py:1235: error: Redundant cast to "Transport"  [redundant-cast]
+ src/anyio/_backends/_asyncio.py:2171: error: Redundant cast to "DatagramTransport"  [redundant-cast]

pip (https://github.com/pypa/pip)
+ src/pip/_internal/network/xmlrpc.py:32: error: Argument 3 of "request" is incompatible with supertype "Transport"; supertype defines the argument type as "Union[bytes, Union[bytearray, memoryview, array[Any], mmap, _CData, PickleBuffer]]"  [override]
+ src/pip/_internal/network/xmlrpc.py:32: note: This violates the Liskov substitution principle
+ src/pip/_internal/network/xmlrpc.py:32: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/connector.py:967: error: Unused "type: ignore" comment

@AlexWaygood
Copy link
Member

The pip one was caused by python/typeshed#9166

@JelleZijlstra JelleZijlstra merged commit 6e9227a into master Dec 1, 2022
@JelleZijlstra JelleZijlstra deleted the mypybot/sync-typeshed branch December 1, 2022 03:43
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