diff --git a/thrift/compiler/generate/templates/py3/common/python_types_module_path.mustache b/thrift/compiler/generate/templates/py3/common/thrift_types_module_path.mustache similarity index 100% rename from thrift/compiler/generate/templates/py3/common/python_types_module_path.mustache rename to thrift/compiler/generate/templates/py3/common/thrift_types_module_path.mustache diff --git a/thrift/compiler/generate/templates/py3/types.pyi.mustache b/thrift/compiler/generate/templates/py3/types.pyi.mustache index f6871330fdb..d3adcd8d069 100644 --- a/thrift/compiler/generate/templates/py3/types.pyi.mustache +++ b/thrift/compiler/generate/templates/py3/types.pyi.mustache @@ -39,7 +39,7 @@ import {{#includeNamespace}}{{value}}.{{/includeNamespace}}types as _{{#includeN {{/hasTypes?}} {{/program:includeNamespaces}} {{#program:intercompatible?}} -import {{> common/python_types_module_path}} +import {{> common/thrift_types_module_path}} {{/program:intercompatible?}} @@ -48,12 +48,12 @@ __property__ = property {{#program:enums}} class {{enum:name}}(thrift.py3.types.{{^enum:flags?}}Enum{{/enum:flags?}}{{#enum:flags?}}Flag{{/enum:flags?}}{{! -}}{{#program:intercompatible?}}, {{> common/python_types_module_path}}._fbthrift_compatible_with_{{enum:name}}{{/program:intercompatible?}}): +}}{{#program:intercompatible?}}, {{> common/thrift_types_module_path}}._fbthrift_compatible_with_{{enum:name}}{{/program:intercompatible?}}): {{#enum:values}} {{enum_value:py_name}}: {{enum:name}} = ... {{/enum:values}} {{!TODO: accommodate root_module_prefix}} - def _to_python(self) -> "{{> common/python_types_module_path}}.{{enum:name}}": ... # type: ignore + def _to_python(self) -> "{{> common/thrift_types_module_path}}.{{enum:name}}": ... # type: ignore def _to_py3(self) -> {{enum:name}}: ... def _to_py_deprecated(self) -> int: ... @@ -65,7 +65,7 @@ _{{struct:name}}ValueType = _typing.Union[None, {{#struct:py3_fields}}{{^first?} {{/struct:union?}} class {{struct:name}}({{> types/python_struct_class}}, _typing.Hashable{{! -}}{{#program:intercompatible?}}, {{> common/python_types_module_path}}._fbthrift_compatible_with_{{struct:name}}{{/program:intercompatible?}}): +}}{{#program:intercompatible?}}, {{> common/thrift_types_module_path}}._fbthrift_compatible_with_{{struct:name}}{{/program:intercompatible?}}): class __fbthrift_IsSet: {{#struct:py3_fields}} {{#field:has_ref_accessor?}} @@ -122,10 +122,10 @@ class {{struct:name}}({{> types/python_struct_class}}, _typing.Hashable{{! {{#program:python_capi_converter?}} @staticmethod - def from_python(obj: "{{> common/python_types_module_path}}.{{struct:name}}") -> _typing.Self: ... # type: ignore + def from_python(obj: "{{> common/thrift_types_module_path}}.{{struct:name}}") -> _typing.Self: ... # type: ignore {{/program:python_capi_converter?}} {{!TODO: accommodate root_module_prefix}} - def _to_python(self) -> "{{> common/python_types_module_path}}.{{struct:name}}": ... # type: ignore + def _to_python(self) -> "{{> common/thrift_types_module_path}}.{{struct:name}}": ... # type: ignore def _to_py3(self) -> {{struct:name}}: ... def _to_py_deprecated(self) -> "{{program:py_deprecated_module_path}}.ttypes.{{struct:name}}": ... # type: ignore diff --git a/thrift/compiler/generate/templates/py3/types/compatible_pep484_type.mustache b/thrift/compiler/generate/templates/py3/types/compatible_pep484_type.mustache index 77c0cd15696..2dd115d153d 100644 --- a/thrift/compiler/generate/templates/py3/types/compatible_pep484_type.mustache +++ b/thrift/compiler/generate/templates/py3/types/compatible_pep484_type.mustache @@ -35,14 +35,14 @@ thrift-py3 specific container types. }}{{^type:iobufWrapper?}}bytes{{/type:iobufWrapper?}}{{! }}{{/type:binary?}}{{! }}{{#type:struct}}{{! - }}{{> common/python_types_module_path}}._fbthrift_compatible_with_{{struct:name}}{{! + }}{{> common/thrift_types_module_path}}._fbthrift_compatible_with_{{struct:name}}{{! }}{{/type:struct}}{{! }}{{#type:container?}}{{! }}{{> types/compatible_pep484_containers}}{{! }}{{/type:container?}}{{! }}{{#type:void?}}None{{/type:void?}}{{! }}{{#type:enum}}{{! - }}{{> common/python_types_module_path}}._fbthrift_compatible_with_{{enum:name}}{{! + }}{{> common/thrift_types_module_path}}._fbthrift_compatible_with_{{enum:name}}{{! }}{{/type:enum}}{{! }}{{/program:intercompatible?}}{{! }}{{^program:intercompatible?}}{{!