Skip to content

Commit 22a73da

Browse files
authored
Update pyright to 1.1.413 (#16409)
Closes: #16408
1 parent 851b479 commit 22a73da

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
@@ -2,7 +2,7 @@
22
# be pinned to a specific version to make failure reproducible.
33
mypy==2.3.0
44
pyrefly==1.3.0.dev1
5-
pyright==1.1.411
5+
pyright==1.1.413
66
ty==0.0.59
77

88
# Libraries used by our various scripts.

‎stdlib/@tests/test_cases/check_types.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ def foo(self) -> None:
7878
if sys.version_info >= (3, 11):
7979
union_type = int | list[_T]
8080

81+
# pyright and mypy infer different types here
8182
# ideally this would be `_SpecialForm` (Union)
82-
assert_type(union_type | Literal[1], types.UnionType | Any)
83+
assert_type(union_type | Literal[1], types.UnionType | Any) # pyright: ignore[reportAssertTypeFailure]
84+
# assert_type(union_type | Literal[1], types.UnionType | type[Literal[1]]) # this is what pyright infers
8385
# Both mypy and pyright special-case this operation,
8486
# but in different ways, so we just check that no error is emitted:
8587
_ = union_type[int]

0 commit comments

Comments
 (0)