Simplify and correct many numeric unions (#7906)

Unblocks PyCQA/flake8-pyi#222
This commit is contained in:
Alex Waygood
2022-05-21 15:25:00 +01:00
committed by GitHub
parent 7576805aee
commit 76a4bd796b
17 changed files with 30 additions and 26 deletions

View File

@@ -10,7 +10,7 @@ from google.protobuf.message import Message
_T = TypeVar("_T")
_K = TypeVar("_K", bound=bool | int | str)
_ScalarV = TypeVar("_ScalarV", bound=bool | int | float | str | bytes)
_ScalarV = TypeVar("_ScalarV", bound=bool | float | str | bytes)
_MessageV = TypeVar("_MessageV", bound=Message)
_M = TypeVar("_M")

View File

@@ -8,7 +8,7 @@ from google.protobuf.message import Message
_ContainerMessageT = TypeVar("_ContainerMessageT", bound=Message)
_ExtenderMessageT = TypeVar(
"_ExtenderMessageT",
bound=Message | RepeatedScalarFieldContainer[Any] | RepeatedCompositeFieldContainer[Any] | bool | int | float | str | bytes,
bound=Message | RepeatedScalarFieldContainer[Any] | RepeatedCompositeFieldContainer[Any] | bool | float | str | bytes,
)
class _ExtensionFieldDescriptor(FieldDescriptor, Generic[_ContainerMessageT, _ExtenderMessageT]): ...