-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Sync Typeshed (for 1.9 release) #16844
Conversation
Source commit: python/typeshed@284afde
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: python#13987 (comment) A manual cherry-pick of e437cdf.
This comment has been minimized.
This comment has been minimized.
I think mypy primer looks alright... I know there was some changes internal to CodeType recently (as I saw it in 3.11) so I'm guessing thats why. |
It looks like we need to remove support for |
yeah, jinja CodeType is from dropping 3.7 python/typeshed#11238 |
I filed python/typeshed#11353, which fixes that |
[case testTypingOrderedDictAlias] | ||
# flags: --python-version 3.7 | ||
from typing import OrderedDict | ||
x: OrderedDict[str, int] = OrderedDict({}) | ||
reveal_type(x) |
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.
This will probably fail. The output line will need to be changed from 4
to 3
.
Can't do a suggestion for that line, unfortunately.
This comment has been minimized.
This comment has been minimized.
Diff from mypy_primer, showing the effect of this PR on open source code: anyio (https://github.com/agronholm/anyio)
+ src/anyio/_backends/_asyncio.py:1654: error: Unused "type: ignore" comment [unused-ignore]
jinja (https://github.com/pallets/jinja)
+ src/jinja2/debug.py:130: error: Argument 6 to "CodeType" has incompatible type "bytes"; expected "int" [arg-type]
+ src/jinja2/debug.py:131: error: Argument 7 to "CodeType" has incompatible type "Tuple[Any, ...]"; expected "bytes" [arg-type]
+ src/jinja2/debug.py:134: error: Argument 10 to "CodeType" has incompatible type "str"; expected "Tuple[str, ...]" [arg-type]
+ src/jinja2/debug.py:136: error: Argument 12 to "CodeType" has incompatible type "int"; expected "str" [arg-type]
+ src/jinja2/debug.py:137: error: Argument 13 to "CodeType" has incompatible type "bytes"; expected "int" [arg-type]
+ src/jinja2/debug.py:138: error: Argument 14 to "CodeType" has incompatible type "Tuple[str, ...]"; expected "bytes" [arg-type]
+ src/jinja2/ext.py:297: error: Incompatible redefinition (redefinition with type "Callable[[Arg(str, 'c'), Arg(str, 's')], str]", original type "Callable[[Arg(str, 'context'), Arg(str, 'message')], str]") [misc]
+ src/jinja2/ext.py:304: error: Incompatible redefinition (redefinition with type "Callable[[Arg(str, 'c'), Arg(str, 's'), Arg(str, 'p'), Arg(int, 'n')], str]", original type "Callable[[Arg(str, 'context'), Arg(str, 'msgid1'), Arg(str, 'msgid2'), Arg(int, 'n')], str]") [misc]
steam.py (https://github.com/Gobot1234/steam.py)
+ steam/ext/tf2/currency.py:100: note: Superclass:
+ steam/ext/tf2/currency.py:100: note: @overload
+ steam/ext/tf2/currency.py:100: note: def __sub__(a, int | Fraction, /) -> Fraction
+ steam/ext/tf2/currency.py:100: note: @overload
+ steam/ext/tf2/currency.py:100: note: def __sub__(a, float, /) -> float
+ steam/ext/tf2/currency.py:100: note: @overload
+ steam/ext/tf2/currency.py:100: note: def __sub__(a, complex, /) -> complex
+ steam/ext/tf2/currency.py:100: note: Subclass:
+ steam/ext/tf2/currency.py:100: note: def __sub__(self, int | str | float | Fraction | Decimal, /) -> Metal
prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/_internal/concurrency/calls.py:108: error: "Future" has no attribute "_condition" [attr-defined]
- src/prefect/server/orchestration/rules.py:102: error: Incompatible types in assignment (expression has type "ellipsis", variable has type "Session | AsyncSession | None") [assignment]
+ src/prefect/server/orchestration/rules.py:102: error: Incompatible types in assignment (expression has type "EllipsisType", variable has type "Session | AsyncSession | None") [assignment]
- src/prefect/server/orchestration/rules.py:103: error: Incompatible types in assignment (expression has type "ellipsis", variable has type "State[Any] | None") [assignment]
+ src/prefect/server/orchestration/rules.py:103: error: Incompatible types in assignment (expression has type "EllipsisType", variable has type "State[Any] | None") [assignment]
- src/prefect/server/orchestration/rules.py:104: error: Incompatible types in assignment (expression has type "ellipsis", variable has type "State[Any] | None") [assignment]
+ src/prefect/server/orchestration/rules.py:104: error: Incompatible types in assignment (expression has type "EllipsisType", variable has type "State[Any] | None") [assignment]
spack (https://github.com/spack/spack)
+ lib/spack/spack/install_test.py:520: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/install_test.py:522: error: Unused "type: ignore" comment [unused-ignore]
trio (https://github.com/python-trio/trio)
+ src/trio/_socket.py:378: error: Unused "type: ignore" comment [unused-ignore]
|
(This has now been merged into typeshed's |
No description provided.