Skip to content

Conversation

@cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented Jan 1, 2025

Source commit:
python/typeshed@b66d6cf

cdce8p and others added 6 commits January 1, 2025 15:09
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

This comment has been minimized.

@cdce8p
Copy link
Collaborator Author

cdce8p commented Jan 1, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Jan 1, 2025

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

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/profiling/collector/threading.py:43: error: Unused "type: ignore" comment  [unused-ignore]

trio (https://github.com/python-trio/trio)
+ src/trio/_core/_traps.py:307: error: "Coroutine[Any, Outcome[object], Any]" has no attribute "cr_running"  [attr-defined]
+ src/trio/_core/_ki.py:179: error: "Coroutine[Any, Outcome[object], Any]" has no attribute "cr_frame"  [attr-defined]
+ src/trio/_core/_run.py:1882: error: "Coroutine[object, Never, object]" has no attribute "cr_frame"  [attr-defined]
+ src/trio/_core/_tests/test_asyncgen.py:91: error: "AsyncGenerator[int, None]" has no attribute "ag_frame"  [attr-defined]
+ src/trio/_core/_tests/test_asyncgen.py:304: error: "AsyncGenerator[object, Never]" has no attribute "ag_frame"  [attr-defined]
+ src/trio/_core/_tests/test_asyncgen.py:307: error: "AsyncGenerator[object, Never]" has no attribute "ag_frame"  [attr-defined]

discord.py (https://github.com/Rapptz/discord.py)
- discord/webhook/sync.py:153: error: Incompatible types in assignment (expression has type "DeferredLock", variable has type "Lock")  [assignment]
+ discord/webhook/sync.py:153: error: Incompatible types in assignment (expression has type "DeferredLock", variable has type "LockType")  [assignment]
- discord/webhook/sync.py:197: error: "Lock" has no attribute "delay_by"  [attr-defined]
+ discord/webhook/sync.py:197: error: "LockType" has no attribute "delay_by"  [attr-defined]

pyinstrument (https://github.com/joerick/pyinstrument)
- pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManager[_T_co], Callable[..., Iterator[_T_co]], tuple[Any, ...], dict[str, Any]], None]")  [assignment]
+ pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManagerBase[_G], Callable[..., _G], tuple[Any, ...], dict[str, Any]], None]")  [assignment]
- pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManager[_T_co], Callable[..., Iterator[_T_co]], tuple[Any, ...], dict[str, Any]], None]")  [assignment]
+ pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManagerBase[_G], Callable[..., _G], tuple[Any, ...], dict[str, Any]], None]")  [assignment]

werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/debug/tbtools.py:261: error: Incompatible types in assignment (expression has type "Optional[TracebackException]", variable has type "TracebackException")  [assignment]

@hauntsaninja hauntsaninja merged commit e05770d into python:master Jan 1, 2025
18 checks passed
@cdce8p cdce8p deleted the sync-typeshed branch January 1, 2025 22:05
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