mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 22:11:54 +08:00
Support arbitrary values for extension values (#5774)
Proto itself supports primitives, not just messages. See https://github.com/dropbox/mypy-protobuf/issues/244 for an example motivating this change. Test Plan: I was able to use MYPYPATH to test an updated version of mypy-protobuf with this change.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
from typing import Any, Generic, Iterator, TypeVar
|
||||
from typing import Any, Generic, Iterator, Text, TypeVar, Union
|
||||
|
||||
from google.protobuf.descriptor import FieldDescriptor
|
||||
from google.protobuf.message import Message
|
||||
|
||||
_ContainerMessageT = TypeVar("_ContainerMessageT", bound=Message)
|
||||
_ExtenderMessageT = TypeVar("_ExtenderMessageT", bound=Message)
|
||||
_ExtenderMessageT = TypeVar("_ExtenderMessageT", bound=Union[Message, bool, int, float, Text, bytes])
|
||||
|
||||
class _ExtensionFieldDescriptor(FieldDescriptor, Generic[_ContainerMessageT, _ExtenderMessageT]): ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user