Python 3.14: Remove SupportsTrunc from ConvertibleToInt (#13986)

This commit is contained in:
Avasam
2025-05-10 13:26:23 -04:00
committed by GitHub
parent ffc5acbe97
commit f17ee46952
+4 -1
View File
@@ -353,7 +353,10 @@ class DataclassInstance(Protocol):
__dataclass_fields__: ClassVar[dict[str, Field[Any]]]
# Anything that can be passed to the int/float constructors
ConvertibleToInt: TypeAlias = str | ReadableBuffer | SupportsInt | SupportsIndex | SupportsTrunc
if sys.version_info >= (3, 14):
ConvertibleToInt: TypeAlias = str | ReadableBuffer | SupportsInt | SupportsIndex
else:
ConvertibleToInt: TypeAlias = str | ReadableBuffer | SupportsInt | SupportsIndex | SupportsTrunc
ConvertibleToFloat: TypeAlias = str | ReadableBuffer | SupportsFloat | SupportsIndex
# A few classes updated from Foo(str, Enum) to Foo(StrEnum). This is a convenience so these