Skip to content

Commit 3e83e42

Browse files
srittauAvasam
andauthored
Update pyright to v1.1.395; disable a pow() check (#13564)
pyright and mypy disagree about the exact type due to differing overloads handling. --------- Co-authored-by: Avasam <samuel.06@hotmail.com>
1 parent 9f11db4 commit 3e83e42

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Type checkers that we test our stubs against. These should always
22
# be pinned to a specific version to make failure reproducible.
33
mypy==1.15.0
4-
pyright==1.1.389
4+
pyright==1.1.395
55
# pytype can be installed on Windows, but requires building wheels, let's not do that on the CI
66
pytype==2024.10.11; platform_system != "Windows" and python_version >= "3.10" and python_version < "3.13"
77

stdlib/@tests/test_cases/builtins/check_pow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
assert_type(complex(6) ** 6.2, complex)
4848
assert_type(pow(complex(9), 7.3, None), complex)
4949

50-
assert_type(pow(Fraction(), 4, None), Fraction)
50+
# pyright infers Fraction | float | complex, while mypy infers Fraction.
51+
# This is probably because of differences in @overload handling.
52+
assert_type(pow(Fraction(), 4, None), Fraction) # pyright: ignore[reportAssertTypeFailure]
5153
assert_type(Fraction() ** 4, Fraction)
5254

5355
assert_type(pow(Fraction(3, 7), complex(1, 8)), complex)

0 commit comments

Comments
 (0)