Skip to content

Commit

Permalink
Add the ability to apply python patch to a mutable struct
Browse files Browse the repository at this point in the history
Reviewed By: yoney

Differential Revision: D67049001

fbshipit-source-id: 51459e58ef530ba60bf3550e0223df77c4ea623e
  • Loading branch information
TJ Yin authored and facebook-github-bot committed Dec 16, 2024
1 parent 52e1922 commit b00e4f5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion thrift/lib/python/mutable_types.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import typing

from thrift.python.exceptions import Error
from thrift.python.types import Struct

# Base class for mutable structs and mutable unions
class MutableStructOrUnion:
Expand All @@ -28,7 +29,14 @@ class MutableStructOrUnion:
class MutableStructMeta(type): ...
class MutableUnionMeta(type): ...
class MutableGeneratedError(Error): ...
class MutableStruct(MutableStructOrUnion, metaclass=MutableStructMeta): ...

class MutableStruct(
MutableStructOrUnion,
typing.Iterable[typing.Tuple[str, typing.Any]],
metaclass=MutableStructMeta,
):
def _to_python(self) -> Struct: ...

class MutableUnion(MutableStructOrUnion, metaclass=MutableUnionMeta): ...

MutableStructOrError = typing.Union[MutableStruct, MutableGeneratedError]
Expand Down

0 comments on commit b00e4f5

Please sign in to comment.