Skip to content

Commit

Permalink
Support arbitrary values for extension values
Browse files Browse the repository at this point in the history
Proto itself supports primitives, not just messages.
See nipunn1313/mypy-protobuf#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.
  • Loading branch information
nipunn1313 committed Jul 14, 2021
1 parent 0cd4ee3 commit c67c4f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stubs/protobuf/google/protobuf/internal/extension_dict.pyi
Original file line number Diff line number Diff line change
@@ -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]): ...

Expand Down

0 comments on commit c67c4f9

Please sign in to comment.