Skip to content

Sync typeshed - #17201

Merged
JelleZijlstra merged 4 commits into
masterfrom
mypybot/sync-typeshed
May 1, 2024
Merged

JelleZijlstra merged 4 commits into
masterfrom
mypybot/sync-typeshed

Conversation

@github-actions

@github-actions github-actions Bot commented May 1, 2024

Copy link
Copy Markdown
Contributor

Sync typeshed

Source commit:
python/typeshed@f244be9

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

mypybot and others added 4 commits May 1, 2024 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)
@github-actions

github-actions Bot commented May 1, 2024

Copy link
Copy Markdown
Contributor Author

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

jinja (https://github.com/pallets/jinja)
+ src/jinja2/async_utils.py:67: error: Redundant cast to "V"  [redundant-cast]

antidote (https://github.com/Finistere/antidote)
+ src/antidote/lib/lazy_ext/_lazy.py:171: error: Non-overlapping identity check (left operand type: "Literal[FunctionKind.VALUE]", right operand type: "Literal[FunctionKind.METHOD]")  [comparison-overlap]
+ src/antidote/lib/lazy_ext/_lazy.py:174: error: Unused "type: ignore" comment  [unused-ignore]
+ src/antidote/lib/lazy_ext/_lazy.py:178: error: Non-overlapping identity check (left operand type: "Literal[FunctionKind.VALUE]", right operand type: "Literal[FunctionKind.PROPERTY]")  [comparison-overlap]
+ src/antidote/lib/lazy_ext/_lazy.py:181: error: Unused "type: ignore" comment  [unused-ignore]
+ src/antidote/lib/lazy_ext/_lazy.py:185: error: Non-overlapping identity check (left operand type: "Literal[FunctionKind.VALUE]", right operand type: "Literal[FunctionKind.FUNCTION]")  [comparison-overlap]
+ tests/lib/interface/test_function.py:44: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/lib/interface/test_function.py:45: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/lib/interface/test_function.py:78: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/lib/interface/test_function.py:79: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/lib/interface/test_function.py:83: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/lib/interface/test_function.py:86: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/lib/interface/test_function.py:89: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/lib/interface/test_function.py:145: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/lib/interface/test_function.py:154: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/lib/interface/test_function.py:174: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/lib/interface/test_function.py:188: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/lib/interface/test_function.py:191: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/lib/interface/test_function.py:194: error: Unused "type: ignore" comment  [unused-ignore]

pytest (https://github.com/pytest-dev/pytest)
+ testing/test_monkeypatch.py:418: error: Statement is unreachable  [unreachable]

vision (https://github.com/pytorch/vision)
+ torchvision/models/_api.py:128: error: Unused "type: ignore" comment  [unused-ignore]

spack (https://github.com/spack/spack)
- lib/spack/spack/oci/oci.py:142: error: Argument 1 to "endpoint" of "ImageReference" has incompatible type "str | None"; expected "str"  [arg-type]

trio (https://github.com/python-trio/trio)
+ src/trio/_core/_ki.py:145: error: Item "None" of "Optional[FrameType]" has no attribute "f_locals"  [union-attr]
+ src/trio/_core/_run.py:1784: error: Item "None" of "Optional[FrameType]" has no attribute "f_locals"  [union-attr]

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ pymongo/__init__.py:176: error: Incompatible return value type (got "_TimeoutContext", expected "ContextManager[None]")  [return-value]
+ pymongo/__init__.py:176: note: Following member(s) of "_TimeoutContext" have conflicts:
+ pymongo/__init__.py:176: note:     Expected:
+ pymongo/__init__.py:176: note:         def __enter__(self) -> None
+ pymongo/__init__.py:176: note:     Got:
+ pymongo/__init__.py:176: note:         def __enter__(self) -> _TimeoutContext

spark (https://github.com/apache/spark)
+ python/pyspark/sql/worker/write_into_data_source.py:157: error: Unused "type: ignore" comment  [unused-ignore]
+ python/pyspark/sql/worker/write_into_data_source.py:164: error: Unused "type: ignore" comment  [unused-ignore]
+ python/pyspark/sql/worker/create_data_source.py:131: error: Unused "type: ignore" comment  [unused-ignore]
+ python/pyspark/sql/worker/create_data_source.py:156: error: Unused "type: ignore" comment  [unused-ignore]
+ python/pyspark/sql/worker/create_data_source.py:166: error: Unused "type: ignore" comment  [unused-ignore]
+ python/pyspark/sql/worker/create_data_source.py:168: error: Unused "type: ignore" comment  [unused-ignore]

werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/debug/__init__.py:368: error: Unused "type: ignore" comment  [unused-ignore]

discord.py (https://github.com/Rapptz/discord.py)
+ discord/utils.py:695: error: Unused "type: ignore" comment  [unused-ignore]
+ discord/utils.py:701: error: Incompatible default for argument "check" (default has type "Callable[[object], TypeIs[Awaitable[Any]]]", argument has type "Callable[[T | Awaitable[T]], TypeGuard[Awaitable[T]]]")  [assignment]

@JelleZijlstra

Copy link
Copy Markdown
Member

Mostly due to TypeIs changes (python/typeshed#11823).

@JelleZijlstra
JelleZijlstra merged commit cd895ce into master May 1, 2024
@JelleZijlstra
JelleZijlstra deleted the mypybot/sync-typeshed branch May 1, 2024 01:13
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