FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Sync typeshed by cdce8p · Pull Request #16863 · python/mypy · GitHub

Repository navigation

Sync typeshed - #16863

Merged
JelleZijlstra merged 5 commits into
python:masterfrom
cdce8p:mypybot/sync-typeshed
Feb 3, 2024
Merged

JelleZijlstra merged 5 commits into
python:masterfrom
cdce8p:mypybot/sync-typeshed

Conversation

cdce8p commented Feb 3, 2024

Copy link
Copy Markdown
Collaborator

Unfortunately, since the last typeshed update was squash merged, we're unable to update the commit hashes in misc/sync-typeshed.py to prevent further conflicts.

Source commit: python/typeshed@5ce34dc

⚠️ Remember to use "rebase and merge" rather than "squash and merge" for this PR, so that we can easily update the commit hashes to cherry-pick in the misc/sync-typeshed.py script. ⚠️

Comment thread mypy/typeshed/stdlib/builtins.pyi Outdated

This comment has been minimized.

hauntsaninja and others added 4 commits February 3, 2024 11:46
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.
cdce8p force-pushed the mypybot/sync-typeshed branch from 9cd74ef to 6e2dbe6 Compare February 3, 2024 10:47

github-actions Bot commented Feb 3, 2024

Copy link
Copy Markdown
Contributor

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

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

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python_api.py:397: error: Unused "type: ignore" comment  [unused-ignore]
+ src/_pytest/python_api.py:441: error: Unused "type: ignore" comment  [unused-ignore]
+ src/_pytest/python_api.py:442: error: Unused "type: ignore" comment  [unused-ignore]
+ src/_pytest/python_api.py:450: error: Unused "type: ignore" comment  [unused-ignore]
+ src/_pytest/python_api.py:454: error: Argument 1 to "abs" has incompatible type "SupportsComplex | complex"; expected "SupportsAbs[float]"  [arg-type]

ibis (https://github.com/ibis-project/ibis)
+ ibis/util.py:168: error: Argument 1 to "abs" has incompatible type "SupportsComplex | complex"; expected "SupportsAbs[float]"  [arg-type]
+ ibis/util.py:168: error: Unsupported operand types for < ("float" and "Real")  [operator]
- ibis/common/temporal.py:184: error: Incompatible return value type (got "int", expected "timedelta")  [return-value]
- ibis/common/temporal.py:184: error: Argument 1 to "int" has incompatible type "timedelta | Real"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc"  [arg-type]
+ ibis/common/temporal.py:184: error: No overload variant of "int" matches argument type "timedelta | Real"  [call-overload]
+ ibis/common/temporal.py:184: note: Possible overload variants:
+ ibis/common/temporal.py:184: note:     def __new__(cls, str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc = ..., /) -> int
+ ibis/common/temporal.py:184: note:     def __new__(cls, str | bytes | bytearray, /, base: SupportsIndex) -> int

AlexWaygood left a comment •
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, thanks! The primer diff is all from python/typeshed#11353 — see my analysis of the diff in python/typeshed#11353 (comment). TL;DR — it's impossible to type the numbers module properly, but this seems like it's probably a net improvement for users

cdce8p requested a review from JelleZijlstra February 3, 2024 15:20
JelleZijlstra merged commit 0dd4b6f into python:master Feb 3, 2024
cdce8p deleted the mypybot/sync-typeshed branch February 3, 2024 15:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL