From 675ab38ab7e79b490fd5bdac4170ba1736a147dd Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Thu, 29 Feb 2024 13:14:39 +0300 Subject: [PATCH] Update `pyright` version to 1.1.350 (#11501) If you're reading about this commit in an auto-generated changelog: this is an internal change that should have no impact on how these stubs are understood by static-analysis tools such as type checkers or IDEs --- pyproject.toml | 2 +- scripts/runtests.py | 2 +- stdlib/asyncio/tasks.pyi | 2 +- stdlib/builtins.pyi | 2 +- .../test_cases/check_base_descriptors.py | 44 ++++---- .../test_cases/check_nested_descriptors.py | 100 ++++++++++-------- stubs/pyasn1/pyasn1/type/base.pyi | 2 +- tests/utils.py | 2 +- 8 files changed, 85 insertions(+), 71 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c3e1cdd1c..2810d4e39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,5 +100,5 @@ extra-standard-library = [ known-first-party = ["parse_metadata", "utils"] [tool.typeshed] -pyright_version = "1.1.342" +pyright_version = "1.1.350" oldest_supported_python = "3.8" diff --git a/scripts/runtests.py b/scripts/runtests.py index c373ba903..f8c1ce8f2 100755 --- a/scripts/runtests.py +++ b/scripts/runtests.py @@ -11,7 +11,7 @@ from pathlib import Path from typing import Any try: - from termcolor import colored # pyright: ignore[reportGeneralTypeIssues] + from termcolor import colored # pyright: ignore[reportAssignmentType] except ImportError: def colored(text: str, color: str | None = None, **kwargs: Any) -> str: # type: ignore[misc] diff --git a/stdlib/asyncio/tasks.pyi b/stdlib/asyncio/tasks.pyi index b62b7a5d0..028a7571b 100644 --- a/stdlib/asyncio/tasks.pyi +++ b/stdlib/asyncio/tasks.pyi @@ -384,7 +384,7 @@ else: # While this is true in general, here it's sort-of okay to have a covariant subclass, # since the only reason why `asyncio.Future` is invariant is the `set_result()` method, # and `asyncio.Task.set_result()` always raises. -class Task(Future[_T_co]): # type: ignore[type-var] # pyright: ignore[reportGeneralTypeIssues] +class Task(Future[_T_co]): # type: ignore[type-var] # pyright: ignore[reportInvalidTypeArguments] if sys.version_info >= (3, 12): def __init__( self, diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 9bb38b8cd..53bc78073 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1220,7 +1220,7 @@ class property: class _NotImplementedType(Any): # A little weird, but typing the __call__ as NotImplemented makes the error message # for NotImplemented() much better - __call__: NotImplemented # type: ignore[valid-type] # pyright: ignore[reportGeneralTypeIssues] + __call__: NotImplemented # type: ignore[valid-type] # pyright: ignore[reportInvalidTypeForm] NotImplemented: _NotImplementedType diff --git a/stubs/openpyxl/@tests/test_cases/check_base_descriptors.py b/stubs/openpyxl/@tests/test_cases/check_base_descriptors.py index e70bb149c..265e5386c 100644 --- a/stubs/openpyxl/@tests/test_cases/check_base_descriptors.py +++ b/stubs/openpyxl/@tests/test_cases/check_base_descriptors.py @@ -208,7 +208,7 @@ with_descriptors.descriptor = 0 # type: ignore with_descriptors.typed_not_none = "" -with_descriptors.typed_not_none = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.typed_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.typed_not_none = 0 # type: ignore with_descriptors.typed_none = "" @@ -220,23 +220,23 @@ with_descriptors.typed_none = 0 # type: ignore with_descriptors.set_tuple = "a" with_descriptors.set_tuple = 0 with_descriptors.set_tuple = 0.0 -with_descriptors.set_tuple = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.set_tuple = "none" # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.set_tuple = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.set_tuple = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.set_tuple = "none" # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.set_tuple = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.set_list = "a" with_descriptors.set_list = 0 with_descriptors.set_list = 0.0 -with_descriptors.set_list = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.set_list = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.set_list = "none" # can't check literals validity -with_descriptors.set_list = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.set_list = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.set_tuple_none = "a" with_descriptors.set_tuple_none = 0 with_descriptors.set_tuple_none = 0.0 with_descriptors.set_tuple_none = None -with_descriptors.set_tuple_none = "none" # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.set_tuple_none = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.set_tuple_none = "none" # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.set_tuple_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.noneset_tuple = "a" @@ -244,14 +244,14 @@ with_descriptors.noneset_tuple = 0 with_descriptors.noneset_tuple = 0.0 with_descriptors.noneset_tuple = None with_descriptors.noneset_tuple = "none" -with_descriptors.noneset_tuple = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.noneset_tuple = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.noneset_list = "a" with_descriptors.noneset_list = 0 with_descriptors.noneset_list = 0.0 with_descriptors.noneset_list = None with_descriptors.noneset_list = "none" -with_descriptors.noneset_list = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.noneset_list = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy # NOTE: Can't validate tuple length in a generic manner @@ -267,7 +267,7 @@ with_descriptors.length_list = "" # type: ignore with_descriptors.match_pattern_str = "" -with_descriptors.match_pattern_str = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.match_pattern_str = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.match_pattern_str = b"" # type: ignore with_descriptors.match_pattern_str = 0 # type: ignore @@ -277,7 +277,7 @@ with_descriptors.match_pattern_str_none = b"" # type: ignore with_descriptors.match_pattern_str_none = 0 # type: ignore with_descriptors.match_pattern_bytes = b"" -with_descriptors.match_pattern_bytes = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.match_pattern_bytes = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.match_pattern_bytes = "" # type: ignore with_descriptors.match_pattern_bytes = 0 # type: ignore @@ -289,8 +289,8 @@ with_descriptors.match_pattern_bytes_none = 0 # type: ignore with_descriptors.convertible_not_none = 0 with_descriptors.convertible_not_none = "0" -with_descriptors.convertible_not_none = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.convertible_not_none = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.convertible_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.convertible_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.convertible_none = 0 with_descriptors.convertible_none = "0" @@ -301,7 +301,7 @@ with_descriptors.convertible_none = object() # FIXME: False negative(?) in pyri with_descriptors.minmax_float = 0 with_descriptors.minmax_float = "0" with_descriptors.minmax_float = 0.0 -with_descriptors.minmax_float = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.minmax_float = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.minmax_float = object() # type: ignore with_descriptors.minmax_float_none = 0 @@ -313,7 +313,7 @@ with_descriptors.minmax_float_none = object() # type: ignore with_descriptors.minmax_int = 0 with_descriptors.minmax_int = "0" with_descriptors.minmax_int = 0.0 -with_descriptors.minmax_int = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.minmax_int = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.minmax_int = object() # type: ignore with_descriptors.minmax_int_none = 0 @@ -340,7 +340,7 @@ with_descriptors.bool_none = object() # type: ignore with_descriptors.datetime_not_none = datetime(0, 0, 0) with_descriptors.datetime_not_none = "" -with_descriptors.datetime_not_none = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.datetime_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.datetime_not_none = 0 # type: ignore with_descriptors.datetime_not_none = date(0, 0, 0) # type: ignore with_descriptors.datetime_not_none = time() # type: ignore @@ -354,7 +354,7 @@ with_descriptors.datetime_none = time() # type: ignore with_descriptors.string_not_none = "" -with_descriptors.string_not_none = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.string_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.string_not_none = 0 # type: ignore with_descriptors.string_none = "" @@ -366,8 +366,8 @@ with_descriptors.float_not_none = 0 with_descriptors.float_not_none = 0.0 with_descriptors.float_not_none = "0" with_descriptors.float_not_none = b"0" -with_descriptors.float_not_none = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.float_not_none = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.float_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.float_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.float_none = 0 with_descriptors.float_none = 0.0 @@ -381,8 +381,8 @@ with_descriptors.integer_not_none = 0 with_descriptors.integer_not_none = 0.0 with_descriptors.integer_not_none = "0" with_descriptors.integer_not_none = b"0" -with_descriptors.integer_not_none = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.integer_not_none = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.integer_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.integer_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.integer_none = 0 with_descriptors.integer_none = 0.0 diff --git a/stubs/openpyxl/@tests/test_cases/check_nested_descriptors.py b/stubs/openpyxl/@tests/test_cases/check_nested_descriptors.py index 89f88fda2..e0e193ffe 100644 --- a/stubs/openpyxl/@tests/test_cases/check_nested_descriptors.py +++ b/stubs/openpyxl/@tests/test_cases/check_nested_descriptors.py @@ -196,35 +196,39 @@ with_descriptors.descriptor = cast(_HasTagAndGet[int], _) # type: ignore with_descriptors.set_tuple = "a" with_descriptors.set_tuple = 0 with_descriptors.set_tuple = 0.0 -with_descriptors.set_tuple = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.set_tuple = "none" # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.set_tuple = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.set_tuple = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.set_tuple = "none" # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.set_tuple = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.set_tuple = cast(_HasTagAndGet[Literal["a"]], _) -with_descriptors.set_tuple = cast(_HasTagAndGet[str], _) # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.set_tuple = cast(_HasTagAndGet[None], _) # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.set_tuple = cast(_HasTagAndGet[object], _) # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.set_tuple = cast(_HasTagAndGet[str], _) # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.set_tuple = cast(_HasTagAndGet[None], _) # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.set_tuple = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy + _HasTagAndGet[object], _ +) with_descriptors.set_list = "a" with_descriptors.set_list = 0 with_descriptors.set_list = 0.0 -with_descriptors.set_list = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.set_list = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.set_list = "none" # can't check literals validity -with_descriptors.set_list = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.set_list = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.set_list = cast(_HasTagAndGet[Literal["a"]], _) with_descriptors.set_list = cast(_HasTagAndGet[str], _) # can't check literals validity -with_descriptors.set_list = cast(_HasTagAndGet[None], _) # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.set_list = cast(_HasTagAndGet[object], _) # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.set_list = cast(_HasTagAndGet[None], _) # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.set_list = cast(_HasTagAndGet[object], _) # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.set_tuple_none = "a" with_descriptors.set_tuple_none = 0 with_descriptors.set_tuple_none = 0.0 with_descriptors.set_tuple_none = None -with_descriptors.set_tuple_none = "none" # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.set_tuple_none = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.set_tuple_none = "none" # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.set_tuple_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.set_tuple_none = cast(_HasTagAndGet[Literal["a"]], _) -with_descriptors.set_tuple_none = cast(_HasTagAndGet[str], _) # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.set_tuple_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy + _HasTagAndGet[str], _ +) with_descriptors.set_tuple_none = cast(_HasTagAndGet[None], _) -with_descriptors.set_tuple_none = cast( # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.set_tuple_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy _HasTagAndGet[object], _ ) @@ -234,11 +238,13 @@ with_descriptors.noneset_tuple = 0 with_descriptors.noneset_tuple = 0.0 with_descriptors.noneset_tuple = None with_descriptors.noneset_tuple = "none" -with_descriptors.noneset_tuple = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.noneset_tuple = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.noneset_tuple = cast(_HasTagAndGet[Literal["a"]], _) -with_descriptors.noneset_tuple = cast(_HasTagAndGet[str], _) # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.noneset_tuple = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy + _HasTagAndGet[str], _ +) with_descriptors.noneset_tuple = cast(_HasTagAndGet[None], _) -with_descriptors.noneset_tuple = cast( # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.noneset_tuple = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy _HasTagAndGet[object], _ ) @@ -247,24 +253,24 @@ with_descriptors.noneset_list = 0 with_descriptors.noneset_list = 0.0 with_descriptors.noneset_list = None with_descriptors.noneset_list = "none" -with_descriptors.noneset_list = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.noneset_list = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.noneset_list = cast(_HasTagAndGet[Literal["a"]], _) with_descriptors.noneset_list = cast(_HasTagAndGet[str], _) with_descriptors.noneset_list = cast(_HasTagAndGet[None], _) -with_descriptors.noneset_list = cast( # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.noneset_list = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy _HasTagAndGet[object], _ ) with_descriptors.convertible_not_none = 0 with_descriptors.convertible_not_none = "0" -with_descriptors.convertible_not_none = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.convertible_not_none = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.convertible_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.convertible_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.convertible_not_none = cast(_HasTagAndGet[str], _) -with_descriptors.convertible_not_none = cast( # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.convertible_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy _HasTagAndGet[None], _ ) -with_descriptors.convertible_not_none = cast( # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.convertible_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy _HasTagAndGet[object], _ ) @@ -295,16 +301,16 @@ with_descriptors.text_str_none = cast(_HasTagAndGet[object], _) with_descriptors.text_int_not_none = 0 with_descriptors.text_int_not_none = "0" -with_descriptors.text_int_not_none = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.text_int_not_none = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.text_int_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.text_int_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy # If expected type (_T) is not str, it's impossible to use an Element as the value -with_descriptors.text_int_not_none = cast( # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.text_int_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy _HasTagAndGet[int], _ ) -with_descriptors.text_int_not_none = cast( # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.text_int_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy _HasTagAndGet[None], _ ) -with_descriptors.text_int_not_none = cast( # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.text_int_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy _HasTagAndGet[str], _ ) @@ -313,18 +319,26 @@ with_descriptors.text_int_none = "0" with_descriptors.text_int_none = None with_descriptors.text_int_none = object() # FIXME: False negative(?) in pyright and mypy # If expected type (_T) is not str, it's impossible to use an Element as the value -with_descriptors.text_int_none = cast(_HasTagAndGet[int], _) # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.text_int_none = cast(_HasTagAndGet[None], _) # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.text_int_none = cast(_HasTagAndGet[str], _) # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.text_int_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy + _HasTagAndGet[int], _ +) +with_descriptors.text_int_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy + _HasTagAndGet[None], _ +) +with_descriptors.text_int_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy + _HasTagAndGet[str], _ +) with_descriptors.minmax_float = 0 with_descriptors.minmax_float = "0" with_descriptors.minmax_float = 0.0 -with_descriptors.minmax_float = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.minmax_float = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.minmax_float = object() # type: ignore with_descriptors.minmax_float = cast(_HasTagAndGet[float], _) -with_descriptors.minmax_float = cast(_HasTagAndGet[None], _) # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.minmax_float = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy + _HasTagAndGet[None], _ +) with_descriptors.minmax_float = cast(_HasTagAndGet[object], _) # type: ignore with_descriptors.minmax_float_none = 0 @@ -339,10 +353,10 @@ with_descriptors.minmax_float_none = cast(_HasTagAndGet[object], _) # type: ign with_descriptors.minmax_int = 0 with_descriptors.minmax_int = "0" with_descriptors.minmax_int = 0.0 -with_descriptors.minmax_int = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.minmax_int = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.minmax_int = object() # type: ignore with_descriptors.minmax_int = cast(_HasTagAndGet[int], _) -with_descriptors.minmax_int = cast(_HasTagAndGet[None], _) # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.minmax_int = cast(_HasTagAndGet[None], _) # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.minmax_int = cast(_HasTagAndGet[object], _) # type: ignore with_descriptors.minmax_int_none = 0 @@ -420,13 +434,13 @@ with_descriptors.float_not_none = 0 with_descriptors.float_not_none = 0.0 with_descriptors.float_not_none = "0" with_descriptors.float_not_none = b"0" -with_descriptors.float_not_none = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.float_not_none = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.float_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.float_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.float_not_none = cast(_HasTagAndGet[float], _) -with_descriptors.float_not_none = cast( # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.float_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy _HasTagAndGet[None], _ ) -with_descriptors.float_not_none = cast( # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.float_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy _HasTagAndGet[object], _ ) @@ -445,13 +459,13 @@ with_descriptors.integer_not_none = 0 with_descriptors.integer_not_none = 0.0 with_descriptors.integer_not_none = "0" with_descriptors.integer_not_none = b"0" -with_descriptors.integer_not_none = None # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy -with_descriptors.integer_not_none = object() # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.integer_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.integer_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy with_descriptors.integer_not_none = cast(_HasTagAndGet[int], _) -with_descriptors.integer_not_none = cast( # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.integer_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy _HasTagAndGet[None], _ ) -with_descriptors.integer_not_none = cast( # pyright: ignore[reportGeneralTypeIssues] # false negative in mypy +with_descriptors.integer_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy _HasTagAndGet[object], _ ) diff --git a/stubs/pyasn1/pyasn1/type/base.pyi b/stubs/pyasn1/pyasn1/type/base.pyi index 4830d2b64..6889e8007 100644 --- a/stubs/pyasn1/pyasn1/type/base.pyi +++ b/stubs/pyasn1/pyasn1/type/base.pyi @@ -64,7 +64,7 @@ class NoValue: __imul__ = list.__imul__ __index__ = int.__index__ # self instead of cls - __init_subclass__ = plug # pyright: ignore[reportGeneralTypeIssues] + __init_subclass__ = plug # pyright: ignore[reportAssignmentType] __int__ = int.__int__ __invert__ = int.__invert__ __ior__ = plug diff --git a/tests/utils.py b/tests/utils.py index c1b24256f..a7c9c6a2e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -15,7 +15,7 @@ from typing_extensions import Annotated import pathspec try: - from termcolor import colored as colored # pyright: ignore[reportGeneralTypeIssues] + from termcolor import colored as colored # pyright: ignore[reportAssignmentType] except ImportError: def colored(text: str, color: str | None = None, **kwargs: Any) -> str: # type: ignore[misc]