| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Source commit: python/typeshed@5ce34dc
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.
|
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
|
Sorry, something went wrong.
There was a problem hiding this comment.
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
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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. ⚠️