Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit35c839d

Browse files
hauntsaninjamypybot
authored and
mypybot
committed
Revert sum literal integer change (#13961)
This is allegedly causing large performance problems, see 13821typeshed/8231 had zero hits on mypy_primer, so it's not the worst thingto undo. Patching this in typeshed also feels weird, since there's amore general soundness issue. If a typevar has a bound or constraint, wemight not want to solve it to a Literal.If we can confirm the performance regression or fix the unsoundnesswithin mypy, I might pursue upstreaming this in typeshed.(Reminder: add this to the sync_typeshed script once merged)
1 parent42715b4 commit35c839d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎mypy/typeshed/stdlib/builtins.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1826,7 +1826,7 @@ _SupportsSumNoDefaultT = TypeVar("_SupportsSumNoDefaultT", bound=_SupportsSumWit
18261826
# without creating many false-positive errors (see #7578).
18271827
# Instead, we special-case the most common examples of this: bool and literal integers.
18281828
@overload
1829-
defsum(iterable:Iterable[bool|_LiteralInteger],/,start:int=0)->int: ...
1829+
defsum(iterable:Iterable[bool],/,start:int=0)->int: ...
18301830
@overload
18311831
defsum(iterable:Iterable[_SupportsSumNoDefaultT],/)->_SupportsSumNoDefaultT|Literal[0]: ...
18321832
@overload

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp