Skip to content

Commit

Permalink
Set return type for setters
Browse files Browse the repository at this point in the history
Summary: Set the return type for mutable thrift-python setters

Reviewed By: createdbysk

Differential Revision: D66937278

fbshipit-source-id: dc129a0009362d51bd964dede0a39f66b130d073
  • Loading branch information
yoney authored and facebook-github-bot committed Dec 8, 2024
1 parent f4212c4 commit 52d53c1
Show file tree
Hide file tree
Showing 33 changed files with 738 additions and 738 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class {{> structs/unadapted_name}}({{!
@property
def {{field:py_name}}(self) -> {{> fields/field_type_pyi}}: ...
@{{field:py_name}}.setter
def {{field:py_name}}(self, value: {{> fields/field_type_pyi}}{{#field:is_container_type}}{{> types/thrift_container_wrapper}}{{/field:is_container_type}}): ...
def {{field:py_name}}(self, value: {{> fields/field_type_pyi}}{{#field:is_container_type}}{{> types/thrift_container_wrapper}}{{/field:is_container_type}}) -> None: ...

{{/struct:fields_ordered_by_id}}{{!
}}{{/program:generate_mutable_types}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,55 +46,55 @@ class MyStruct(_fbthrift_python_mutable_types.MutableStruct, _fbthrift_compatibl
@property
def MyIntField(self) -> int: ...
@MyIntField.setter
def MyIntField(self, value: int): ...
def MyIntField(self, value: int) -> None: ...


@property
def MyStringField(self) -> str: ...
@MyStringField.setter
def MyStringField(self, value: str): ...
def MyStringField(self, value: str) -> None: ...


@property
def MyDataField(self) -> _fbthrift_current_module.MyDataItem: ...
@MyDataField.setter
def MyDataField(self, value: _fbthrift_current_module.MyDataItem): ...
def MyDataField(self, value: _fbthrift_current_module.MyDataItem) -> None: ...


@property
def myEnum(self) -> _fbthrift_current_module.MyEnum: ...
@myEnum.setter
def myEnum(self, value: _fbthrift_current_module.MyEnum): ...
def myEnum(self, value: _fbthrift_current_module.MyEnum) -> None: ...


@property
def oneway(self) -> bool: ...
@oneway.setter
def oneway(self, value: bool): ...
def oneway(self, value: bool) -> None: ...


@property
def readonly(self) -> bool: ...
@readonly.setter
def readonly(self, value: bool): ...
def readonly(self, value: bool) -> None: ...


@property
def idempotent(self) -> bool: ...
@idempotent.setter
def idempotent(self, value: bool): ...
def idempotent(self, value: bool) -> None: ...


@property
def floatSet(self) -> _fbthrift_python_mutable_containers.MutableSet[float]: ...
@floatSet.setter
def floatSet(self, value: _fbthrift_python_mutable_containers.MutableSet[float] | _fbthrift_python_mutable_types._ThriftSetWrapper): ...
def floatSet(self, value: _fbthrift_python_mutable_containers.MutableSet[float] | _fbthrift_python_mutable_types._ThriftSetWrapper) -> None: ...


@property
def no_hack_codegen_field(self) -> str: ...
@no_hack_codegen_field.setter
def no_hack_codegen_field(self, value: str): ...
def no_hack_codegen_field(self, value: str) -> None: ...

def __init__(
self, *,
Expand Down Expand Up @@ -137,19 +137,19 @@ class Containers(_fbthrift_python_mutable_types.MutableStruct, _fbthrift_compati
@property
def I32List(self) -> _fbthrift_python_mutable_containers.MutableList[int]: ...
@I32List.setter
def I32List(self, value: _fbthrift_python_mutable_containers.MutableList[int] | _fbthrift_python_mutable_types._ThriftListWrapper): ...
def I32List(self, value: _fbthrift_python_mutable_containers.MutableList[int] | _fbthrift_python_mutable_types._ThriftListWrapper) -> None: ...


@property
def StringSet(self) -> _fbthrift_python_mutable_containers.MutableSet[str]: ...
@StringSet.setter
def StringSet(self, value: _fbthrift_python_mutable_containers.MutableSet[str] | _fbthrift_python_mutable_types._ThriftSetWrapper): ...
def StringSet(self, value: _fbthrift_python_mutable_containers.MutableSet[str] | _fbthrift_python_mutable_types._ThriftSetWrapper) -> None: ...


@property
def StringToI64Map(self) -> _fbthrift_python_mutable_containers.MutableMap[str, int]: ...
@StringToI64Map.setter
def StringToI64Map(self, value: _fbthrift_python_mutable_containers.MutableMap[str, int] | _fbthrift_python_mutable_types._ThriftMapWrapper): ...
def StringToI64Map(self, value: _fbthrift_python_mutable_containers.MutableMap[str, int] | _fbthrift_python_mutable_types._ThriftMapWrapper) -> None: ...

def __init__(
self, *,
Expand Down Expand Up @@ -199,25 +199,25 @@ class MyUnion(_fbthrift_python_mutable_types.MutableUnion, _fbthrift_compatible_
@property
def myEnum(self) -> _fbthrift_current_module.MyEnum: ...
@myEnum.setter
def myEnum(self, value: _fbthrift_current_module.MyEnum): ...
def myEnum(self, value: _fbthrift_current_module.MyEnum) -> None: ...


@property
def myStruct(self) -> _fbthrift_current_module.MyStruct: ...
@myStruct.setter
def myStruct(self, value: _fbthrift_current_module.MyStruct): ...
def myStruct(self, value: _fbthrift_current_module.MyStruct) -> None: ...


@property
def myDataItem(self) -> _fbthrift_current_module.MyDataItem: ...
@myDataItem.setter
def myDataItem(self, value: _fbthrift_current_module.MyDataItem): ...
def myDataItem(self, value: _fbthrift_current_module.MyDataItem) -> None: ...


@property
def floatSet(self) -> _fbthrift_python_mutable_containers.MutableSet[float]: ...
@floatSet.setter
def floatSet(self, value: _fbthrift_python_mutable_containers.MutableSet[float] | _fbthrift_python_mutable_types._ThriftSetWrapper): ...
def floatSet(self, value: _fbthrift_python_mutable_containers.MutableSet[float] | _fbthrift_python_mutable_types._ThriftSetWrapper) -> None: ...

def __init__(
self, *,
Expand Down Expand Up @@ -254,25 +254,25 @@ class MyException(_fbthrift_python_mutable_exceptions.MutableGeneratedError, _fb
@property
def MyIntField(self) -> int: ...
@MyIntField.setter
def MyIntField(self, value: int): ...
def MyIntField(self, value: int) -> None: ...


@property
def MyStringField(self) -> str: ...
@MyStringField.setter
def MyStringField(self, value: str): ...
def MyStringField(self, value: str) -> None: ...


@property
def myStruct(self) -> _fbthrift_current_module.MyStruct: ...
@myStruct.setter
def myStruct(self, value: _fbthrift_current_module.MyStruct): ...
def myStruct(self, value: _fbthrift_current_module.MyStruct) -> None: ...


@property
def myUnion(self) -> _fbthrift_current_module.MyUnion: ...
@myUnion.setter
def myUnion(self, value: _fbthrift_current_module.MyUnion): ...
def myUnion(self, value: _fbthrift_current_module.MyUnion) -> None: ...

def __init__(
self, *,
Expand All @@ -298,25 +298,25 @@ class MyExceptionWithMessage(_fbthrift_python_mutable_exceptions.MutableGenerate
@property
def MyIntField(self) -> int: ...
@MyIntField.setter
def MyIntField(self, value: int): ...
def MyIntField(self, value: int) -> None: ...


@property
def MyStringField(self) -> str: ...
@MyStringField.setter
def MyStringField(self, value: str): ...
def MyStringField(self, value: str) -> None: ...


@property
def myStruct(self) -> _fbthrift_current_module.MyStruct: ...
@myStruct.setter
def myStruct(self, value: _fbthrift_current_module.MyStruct): ...
def myStruct(self, value: _fbthrift_current_module.MyStruct) -> None: ...


@property
def myUnion(self) -> _fbthrift_current_module.MyUnion: ...
@myUnion.setter
def myUnion(self, value: _fbthrift_current_module.MyUnion): ...
def myUnion(self, value: _fbthrift_current_module.MyUnion) -> None: ...

def __init__(
self, *,
Expand All @@ -342,7 +342,7 @@ class ReservedKeyword(_fbthrift_python_mutable_types.MutableStruct, _fbthrift_co
@property
def reserved_field(self) -> int: ...
@reserved_field.setter
def reserved_field(self, value: int): ...
def reserved_field(self, value: int) -> None: ...

def __init__(
self, *,
Expand All @@ -369,7 +369,7 @@ class UnionToBeRenamed(_fbthrift_python_mutable_types.MutableUnion, _fbthrift_co
@property
def reserved_field(self) -> int: ...
@reserved_field.setter
def reserved_field(self, value: int): ...
def reserved_field(self, value: int) -> None: ...

def __init__(
self, *,
Expand Down
Loading

0 comments on commit 52d53c1

Please sign in to comment.