From 6cac682c53bbf0c1c263386d23862d5abb51775f Mon Sep 17 00:00:00 2001 From: Andrew Hilger Date: Tue, 14 Jan 2025 10:31:59 -0800 Subject: [PATCH] generate make_instance impl in auto-migrate Summary: When both `auto-migrate` and `gen_legacy_container_converters` are enabled, the converters directly implement `__make_instance` rather than just wrapping a call to `types.{{type:flat_name}}__make_instance`. Reviewed By: createdbysk Differential Revision: D67999497 fbshipit-source-id: 28844dc3dcb8cdf50caf110efc8bc187c1e1b984 --- .../generate/t_mstch_py3_generator.cc | 2 +- .../templates/py3/converter.pxd.mustache | 10 + .../templates/py3/converter.pyx.mustache | 20 +- .../types/cython_python_to_cpp_item.mustache | 7 +- .../types/cython_python_to_cpp_key.mustache | 7 +- .../out/py3/gen-py3/module/converter.pyx | 1 - .../fixtures/enumstrict/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../test/fixtures/basic/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../test/fixtures/enums/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../gen-py3/includes/converter.pxd | 2 + .../gen-py3/includes/converter.pyx | 3 - .../gen-py3/module/converter.pxd | 2 + .../gen-py3/module/converter.pyx | 3 - .../gen-py3/transitive/converter.pxd | 2 + .../gen-py3/transitive/converter.pyx | 3 - .../gen-py3/includes/converter.pxd | 2 + .../gen-py3/includes/converter.pyx | 3 - .../gen-py3/transitive/converter.pxd | 2 + .../gen-py3/transitive/converter.pyx | 3 - .../gen-py3/includes/converter.pxd | 2 + .../gen-py3/includes/converter.pyx | 3 - .../gen-py3/module/converter.pxd | 2 + .../gen-py3/module/converter.pyx | 3 - .../gen-py3/service/converter.pxd | 2 + .../gen-py3/service/converter.pyx | 3 - .../gen-py3/transitive/converter.pxd | 2 + .../gen-py3/transitive/converter.pyx | 3 - .../gen-py3/transitive/converter.pxd | 2 + .../gen-py3/transitive/converter.pyx | 3 - .../gen-py3/includes/converter.pyx | 1 - .../matching_struct_names/converter.pyx | 1 - .../gen-py3/module/converter.pyx | 1 - .../gen-py3/transitive/converter.pyx | 1 - .../gen-py3/includes/converter.pyx | 1 - .../py3_service/gen-py3/module/converter.pyx | 1 - .../py3_service/gen-py3/service/converter.pyx | 1 - .../gen-py3/transitive/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/foo/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../another_interactions/shared/converter.pyx | 1 - .../interactions/module/converter.pyx | 1 - .../list/out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/includes/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../test/module/module/converter.pyx | 1 - .../py3_emptyns/gen-py3/emptyns/converter.pyx | 1 - .../extend/test/extend/converter.pyx | 1 - .../namespacing/test/hsmodule/converter.pyx | 1 - .../module/converter.pyx | 1 - .../module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../src/thrift/compiler/test/fixtures/py3/cmd | 1 + .../py3/out/py3/gen-py3/module/converter.pyx | 1 - .../gen-py3/module/converter.pxd | 2 + .../gen-py3/module/converter.pyx | 3 - .../gen-py3/cpp/metadata.cpp | 6 + .../gen-py3/cpp/metadata.h | 6 + .../gen-py3/cpp/types.h | 6 + .../gen-py3/module/builders.py | 193 +++ .../gen-py3/module/cbindings.pxd | 488 ++++++ .../gen-py3/module/clients.pxd | 6 + .../gen-py3/module/clients.py | 7 + .../gen-py3/module/clients.pyi | 291 ++++ .../gen-py3/module/clients.pyx | 6 + .../gen-py3/module/clients_wrapper.cpp | 6 + .../gen-py3/module/clients_wrapper.h | 6 + .../gen-py3/module/clients_wrapper.pxd | 6 + .../containers_FBTHRIFT_ONLY_DO_NOT_USE.py | 1475 +++++++++++++++++ .../gen-py3/module/converter.pxd | 93 ++ .../gen-py3/module/converter.pyx | 452 +++++ .../gen-py3/module/metadata.cpp | 6 + .../gen-py3/module/metadata.h | 6 + .../gen-py3/module/metadata.pxd | 6 + .../gen-py3/module/metadata.py | 7 + .../gen-py3/module/metadata.pyi | 6 + .../gen-py3/module/metadata.pyx | 6 + .../gen-py3/module/services.pxd | 6 + .../gen-py3/module/services.py | 7 + .../gen-py3/module/services.pyi | 342 ++++ .../gen-py3/module/services.pyx | 6 + .../gen-py3/module/services_interface.pxd | 6 + .../gen-py3/module/services_wrapper.cpp | 6 + .../gen-py3/module/services_wrapper.h | 6 + .../gen-py3/module/services_wrapper.pxd | 6 + .../gen-py3/module/types.h | 6 + .../gen-py3/module/types.pxd | 6 + .../gen-py3/module/types.py | 640 +++++++ .../gen-py3/module/types.pyi | 964 +++++++++++ .../gen-py3/module/types.pyx | 6 + .../gen-py3/module/types_empty.pyx | 9 + .../gen-py3/module/types_fields.pxd | 6 + .../gen-py3/module/types_fields.pyx | 6 + .../types_impl_FBTHRIFT_ONLY_DO_NOT_USE.py | 152 ++ .../gen-py3/module/types_reflection.py | 730 ++++++++ .../gen-py3/python/metadata.cpp | 6 + .../gen-py3/python/metadata.h | 6 + .../gen-py3/python/types.h | 6 + .../gen-py3/scope/metadata.cpp | 6 + .../gen-py3/scope/metadata.h | 6 + .../gen-py3/scope/types.h | 6 + .../gen-py3/thrift/metadata.cpp | 6 + .../gen-py3/thrift/metadata.h | 6 + .../gen-py3/thrift/types.h | 6 + .../out/py3_empty/gen-py3/empty/converter.pyx | 1 - .../gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/module0/converter.pyx | 1 - .../out/py3/gen-py3/module1/converter.pyx | 1 - .../out/py3/gen-py3/module2/converter.pyx | 1 - .../refs/out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../gen-py3/module_structs/converter.pyx | 1 - .../sink/out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3/gen-py3/module/converter.pyx | 1 - .../out/py3_a/gen-py3/a/converter.pyx | 1 - .../out/py3_a/gen-py3/b/converter.pyx | 1 - .../out/py3_a/gen-py3/c/converter.pyx | 1 - .../out/py3_s/gen-py3/b/converter.pyx | 1 - .../out/py3_s/gen-py3/c/converter.pyx | 1 - .../out/py3_s/gen-py3/s/converter.pyx | 1 - .../fixtures/types/included/converter.pyx | 1 - .../fixtures/types/module/converter.pyx | 1 - 133 files changed, 6107 insertions(+), 100 deletions(-) create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/cpp/metadata.cpp create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/cpp/metadata.h create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/cpp/types.h create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/builders.py create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/cbindings.pxd create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.pxd create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.py create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.pyi create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.pyx create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients_wrapper.cpp create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients_wrapper.h create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients_wrapper.pxd create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/containers_FBTHRIFT_ONLY_DO_NOT_USE.py create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/converter.pxd create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/converter.pyx create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.cpp create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.h create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.pxd create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.py create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.pyi create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.pyx create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.pxd create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.py create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.pyi create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.pyx create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_interface.pxd create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_wrapper.cpp create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_wrapper.h create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_wrapper.pxd create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.h create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.pxd create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.py create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.pyi create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.pyx create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_empty.pyx create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_fields.pxd create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_fields.pyx create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_impl_FBTHRIFT_ONLY_DO_NOT_USE.py create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_reflection.py create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/python/metadata.cpp create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/python/metadata.h create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/python/types.h create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/scope/metadata.cpp create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/scope/metadata.h create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/scope/types.h create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/thrift/metadata.cpp create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/thrift/metadata.h create mode 100644 third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/thrift/types.h diff --git a/third-party/thrift/src/thrift/compiler/generate/t_mstch_py3_generator.cc b/third-party/thrift/src/thrift/compiler/generate/t_mstch_py3_generator.cc index b2be5022500c73..4f977bc1a82ad4 100644 --- a/third-party/thrift/src/thrift/compiler/generate/t_mstch_py3_generator.cc +++ b/third-party/thrift/src/thrift/compiler/generate/t_mstch_py3_generator.cc @@ -1572,7 +1572,7 @@ void t_mstch_py3_generator::generate_types() { generate_file("__init__.py", FileType::TypesFile, generateRootPath_); } for (const auto& file : converterFiles) { - generate_file(file, FileType::TypesFile, generateRootPath_); + generate_file(file, FileType::NotTypesFile, generateRootPath_); } // - if auto_migrate is present, generate types.pxd, and types.py // - else, just generate normal cython files diff --git a/third-party/thrift/src/thrift/compiler/generate/templates/py3/converter.pxd.mustache b/third-party/thrift/src/thrift/compiler/generate/templates/py3/converter.pxd.mustache index fdab7f54bcb6fb..f2fc25dc242726 100644 --- a/third-party/thrift/src/thrift/compiler/generate/templates/py3/converter.pxd.mustache +++ b/third-party/thrift/src/thrift/compiler/generate/templates/py3/converter.pxd.mustache @@ -24,6 +24,7 @@ cimport {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program: {{#program:includeNamespaces}} {{#hasTypes?}} cimport {{#includeNamespace}}{{value}}.{{/includeNamespace}}cbindings as _{{#includeNamespace}}{{value}}_{{/includeNamespace}}cbindings +cimport {{#includeNamespace}}{{value}}.{{/includeNamespace}}converter as _{{#includeNamespace}}{{value}}_{{/includeNamespace}}converter {{/hasTypes?}} {{/program:includeNamespaces}} {{/program:gen_legacy_container_converters?}} @@ -44,3 +45,12 @@ cdef object {{struct:name}}_from_cpp(const shared_ptr[_fbthrift_cbindings.{{> ty cdef {{> types/cython_cpp_type}} {{type:flat_name}}__make_instance(object items) except * {{/program:containerTypes}} {{/program:gen_legacy_container_converters?}} +{{! + Include Constructor and Extractor specializations. + In auto-migrate have to put this in .pxd instead of .pyx + for container converters transitive includes + }} +{{#program:auto_migrate?}} +cdef extern from "{{program:includePrefix}}gen-python-capi/{{program:name}}/thrift_types_capi.h": + pass +{{/program:auto_migrate?}} diff --git a/third-party/thrift/src/thrift/compiler/generate/templates/py3/converter.pyx.mustache b/third-party/thrift/src/thrift/compiler/generate/templates/py3/converter.pyx.mustache index 8a63d87a9b46d0..937daf9494428c 100644 --- a/third-party/thrift/src/thrift/compiler/generate/templates/py3/converter.pyx.mustache +++ b/third-party/thrift/src/thrift/compiler/generate/templates/py3/converter.pyx.mustache @@ -22,16 +22,22 @@ from libcpp.memory cimport make_shared from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp from cython.operator cimport dereference as deref +{{#program:gen_legacy_container_converters?}} +from libcpp.utility cimport move as cmove + +import {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.types as {{> types/current_module_types}} +{{#program:includeNamespaces}} +{{#hasTypes?}} +import {{#includeNamespace}}{{value}}.{{/includeNamespace}}types as _{{#includeNamespace}}{{value}}_{{/includeNamespace}}types +{{/hasTypes?}} +{{/program:includeNamespaces}} + +{{/program:gen_legacy_container_converters?}} {{/program:auto_migrate?}} {{^program:auto_migrate?}} cimport {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.types as _fbthrift_ctypes {{/program:auto_migrate?}} -{{#program:auto_migrate?}}{{! include Constructor and Extractor specializations }} -cdef extern from "{{program:includePrefix}}gen-python-capi/{{program:name}}/thrift_types_capi.h": - pass -{{/program:auto_migrate?}} - {{#program:filtered_structs}} {{! direct replacement for ._cpp_obj }} cdef shared_ptr[_fbthrift_cbindings.{{> types/c_struct }}] {{struct:name}}_convert_to_cpp(object inst) except*: @@ -60,8 +66,8 @@ cdef {{> types/cython_cpp_type}} {{type:flat_name}}__make_instance(object items) return _fbthrift_ctypes.{{type:flat_name}}__make_instance(items) {{/program:auto_migrate?}} {{#program:auto_migrate?}} - cdef {{> types/cython_cpp_type}} ret - return ret + {{> types/make_instance}} + {{/program:auto_migrate?}} {{/program:containerTypes}} diff --git a/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_item.mustache b/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_item.mustache index 89d25335901d45..9b3f5b7479ff59 100644 --- a/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_item.mustache +++ b/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_item.mustache @@ -45,8 +45,13 @@ key, include the parallel CythonPythonToCppKey file instead. }}{{#type:string?}}item.encode('UTF-8'){{/type:string?}}{{! }}{{#type:binary?}}item{{/type:binary?}}{{! }}{{#type:struct}}{{! + }}{{^program:auto_migrate?}}{{! }}deref((<{{> types/cython_python_type}}>item).{{> types/cpp_obj}}){{! + }}{{/program:auto_migrate?}}{{! + }}{{#program:auto_migrate?}}{{! + }}python_to_cpp[{{> types/cython_cpp_basic_type}}](item){{! + }}{{/program:auto_migrate?}}{{! }}{{/type:struct}}{{! -}}{{#type:container?}}{{> types/container_to_cpp }}(item){{/type:container?}}{{! +}}{{#type:container?}}{{type:flat_name}}__make_instance(item){{/type:container?}}{{! }}{{#type:enum?}}<{{> types/cython_cpp_type}}>item{{/type:enum?}}{{! }}{{/type:customBinaryType?}} diff --git a/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_key.mustache b/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_key.mustache index 67224f9cf75dbb..a30fc76d6ff4ee 100644 --- a/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_key.mustache +++ b/third-party/thrift/src/thrift/compiler/generate/templates/py3/types/cython_python_to_cpp_key.mustache @@ -35,9 +35,14 @@ keys (conventionally used for sets, lists, and map values). }}{{#type:string?}}key.encode('UTF-8'){{/type:string?}}{{! }}{{#type:binary?}}key{{/type:binary?}}{{! }}{{#type:struct}}{{! + }}{{^program:auto_migrate?}}{{! }}deref((<{{> types/cython_python_type}}>key).{{> types/cpp_obj}}){{! + }}{{/program:auto_migrate?}}{{! + }}{{#program:auto_migrate?}}{{! + }}python_to_cpp[{{> types/cython_cpp_basic_type}}](key){{! + }}{{/program:auto_migrate?}}{{! }}{{/type:struct}}{{! }}{{#type:container?}}{{! - }}{{> types/container_to_cpp}}(key){{! + }}{{type:flat_name}}__make_instance(key){{! }}{{/type:container?}}{{! }}{{#type:enum?}}<{{> types/cython_cpp_type}}>key{{/type:enum?}} diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/converter.pyx index e196f2f618f434..46564cf7a9c757 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cMyStructNestedAnnotation] MyStructNestedAnnotation_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.MyStructNestedAnnotation?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/basic-enum/out/py3/gen-py3/test/fixtures/enumstrict/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/basic-enum/out/py3/gen-py3/test/fixtures/enumstrict/module/converter.pyx index d7893586dde23a..3472c940c95106 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/basic-enum/out/py3/gen-py3/test/fixtures/enumstrict/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/basic-enum/out/py3/gen-py3/test/fixtures/enumstrict/module/converter.pyx @@ -8,7 +8,6 @@ cimport test.fixtures.enumstrict.module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.MyStruct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/converter.pyx index e56e2537a82e20..d6e57f733add5f 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/basic-stack-arguments/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.MyStruct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/converter.pyx index 26ce31444a02ed..2e917239bd998c 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/basic/out/py3/gen-py3/test/fixtures/basic/module/converter.pyx @@ -8,7 +8,6 @@ cimport test.fixtures.basic.module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.MyStruct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/complex-union/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/complex-union/out/py3/gen-py3/module/converter.pyx index 4ff4c167df83b2..845b729d4db281 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/complex-union/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/complex-union/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cComplexUnion] ComplexUnion_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.ComplexUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/constants/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/constants/out/py3/gen-py3/module/converter.pyx index b2e53bdecb289e..8155d9a29f1238 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/constants/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/constants/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cInternship] Internship_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Internship?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/empty-struct/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/empty-struct/out/py3/gen-py3/module/converter.pyx index a07cd843fafb26..cf5ce09248175e 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/empty-struct/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/empty-struct/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cEmpty] Empty_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Empty?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/enums/out/py3/gen-py3/test/fixtures/enums/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/enums/out/py3/gen-py3/test/fixtures/enums/module/converter.pyx index 629e095ecdd097..6247dcddd60b5a 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/enums/out/py3/gen-py3/test/fixtures/enums/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/enums/out/py3/gen-py3/test/fixtures/enums/module/converter.pyx @@ -8,7 +8,6 @@ cimport test.fixtures.enums.module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cSomeStruct] SomeStruct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.SomeStruct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/converter.pyx index e6987a4451ab24..eed1c02ea465ad 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/exceptions/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFiery] Fiery_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Fiery?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/includes/converter.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/includes/converter.pxd index 21a5ad078b7de6..ede3130431c889 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/includes/converter.pxd +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/includes/converter.pxd @@ -13,3 +13,5 @@ cimport includes.cbindings as _fbthrift_cbindings cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object inst) except* cdef object Included_from_cpp(const shared_ptr[_fbthrift_cbindings.cIncluded]& c_struct) +cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/includes/thrift_types_capi.h": + pass diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/includes/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/includes/converter.pyx index 5c0e29dd70ddd3..89e21052cac9f1 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/includes/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/includes/converter.pyx @@ -10,9 +10,6 @@ from libcpp.memory cimport make_shared from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp from cython.operator cimport dereference as deref -cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/includes/thrift_types_capi.h": - pass - cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object inst) except*: return make_shared[_fbthrift_cbindings.cIncluded](python_to_cpp[_fbthrift_cbindings.cIncluded](inst)) cdef object Included_from_cpp(const shared_ptr[_fbthrift_cbindings.cIncluded]& c_struct): diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/module/converter.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/module/converter.pxd index ff667ab8b90c91..f05a1631e7fd4c 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/module/converter.pxd +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/module/converter.pxd @@ -13,3 +13,5 @@ cimport module.cbindings as _fbthrift_cbindings cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object inst) except* cdef object MyStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cMyStruct]& c_struct) +cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/module/thrift_types_capi.h": + pass diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/module/converter.pyx index 70a488f89001db..5e23ce1bca8935 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/module/converter.pyx @@ -10,9 +10,6 @@ from libcpp.memory cimport make_shared from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp from cython.operator cimport dereference as deref -cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/module/thrift_types_capi.h": - pass - cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object inst) except*: return make_shared[_fbthrift_cbindings.cMyStruct](python_to_cpp[_fbthrift_cbindings.cMyStruct](inst)) cdef object MyStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cMyStruct]& c_struct): diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/transitive/converter.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/transitive/converter.pxd index e756bf0b7e955c..53a677a3b2cfcc 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/transitive/converter.pxd +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/transitive/converter.pxd @@ -13,3 +13,5 @@ cimport transitive.cbindings as _fbthrift_cbindings cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except* cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct) +cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/transitive/thrift_types_capi.h": + pass diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/transitive/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/transitive/converter.pyx index e76e674708db0c..12a5ed6a163871 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/transitive/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate/gen-py3/transitive/converter.pyx @@ -10,9 +10,6 @@ from libcpp.memory cimport make_shared from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp from cython.operator cimport dereference as deref -cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/transitive/thrift_types_capi.h": - pass - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return make_shared[_fbthrift_cbindings.cFoo](python_to_cpp[_fbthrift_cbindings.cFoo](inst)) cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct): diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/includes/converter.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/includes/converter.pxd index 839b5610a583c5..f5fad0575534da 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/includes/converter.pxd +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/includes/converter.pxd @@ -13,3 +13,5 @@ cimport includes.cbindings as _fbthrift_cbindings cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object inst) except* cdef object Included_from_cpp(const shared_ptr[_fbthrift_cbindings.cIncluded]& c_struct) +cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/includes/thrift_types_capi.h": + pass diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/includes/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/includes/converter.pyx index 6ecd6b45504f0d..acd32d8c364c1f 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/includes/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/includes/converter.pyx @@ -10,9 +10,6 @@ from libcpp.memory cimport make_shared from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp from cython.operator cimport dereference as deref -cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/includes/thrift_types_capi.h": - pass - cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object inst) except*: return make_shared[_fbthrift_cbindings.cIncluded](python_to_cpp[_fbthrift_cbindings.cIncluded](inst)) cdef object Included_from_cpp(const shared_ptr[_fbthrift_cbindings.cIncluded]& c_struct): diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/transitive/converter.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/transitive/converter.pxd index e756bf0b7e955c..53a677a3b2cfcc 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/transitive/converter.pxd +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/transitive/converter.pxd @@ -13,3 +13,5 @@ cimport transitive.cbindings as _fbthrift_cbindings cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except* cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct) +cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/transitive/thrift_types_capi.h": + pass diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/transitive/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/transitive/converter.pyx index e76e674708db0c..12a5ed6a163871 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/transitive/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_includes/gen-py3/transitive/converter.pyx @@ -10,9 +10,6 @@ from libcpp.memory cimport make_shared from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp from cython.operator cimport dereference as deref -cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/transitive/thrift_types_capi.h": - pass - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return make_shared[_fbthrift_cbindings.cFoo](python_to_cpp[_fbthrift_cbindings.cFoo](inst)) cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct): diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/includes/converter.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/includes/converter.pxd index 21a5ad078b7de6..ede3130431c889 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/includes/converter.pxd +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/includes/converter.pxd @@ -13,3 +13,5 @@ cimport includes.cbindings as _fbthrift_cbindings cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object inst) except* cdef object Included_from_cpp(const shared_ptr[_fbthrift_cbindings.cIncluded]& c_struct) +cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/includes/thrift_types_capi.h": + pass diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/includes/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/includes/converter.pyx index 5c0e29dd70ddd3..89e21052cac9f1 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/includes/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/includes/converter.pyx @@ -10,9 +10,6 @@ from libcpp.memory cimport make_shared from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp from cython.operator cimport dereference as deref -cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/includes/thrift_types_capi.h": - pass - cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object inst) except*: return make_shared[_fbthrift_cbindings.cIncluded](python_to_cpp[_fbthrift_cbindings.cIncluded](inst)) cdef object Included_from_cpp(const shared_ptr[_fbthrift_cbindings.cIncluded]& c_struct): diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/module/converter.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/module/converter.pxd index bd8f17f3007b78..06e067433ab58e 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/module/converter.pxd +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/module/converter.pxd @@ -13,3 +13,5 @@ cimport module.cbindings as _fbthrift_cbindings cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object inst) except* cdef object MyStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cMyStruct]& c_struct) +cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/module/thrift_types_capi.h": + pass diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/module/converter.pyx index da1a8d788ced2e..e9da1b14d5af2e 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/module/converter.pyx @@ -10,9 +10,6 @@ from libcpp.memory cimport make_shared from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp from cython.operator cimport dereference as deref -cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/module/thrift_types_capi.h": - pass - cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object inst) except*: return make_shared[_fbthrift_cbindings.cMyStruct](python_to_cpp[_fbthrift_cbindings.cMyStruct](inst)) cdef object MyStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cMyStruct]& c_struct): diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/converter.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/converter.pxd index d0d6631a86b834..7fe9f25140eb6b 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/converter.pxd +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/converter.pxd @@ -10,3 +10,5 @@ from libcpp.memory cimport shared_ptr cimport service.cbindings as _fbthrift_cbindings +cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/service/thrift_types_capi.h": + pass diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/converter.pyx index a951c653c44470..db7a3032d7245a 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/service/converter.pyx @@ -10,7 +10,4 @@ from libcpp.memory cimport make_shared from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp from cython.operator cimport dereference as deref -cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/service/thrift_types_capi.h": - pass - diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/transitive/converter.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/transitive/converter.pxd index e756bf0b7e955c..53a677a3b2cfcc 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/transitive/converter.pxd +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/transitive/converter.pxd @@ -13,3 +13,5 @@ cimport transitive.cbindings as _fbthrift_cbindings cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except* cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct) +cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/transitive/thrift_types_capi.h": + pass diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/transitive/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/transitive/converter.pyx index e76e674708db0c..12a5ed6a163871 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/transitive/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_service/gen-py3/transitive/converter.pyx @@ -10,9 +10,6 @@ from libcpp.memory cimport make_shared from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp from cython.operator cimport dereference as deref -cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/transitive/thrift_types_capi.h": - pass - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return make_shared[_fbthrift_cbindings.cFoo](python_to_cpp[_fbthrift_cbindings.cFoo](inst)) cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct): diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_transitive/gen-py3/transitive/converter.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_transitive/gen-py3/transitive/converter.pxd index 143d5b3a2a5fe0..781f17104dcd2e 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_transitive/gen-py3/transitive/converter.pxd +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_transitive/gen-py3/transitive/converter.pxd @@ -13,3 +13,5 @@ cimport transitive.cbindings as _fbthrift_cbindings cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except* cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct) +cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/transitive/thrift_types_capi.h": + pass diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_transitive/gen-py3/transitive/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_transitive/gen-py3/transitive/converter.pyx index 765170979993bf..c0033b58242fe4 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_transitive/gen-py3/transitive/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_auto_migrate_transitive/gen-py3/transitive/converter.pyx @@ -10,9 +10,6 @@ from libcpp.memory cimport make_shared from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp from cython.operator cimport dereference as deref -cdef extern from "thrift/compiler/test/fixtures/includes/gen-python-capi/transitive/thrift_types_capi.h": - pass - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return make_shared[_fbthrift_cbindings.cFoo](python_to_cpp[_fbthrift_cbindings.cFoo](inst)) cdef object Foo_from_cpp(const shared_ptr[_fbthrift_cbindings.cFoo]& c_struct): diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/includes/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/includes/converter.pyx index 6f2a9a4ea5dd19..313ff7f592327f 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/includes/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/includes/converter.pyx @@ -8,7 +8,6 @@ cimport includes.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Included?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/matching_struct_names/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/matching_struct_names/converter.pyx index d377c1de488019..c30927ea307b81 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/matching_struct_names/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/matching_struct_names/converter.pyx @@ -8,7 +8,6 @@ cimport matching_struct_names.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.MyStruct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/module/converter.pyx index f98d5230ae9105..2782b174d7b09b 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.MyStruct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/transitive/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/transitive/converter.pyx index dd1aa620fb2f1d..d8a1f4d5c36061 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/transitive/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_matching_struct_names/gen-py3/transitive/converter.pyx @@ -8,7 +8,6 @@ cimport transitive.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Foo?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/includes/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/includes/converter.pyx index 6f2a9a4ea5dd19..313ff7f592327f 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/includes/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/includes/converter.pyx @@ -8,7 +8,6 @@ cimport includes.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cIncluded] Included_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Included?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/module/converter.pyx index f98d5230ae9105..2782b174d7b09b 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cMyStruct] MyStruct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.MyStruct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/converter.pyx index 474dd3138a17bb..e254379abcd4e3 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/service/converter.pyx @@ -9,4 +9,3 @@ cimport service.types as _fbthrift_ctypes - diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/transitive/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/transitive/converter.pyx index dd1aa620fb2f1d..d8a1f4d5c36061 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/transitive/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/includes/out/py3_service/gen-py3/transitive/converter.pyx @@ -8,7 +8,6 @@ cimport transitive.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Foo?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/converter.pyx index 31f80b49eacd96..1e893b9c708841 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/inheritance/out/py3/gen-py3/module/converter.pyx @@ -9,4 +9,3 @@ cimport module.types as _fbthrift_ctypes - diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/inject_metadata_fields/out/py3/gen-py3/foo/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/inject_metadata_fields/out/py3/gen-py3/foo/converter.pyx index b8f5ed34d59741..0612f36218bf5a 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/inject_metadata_fields/out/py3/gen-py3/foo/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/inject_metadata_fields/out/py3/gen-py3/foo/converter.pyx @@ -8,7 +8,6 @@ cimport foo.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFields] Fields_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Fields?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/inject_metadata_fields/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/inject_metadata_fields/out/py3/gen-py3/module/converter.pyx index cd959d310bd2b3..13035454c15ce1 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/inject_metadata_fields/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/inject_metadata_fields/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFields] Fields_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Fields?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/int_limits/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/int_limits/out/py3/gen-py3/module/converter.pyx index 7c55ba59f83505..50b8fce8e4c8ed 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/int_limits/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/int_limits/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cLimits] Limits_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Limits?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/converter.pyx index c615f904243e01..1bbd54eac2b033 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/another_interactions/shared/converter.pyx @@ -8,7 +8,6 @@ cimport test.fixtures.another_interactions.shared.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cDoSomethingResult] DoSomethingResult_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.DoSomethingResult?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/converter.pyx index 36dd599c100748..3d28bdc7412c25 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/interactions/out/py3/gen-py3/test/fixtures/interactions/module/converter.pyx @@ -8,7 +8,6 @@ cimport test.fixtures.interactions.module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cCustomException] CustomException_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.CustomException?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/list/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/list/out/py3/gen-py3/module/converter.pyx index 28bdbe193ef443..460fed100fa925 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/list/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/list/out/py3/gen-py3/module/converter.pyx @@ -9,4 +9,3 @@ cimport module.types as _fbthrift_ctypes - diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/includes/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/includes/converter.pyx index f55970c32b32d5..9b19c570a80dd3 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/includes/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/includes/converter.pyx @@ -8,7 +8,6 @@ cimport includes.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cAStruct] AStruct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.AStruct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/converter.pyx index b8f10686966662..7faf3dc55de83d 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/mcpp2-compare/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cEmpty] Empty_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Empty?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/mixin/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/mixin/out/py3/gen-py3/module/converter.pyx index d0b040fbcc3d3a..835e676dd917e1 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/mixin/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/mixin/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cMixin1] Mixin1_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Mixin1?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/converter.pyx index 1fd52570836515..a371b922579a7b 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3/gen-py3/my/namespacing/test/module/module/converter.pyx @@ -8,7 +8,6 @@ cimport my.namespacing.test.module.module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Foo?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/converter.pyx index c3e4071c210e78..a7130c836d03b3 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3_emptyns/gen-py3/emptyns/converter.pyx @@ -8,7 +8,6 @@ cimport emptyns.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Foo?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/converter.pyx index 86b2fca350fd74..a041c47124268c 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/extend/test/extend/converter.pyx @@ -9,4 +9,3 @@ cimport my.namespacing.extend.test.extend.types as _fbthrift_ctypes - diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/converter.pyx index 9d23acc205ad04..013107c0780081 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/namespace/out/py3_extend/gen-py3/my/namespacing/test/hsmodule/converter.pyx @@ -8,7 +8,6 @@ cimport my.namespacing.test.hsmodule.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cHsFoo] HsFoo_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.HsFoo?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/converter.pyx index 790d0d92cc0822..4b22da679a15b4 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package/out/py3/gen-py3/test/namespace_from_package/module/converter.pyx @@ -8,7 +8,6 @@ cimport test.namespace_from_package.module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Foo?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/converter.pyx index 529c9e7699f5af..4fc105d275d2f1 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/namespace_from_package_without_module_name/out/py3/gen-py3/test/namespace_from_package_without_module_name/module/converter.pyx @@ -8,7 +8,6 @@ cimport test.namespace_from_package_without_module_name.module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Foo?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/optionals/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/optionals/out/py3/gen-py3/module/converter.pyx index a5504e898d94bd..b14c3273c14057 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/optionals/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/optionals/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cColor] Color_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Color?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/converter.pyx index 419654537be259..8609db2408d8d7 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/params/out/py3/gen-py3/module/converter.pyx @@ -9,4 +9,3 @@ cimport module.types as _fbthrift_ctypes - diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/cmd b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/cmd index 445e3a8240cfe4..809ce0d1e5c3aa 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/cmd +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/cmd @@ -8,3 +8,4 @@ python_capi_empty: mstch_python_capi src/empty.thrift python: mstch_python:auto_migrate,base_library_package=fbcode.thrift.python,import_static src/module.thrift py3_auto_migrate: mstch_py3:auto_migrate src/module.thrift py3_legacy_container_converters: mstch_py3:gen_legacy_container_converters src/module.thrift +py3_auto_migrate_legacy_container_converters: mstch_py3:auto_migrate,gen_legacy_container_converters src/module.thrift diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/converter.pyx index 1636f94eabfa37..6444f8ce649f8f 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cSimpleException] SimpleException_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.SimpleException?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/converter.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/converter.pxd index bbbcad655d6f78..dd2cad12c6dfce 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/converter.pxd +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/converter.pxd @@ -40,3 +40,5 @@ cdef object CustomTypedefFields_from_cpp(const shared_ptr[_fbthrift_cbindings.cC cdef shared_ptr[_fbthrift_cbindings.cAdaptedTypedefFields] AdaptedTypedefFields_convert_to_cpp(object inst) except* cdef object AdaptedTypedefFields_from_cpp(const shared_ptr[_fbthrift_cbindings.cAdaptedTypedefFields]& c_struct) +cdef extern from "thrift/compiler/test/fixtures/py3/gen-python-capi/module/thrift_types_capi.h": + pass diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/converter.pyx index 2fe9c0a5ae1d38..b80afc0d579862 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate/gen-py3/module/converter.pyx @@ -10,9 +10,6 @@ from libcpp.memory cimport make_shared from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp from cython.operator cimport dereference as deref -cdef extern from "thrift/compiler/test/fixtures/py3/gen-python-capi/module/thrift_types_capi.h": - pass - cdef shared_ptr[_fbthrift_cbindings.cSimpleException] SimpleException_convert_to_cpp(object inst) except*: return make_shared[_fbthrift_cbindings.cSimpleException](python_to_cpp[_fbthrift_cbindings.cSimpleException](inst)) cdef object SimpleException_from_cpp(const shared_ptr[_fbthrift_cbindings.cSimpleException]& c_struct): diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/cpp/metadata.cpp b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/cpp/metadata.cpp new file mode 100644 index 00000000000000..57b762a1a4f19e --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/cpp/metadata.cpp @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/annotation/cpp.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/cpp/metadata.h b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/cpp/metadata.h new file mode 100644 index 00000000000000..57b762a1a4f19e --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/cpp/metadata.h @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/annotation/cpp.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/cpp/types.h b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/cpp/types.h new file mode 100644 index 00000000000000..57b762a1a4f19e --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/cpp/types.h @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/annotation/cpp.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/builders.py b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/builders.py new file mode 100644 index 00000000000000..faad4eb543b8f2 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/builders.py @@ -0,0 +1,193 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# +import typing as _typing + +import folly.iobuf as _fbthrift_iobuf +import thrift.py3.builder + + +import module.thrift_types as _module_types + + +_fbthrift_struct_type__SimpleException = _module_types.SimpleException +class SimpleException_Builder(thrift.py3.builder.StructBuilder): + _struct_type = _fbthrift_struct_type__SimpleException + + def __init__(self): + self.err_code: _typing.Optional[int] = None + + def __iter__(self): + yield "err_code", self.err_code + +_fbthrift_struct_type__OptionalRefStruct = _module_types.OptionalRefStruct +class OptionalRefStruct_Builder(thrift.py3.builder.StructBuilder): + _struct_type = _fbthrift_struct_type__OptionalRefStruct + + def __init__(self): + self.optional_blob: _typing.Optional[_fbthrift_iobuf.IOBuf] = None + + def __iter__(self): + yield "optional_blob", self.optional_blob + +_fbthrift_struct_type__SimpleStruct = _module_types.SimpleStruct +class SimpleStruct_Builder(thrift.py3.builder.StructBuilder): + _struct_type = _fbthrift_struct_type__SimpleStruct + + def __init__(self): + self.is_on: _typing.Optional[bool] = None + self.tiny_int: _typing.Optional[int] = None + self.small_int: _typing.Optional[int] = None + self.nice_sized_int: _typing.Optional[int] = None + self.big_int: _typing.Optional[int] = None + self.real: _typing.Optional[float] = None + self.smaller_real: _typing.Optional[float] = None + self.something: _typing.Optional[dict] = None + + def __iter__(self): + yield "is_on", self.is_on + yield "tiny_int", self.tiny_int + yield "small_int", self.small_int + yield "nice_sized_int", self.nice_sized_int + yield "big_int", self.big_int + yield "real", self.real + yield "smaller_real", self.smaller_real + yield "something", self.something + +_fbthrift_struct_type__HiddenTypeFieldsStruct = _module_types.HiddenTypeFieldsStruct +class HiddenTypeFieldsStruct_Builder(thrift.py3.builder.StructBuilder): + _struct_type = _fbthrift_struct_type__HiddenTypeFieldsStruct + + def __init__(self): + pass + + def __iter__(self): + pass + +_fbthrift_struct_type__ComplexStruct = _module_types.ComplexStruct +class ComplexStruct_Builder(thrift.py3.builder.StructBuilder): + _struct_type = _fbthrift_struct_type__ComplexStruct + + def __init__(self): + self.structOne: _typing.Any = None + self.structTwo: _typing.Any = None + self.an_integer: _typing.Optional[int] = None + self.name: _typing.Optional[str] = None + self.an_enum: _typing.Optional[_module_types.AnEnum] = None + self.some_bytes: _typing.Optional[bytes] = None + self.sender: _typing.Optional[str] = None + self.cdef_: _typing.Optional[str] = None + self.bytes_with_cpp_type: _typing.Optional[bytes] = None + + def __iter__(self): + yield "structOne", self.structOne + yield "structTwo", self.structTwo + yield "an_integer", self.an_integer + yield "name", self.name + yield "an_enum", self.an_enum + yield "some_bytes", self.some_bytes + yield "sender", self.sender + yield "cdef_", self.cdef_ + yield "bytes_with_cpp_type", self.bytes_with_cpp_type + +_fbthrift_struct_type__BinaryUnion = _module_types.BinaryUnion +class BinaryUnion_Builder(thrift.py3.builder.StructBuilder): + _struct_type = _fbthrift_struct_type__BinaryUnion + + def __init__(self): + self.iobuf_val: _typing.Optional[_fbthrift_iobuf.IOBuf] = None + + def __iter__(self): + yield "iobuf_val", self.iobuf_val + +_fbthrift_struct_type__BinaryUnionStruct = _module_types.BinaryUnionStruct +class BinaryUnionStruct_Builder(thrift.py3.builder.StructBuilder): + _struct_type = _fbthrift_struct_type__BinaryUnionStruct + + def __init__(self): + self.u: _typing.Any = None + + def __iter__(self): + yield "u", self.u + +_fbthrift_struct_type__CustomFields = _module_types.CustomFields +class CustomFields_Builder(thrift.py3.builder.StructBuilder): + _struct_type = _fbthrift_struct_type__CustomFields + + def __init__(self): + self.bool_field: _typing.Optional[bool] = None + self.integer_field: _typing.Optional[int] = None + self.double_field: _typing.Optional[float] = None + self.string_field: _typing.Optional[str] = None + self.binary_field: _typing.Optional[bytes] = None + self.list_field: _typing.Optional[list] = None + self.set_field: _typing.Optional[set] = None + self.map_field: _typing.Optional[dict] = None + self.struct_field: _typing.Any = None + + def __iter__(self): + yield "bool_field", self.bool_field + yield "integer_field", self.integer_field + yield "double_field", self.double_field + yield "string_field", self.string_field + yield "binary_field", self.binary_field + yield "list_field", self.list_field + yield "set_field", self.set_field + yield "map_field", self.map_field + yield "struct_field", self.struct_field + +_fbthrift_struct_type__CustomTypedefFields = _module_types.CustomTypedefFields +class CustomTypedefFields_Builder(thrift.py3.builder.StructBuilder): + _struct_type = _fbthrift_struct_type__CustomTypedefFields + + def __init__(self): + self.bool_field: _typing.Optional[bool] = None + self.integer_field: _typing.Optional[int] = None + self.double_field: _typing.Optional[float] = None + self.string_field: _typing.Optional[str] = None + self.binary_field: _typing.Optional[bytes] = None + self.list_field: _typing.Optional[list] = None + self.set_field: _typing.Optional[set] = None + self.map_field: _typing.Optional[dict] = None + self.struct_field: _typing.Any = None + + def __iter__(self): + yield "bool_field", self.bool_field + yield "integer_field", self.integer_field + yield "double_field", self.double_field + yield "string_field", self.string_field + yield "binary_field", self.binary_field + yield "list_field", self.list_field + yield "set_field", self.set_field + yield "map_field", self.map_field + yield "struct_field", self.struct_field + +_fbthrift_struct_type__AdaptedTypedefFields = _module_types.AdaptedTypedefFields +class AdaptedTypedefFields_Builder(thrift.py3.builder.StructBuilder): + _struct_type = _fbthrift_struct_type__AdaptedTypedefFields + + def __init__(self): + self.bool_field: _typing.Optional[bool] = None + self.integer_field: _typing.Optional[int] = None + self.double_field: _typing.Optional[float] = None + self.string_field: _typing.Optional[str] = None + self.binary_field: _typing.Optional[bytes] = None + self.list_field: _typing.Optional[list] = None + self.set_field: _typing.Optional[set] = None + self.map_field: _typing.Optional[dict] = None + self.struct_field: _typing.Any = None + + def __iter__(self): + yield "bool_field", self.bool_field + yield "integer_field", self.integer_field + yield "double_field", self.double_field + yield "string_field", self.string_field + yield "binary_field", self.binary_field + yield "list_field", self.list_field + yield "set_field", self.set_field + yield "map_field", self.map_field + yield "struct_field", self.struct_field + diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/cbindings.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/cbindings.pxd new file mode 100644 index 00000000000000..247e1dd1cfe735 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/cbindings.pxd @@ -0,0 +1,488 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# +from libc.stdint cimport ( + int8_t as cint8_t, + int16_t as cint16_t, + int32_t as cint32_t, + int64_t as cint64_t, + uint16_t as cuint16_t, + uint32_t as cuint32_t, +) +from libcpp.string cimport string +from libcpp cimport bool as cbool, nullptr, nullptr_t +from cpython cimport bool as pbool +from libcpp.memory cimport shared_ptr, unique_ptr +from libcpp.vector cimport vector +from libcpp.set cimport set as cset +from libcpp.map cimport map as cmap, pair as cpair +from libcpp.unordered_map cimport unordered_map as cumap +cimport folly.iobuf as _fbthrift_iobuf +from thrift.python.exceptions cimport cTException +from thrift.py3.types cimport ( + bstring, + field_ref as __field_ref, + optional_field_ref as __optional_field_ref, + required_field_ref as __required_field_ref, + terse_field_ref as __terse_field_ref, + union_field_ref as __union_field_ref, + get_union_field_value as __get_union_field_value, +) +from thrift.python.common cimport cThriftMetadata as __fbthrift_cThriftMetadata + + +cdef extern from * nogil: + cdef cppclass _std_unordered_map "::std::unordered_map"[T, U]: + ctypedef T key_type + ctypedef U mapped_type + ctypedef size_t size_type + + cppclass iterator: + cpair[T, U]& operator*() + iterator operator++() + bint operator==(iterator) + bint operator!=(iterator) + cppclass reverse_iterator: + cpair[T, U]& operator*() + iterator operator++() + bint operator==(reverse_iterator) + bint operator!=(reverse_iterator) + cppclass const_iterator(iterator): + pass + cppclass const_reverse_iterator(reverse_iterator): + pass + + _std_unordered_map() except + + _std_unordered_map(_std_unordered_map&) except + + + U& operator[](T&) + iterator find(const T&) + const_iterator const_find "find"(const T&) + size_type count(const T&) + size_type size() + iterator begin() + const_iterator const_begin "begin"() + iterator end() + const_iterator const_end "end"() + reverse_iterator rbegin() + const_reverse_iterator const_rbegin "rbegin"() + reverse_iterator rend() + const_reverse_iterator const_rend "rend"() + void clear() + bint empty() + +cdef extern from *: + ctypedef bstring foo_Bar "foo::Bar" +cdef extern from *: + ctypedef cbool _MyType "::MyType" +cdef extern from *: + ctypedef cint64_t _MyType "::MyType" +cdef extern from *: + ctypedef double _MyType "::MyType" +cdef extern from *: + ctypedef string _MyType "::MyType" +cdef extern from *: + ctypedef bstring _MyType "::MyType" +cdef extern from * nogil: + cdef cppclass _MyType "::MyType": + ctypedef cint32_t value_type + ctypedef size_t size_type + + cppclass iterator: + cint32_t& operator*() + iterator operator++() + bint operator==(iterator) + bint operator!=(iterator) + cppclass reverse_iterator: + cint32_t& operator*() + iterator operator++() + bint operator==(reverse_iterator) + bint operator!=(reverse_iterator) + cppclass const_iterator(iterator): + pass + cppclass const_reverse_iterator(reverse_iterator): + pass + + _MyType() except + + _MyType(_MyType&) except + + + cint32_t& operator[](size_type) + void push_back(cint32_t&) except + + size_type size() + iterator begin() + const_iterator const_begin "begin"() + iterator end() + const_iterator const_end "end"() + reverse_iterator rbegin() + const_reverse_iterator const_rbegin "rbegin"() + reverse_iterator rend() + const_reverse_iterator const_rend "rend"() + void clear() + bint empty() + +cdef extern from * nogil: + cdef cppclass _MyType "::MyType": + ctypedef cint32_t value_type + ctypedef size_t size_type + + cppclass iterator: + cint32_t& operator*() + iterator operator++() + bint operator==(iterator) + bint operator!=(iterator) + cppclass reverse_iterator: + cint32_t& operator*() + iterator operator++() + bint operator==(reverse_iterator) + bint operator!=(reverse_iterator) + cppclass const_iterator(iterator): + pass + cppclass const_reverse_iterator(reverse_iterator): + pass + + _MyType() except + + _MyType(_MyType&) except + + + cpair[iterator, bint] insert(const cint32_t&) except + + size_type size() + size_type count(const cint32_t&) + iterator begin() + const_iterator const_begin "begin"() + iterator end() + const_iterator const_end "end"() + reverse_iterator rbegin() + const_reverse_iterator const_rbegin "rbegin"() + reverse_iterator rend() + const_reverse_iterator const_rend "rend"() + void clear() + bint empty() + +cdef extern from * nogil: + cdef cppclass _MyType "::MyType": + ctypedef cint32_t key_type + ctypedef cint32_t mapped_type + ctypedef size_t size_type + + cppclass iterator: + cpair[cint32_t, cint32_t]& operator*() + iterator operator++() + bint operator==(iterator) + bint operator!=(iterator) + cppclass reverse_iterator: + cpair[cint32_t, cint32_t]& operator*() + iterator operator++() + bint operator==(reverse_iterator) + bint operator!=(reverse_iterator) + cppclass const_iterator(iterator): + pass + cppclass const_reverse_iterator(reverse_iterator): + pass + + _MyType() except + + _MyType(_MyType&) except + + + cint32_t& operator[](cint32_t&) + iterator find(const cint32_t&) + const_iterator const_find "find"(const cint32_t&) + size_type count(const cint32_t&) + size_type size() + iterator begin() + const_iterator const_begin "begin"() + iterator end() + const_iterator const_end "end"() + reverse_iterator rbegin() + const_reverse_iterator const_rbegin "rbegin"() + reverse_iterator rend() + const_reverse_iterator const_rend "rend"() + void clear() + bint empty() + +cdef extern from *: + ctypedef string _py3_simple_AdaptedString "::py3::simple::AdaptedString" +cdef extern from *: + ctypedef bstring _py3_simple_AdaptedBinary "::py3::simple::AdaptedBinary" +cdef extern from * nogil: + cdef cppclass _py3_simple_AdaptedList "::py3::simple::AdaptedList": + ctypedef cint32_t value_type + ctypedef size_t size_type + + cppclass iterator: + cint32_t& operator*() + iterator operator++() + bint operator==(iterator) + bint operator!=(iterator) + cppclass reverse_iterator: + cint32_t& operator*() + iterator operator++() + bint operator==(reverse_iterator) + bint operator!=(reverse_iterator) + cppclass const_iterator(iterator): + pass + cppclass const_reverse_iterator(reverse_iterator): + pass + + _py3_simple_AdaptedList() except + + _py3_simple_AdaptedList(_py3_simple_AdaptedList&) except + + + cint32_t& operator[](size_type) + void push_back(cint32_t&) except + + size_type size() + iterator begin() + const_iterator const_begin "begin"() + iterator end() + const_iterator const_end "end"() + reverse_iterator rbegin() + const_reverse_iterator const_rbegin "rbegin"() + reverse_iterator rend() + const_reverse_iterator const_rend "rend"() + void clear() + bint empty() + +cdef extern from * nogil: + cdef cppclass _py3_simple_AdaptedSet "::py3::simple::AdaptedSet": + ctypedef cint32_t value_type + ctypedef size_t size_type + + cppclass iterator: + cint32_t& operator*() + iterator operator++() + bint operator==(iterator) + bint operator!=(iterator) + cppclass reverse_iterator: + cint32_t& operator*() + iterator operator++() + bint operator==(reverse_iterator) + bint operator!=(reverse_iterator) + cppclass const_iterator(iterator): + pass + cppclass const_reverse_iterator(reverse_iterator): + pass + + _py3_simple_AdaptedSet() except + + _py3_simple_AdaptedSet(_py3_simple_AdaptedSet&) except + + + cpair[iterator, bint] insert(const cint32_t&) except + + size_type size() + size_type count(const cint32_t&) + iterator begin() + const_iterator const_begin "begin"() + iterator end() + const_iterator const_end "end"() + reverse_iterator rbegin() + const_reverse_iterator const_rbegin "rbegin"() + reverse_iterator rend() + const_reverse_iterator const_rend "rend"() + void clear() + bint empty() + +cdef extern from * nogil: + cdef cppclass _py3_simple_AdaptedMap "::py3::simple::AdaptedMap": + ctypedef cint32_t key_type + ctypedef cint32_t mapped_type + ctypedef size_t size_type + + cppclass iterator: + cpair[cint32_t, cint32_t]& operator*() + iterator operator++() + bint operator==(iterator) + bint operator!=(iterator) + cppclass reverse_iterator: + cpair[cint32_t, cint32_t]& operator*() + iterator operator++() + bint operator==(reverse_iterator) + bint operator!=(reverse_iterator) + cppclass const_iterator(iterator): + pass + cppclass const_reverse_iterator(reverse_iterator): + pass + + _py3_simple_AdaptedMap() except + + _py3_simple_AdaptedMap(_py3_simple_AdaptedMap&) except + + + cint32_t& operator[](cint32_t&) + iterator find(const cint32_t&) + const_iterator const_find "find"(const cint32_t&) + size_type count(const cint32_t&) + size_type size() + iterator begin() + const_iterator const_begin "begin"() + iterator end() + const_iterator const_end "end"() + reverse_iterator rbegin() + const_reverse_iterator const_rbegin "rbegin"() + reverse_iterator rend() + const_reverse_iterator const_rend "rend"() + void clear() + bint empty() + + +cdef extern from "thrift/compiler/test/fixtures/py3/gen-cpp2/module_metadata.h" namespace "apache::thrift::detail::md": + cdef cppclass EnumMetadata[T]: + @staticmethod + void gen(__fbthrift_cThriftMetadata &metadata) +cdef extern from "thrift/compiler/test/fixtures/py3/gen-cpp2/module_types.h" namespace "::py3::simple": + cdef cppclass cAnEnum "::py3::simple::AnEnum": + pass + + cdef cppclass cAnEnumRenamed "::py3::simple::AnEnumRenamed": + pass + + cdef cppclass cFlags "::py3::simple::Flags": + pass + +cdef extern from "thrift/compiler/test/fixtures/py3/gen-cpp2/module_metadata.h" namespace "apache::thrift::detail::md": + cdef cppclass ExceptionMetadata[T]: + @staticmethod + void gen(__fbthrift_cThriftMetadata &metadata) +cdef extern from "thrift/compiler/test/fixtures/py3/gen-cpp2/module_metadata.h" namespace "apache::thrift::detail::md": + cdef cppclass StructMetadata[T]: + @staticmethod + void gen(__fbthrift_cThriftMetadata &metadata) +cdef extern from "thrift/compiler/test/fixtures/py3/gen-cpp2/module_types_custom_protocol.h" namespace "::py3::simple": + + cdef cppclass cSimpleException "::py3::simple::SimpleException"(cTException): + cSimpleException() except + + cSimpleException(const cSimpleException&) except + + bint operator==(cSimpleException&) + bint operator!=(cSimpleException&) + bint operator<(cSimpleException&) + bint operator>(cSimpleException&) + bint operator<=(cSimpleException&) + bint operator>=(cSimpleException&) + __field_ref[cint16_t] err_code_ref "err_code_ref" () + + + cdef cppclass cOptionalRefStruct "::py3::simple::OptionalRefStruct": + cOptionalRefStruct() except + + cOptionalRefStruct(const cOptionalRefStruct&) except + + bint operator==(cOptionalRefStruct&) + bint operator!=(cOptionalRefStruct&) + bint operator<(cOptionalRefStruct&) + bint operator>(cOptionalRefStruct&) + bint operator<=(cOptionalRefStruct&) + bint operator>=(cOptionalRefStruct&) + __optional_field_ref[unique_ptr[_fbthrift_iobuf.cIOBuf]] optional_blob_ref "optional_blob_ref" () + + + cdef cppclass cSimpleStruct "::py3::simple::SimpleStruct": + cSimpleStruct() except + + cSimpleStruct(const cSimpleStruct&) except + + bint operator==(cSimpleStruct&) + bint operator!=(cSimpleStruct&) + __field_ref[cbool] is_on_ref "is_on_ref" () + __field_ref[cint8_t] tiny_int_ref "tiny_int_ref" () + __field_ref[cint16_t] small_int_ref "small_int_ref" () + __field_ref[cint32_t] nice_sized_int_ref "nice_sized_int_ref" () + __field_ref[cint64_t] big_int_ref "big_int_ref" () + __field_ref[double] real_ref "real_ref" () + __field_ref[float] smaller_real_ref "smaller_real_ref" () + __field_ref[_std_unordered_map[cint32_t,cint32_t]] something_ref "something_ref" () + + + cdef cppclass cHiddenTypeFieldsStruct "::py3::simple::HiddenTypeFieldsStruct": + cHiddenTypeFieldsStruct() except + + cHiddenTypeFieldsStruct(const cHiddenTypeFieldsStruct&) except + + bint operator==(cHiddenTypeFieldsStruct&) + bint operator!=(cHiddenTypeFieldsStruct&) + + + cdef cppclass cComplexStruct "::py3::simple::ComplexStruct": + cComplexStruct() except + + cComplexStruct(const cComplexStruct&) except + + bint operator==(cComplexStruct&) + bint operator!=(cComplexStruct&) + __field_ref[cSimpleStruct] structOne_ref "structOne_ref" () + __field_ref[cSimpleStruct] structTwo_ref "structTwo_ref" () + __field_ref[cint32_t] an_integer_ref "an_integer_ref" () + __field_ref[string] name_ref "name_ref" () + __field_ref[cAnEnum] an_enum_ref "an_enum_ref" () + __field_ref[string] some_bytes_ref "some_bytes_ref" () + __field_ref[string] sender_ref "from_ref" () + __field_ref[string] cdef__ref "cdef_ref" () + __field_ref[foo_Bar] bytes_with_cpp_type_ref "bytes_with_cpp_type_ref" () + + cdef enum cBinaryUnion__type "::py3::simple::BinaryUnion::Type": + cBinaryUnion__type___EMPTY__ "::py3::simple::BinaryUnion::Type::__EMPTY__", + cBinaryUnion__type_iobuf_val "::py3::simple::BinaryUnion::Type::iobuf_val", + + cdef cppclass cBinaryUnion "::py3::simple::BinaryUnion": + cBinaryUnion() except + + cBinaryUnion(const cBinaryUnion&) except + + cBinaryUnion__type getType() const + const _fbthrift_iobuf.cIOBuf& get_iobuf_val "get_iobuf_val" () const + _fbthrift_iobuf.cIOBuf& set_iobuf_val "set_iobuf_val" (const _fbthrift_iobuf.cIOBuf&) + + + cdef cppclass cBinaryUnionStruct "::py3::simple::BinaryUnionStruct": + cBinaryUnionStruct() except + + cBinaryUnionStruct(const cBinaryUnionStruct&) except + + __field_ref[cBinaryUnion] u_ref "u_ref" () + + + cdef cppclass cCustomFields "::py3::simple::CustomFields": + cCustomFields() except + + cCustomFields(const cCustomFields&) except + + bint operator==(cCustomFields&) + bint operator!=(cCustomFields&) + __field_ref[_MyType] bool_field_ref "bool_field_ref" () + __field_ref[_MyType] integer_field_ref "integer_field_ref" () + __field_ref[_MyType] double_field_ref "double_field_ref" () + __field_ref[_MyType] string_field_ref "string_field_ref" () + __field_ref[_MyType] binary_field_ref "binary_field_ref" () + __field_ref[_MyType] list_field_ref "list_field_ref" () + __field_ref[_MyType] set_field_ref "set_field_ref" () + __field_ref[_MyType] map_field_ref "map_field_ref" () + __field_ref[cSimpleStruct] struct_field_ref "struct_field_ref" () + + + cdef cppclass cCustomTypedefFields "::py3::simple::CustomTypedefFields": + cCustomTypedefFields() except + + cCustomTypedefFields(const cCustomTypedefFields&) except + + bint operator==(cCustomTypedefFields&) + bint operator!=(cCustomTypedefFields&) + __field_ref[_MyType] bool_field_ref "bool_field_ref" () + __field_ref[_MyType] integer_field_ref "integer_field_ref" () + __field_ref[_MyType] double_field_ref "double_field_ref" () + __field_ref[_MyType] string_field_ref "string_field_ref" () + __field_ref[_MyType] binary_field_ref "binary_field_ref" () + __field_ref[_MyType] list_field_ref "list_field_ref" () + __field_ref[_MyType] set_field_ref "set_field_ref" () + __field_ref[_MyType] map_field_ref "map_field_ref" () + __field_ref[cSimpleStruct] struct_field_ref "struct_field_ref" () + + + cdef cppclass cAdaptedTypedefFields "::py3::simple::AdaptedTypedefFields": + cAdaptedTypedefFields() except + + cAdaptedTypedefFields(const cAdaptedTypedefFields&) except + + bint operator==(cAdaptedTypedefFields&) + bint operator!=(cAdaptedTypedefFields&) + __field_ref[cbool] bool_field_ref "bool_field_ref" () + __field_ref[cint64_t] integer_field_ref "integer_field_ref" () + __field_ref[double] double_field_ref "double_field_ref" () + __field_ref[_py3_simple_AdaptedString] string_field_ref "string_field_ref" () + __field_ref[_py3_simple_AdaptedBinary] binary_field_ref "binary_field_ref" () + __field_ref[_py3_simple_AdaptedList] list_field_ref "list_field_ref" () + __field_ref[_py3_simple_AdaptedSet] set_field_ref "set_field_ref" () + __field_ref[_py3_simple_AdaptedMap] map_field_ref "map_field_ref" () + __field_ref[cSimpleStruct] struct_field_ref "struct_field_ref" () + +cdef extern from "thrift/compiler/test/fixtures/py3/gen-cpp2/module_constants.h" namespace "::py3::simple": + cdef cbool cA_BOOL "::py3::simple::module_constants::A_BOOL" + cdef cint8_t cA_BYTE "::py3::simple::module_constants::A_BYTE" + cdef cint16_t cTHE_ANSWER "::py3::simple::module_constants::THE_ANSWER" + cdef cint32_t cA_NUMBER "::py3::simple::module_constants::A_NUMBER" + cdef cint64_t cA_BIG_NUMBER "::py3::simple::module_constants::A_BIG_NUMBER" + cdef double cA_REAL_NUMBER "::py3::simple::module_constants::A_REAL_NUMBER" + cdef double cA_FAKE_NUMBER "::py3::simple::module_constants::A_FAKE_NUMBER" + cdef const char* cA_WORD "::py3::simple::module_constants::A_WORD"() + cdef string cSOME_BYTES "::py3::simple::module_constants::SOME_BYTES"() + cdef cSimpleStruct cA_STRUCT "::py3::simple::module_constants::A_STRUCT"() + cdef cSimpleStruct cEMPTY "::py3::simple::module_constants::EMPTY"() + cdef vector[string] cWORD_LIST "::py3::simple::module_constants::WORD_LIST"() + cdef vector[cmap[cint32_t,double]] cSOME_MAP "::py3::simple::module_constants::SOME_MAP"() + cdef cset[cint32_t] cDIGITS "::py3::simple::module_constants::DIGITS"() + cdef cmap[string,cSimpleStruct] cA_CONST_MAP "::py3::simple::module_constants::A_CONST_MAP"() + cdef cmap[cAnEnumRenamed,cint32_t] cANOTHER_CONST_MAP "::py3::simple::module_constants::ANOTHER_CONST_MAP"() diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.pxd new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.pxd @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.py b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.py new file mode 100644 index 00000000000000..9e26838ba8c997 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.py @@ -0,0 +1,7 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# +from module.thrift_clients import * diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.pyi b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.pyi new file mode 100644 index 00000000000000..a3da5dbb0581d1 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.pyi @@ -0,0 +1,291 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# + +import folly.iobuf as _fbthrift_iobuf +import thrift.py3.types +import thrift.py3.client +import thrift.py3.common +import typing as _typing +from types import TracebackType + +import module.types as _module_types + + +_SimpleServiceT = _typing.TypeVar('_SimpleServiceT', bound='SimpleService') + + +class SimpleService(thrift.py3.client.Client): + + async def get_five( + self, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def add_five( + self, + num: int, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def do_nothing( + self, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> None: ... + + async def concat( + self, + first: str, + second: str, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> str: ... + + async def get_value( + self, + simple_struct: _module_types.SimpleStruct, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def negate( + self, + input: bool, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> bool: ... + + async def tiny( + self, + input: int, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def small( + self, + input: int, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def big( + self, + input: int, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def two( + self, + input: float, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> float: ... + + async def expected_exception( + self, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> None: ... + + async def unexpected_exception( + self, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def sum_i16_list( + self, + numbers: _typing.Sequence[int], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def sum_i32_list( + self, + numbers: _typing.Sequence[int], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def sum_i64_list( + self, + numbers: _typing.Sequence[int], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def concat_many( + self, + words: _typing.Sequence[str], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> str: ... + + async def count_structs( + self, + items: _typing.Sequence[_module_types.SimpleStruct], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def sum_set( + self, + numbers: _typing.AbstractSet[int], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def contains_word( + self, + words: _typing.AbstractSet[str], + word: str, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> bool: ... + + async def get_map_value( + self, + words: _typing.Mapping[str, str], + key: str, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> str: ... + + async def map_length( + self, + items: _typing.Mapping[str, _module_types.SimpleStruct], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def sum_map_values( + self, + items: _typing.Mapping[str, int], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def complex_sum_i32( + self, + counter: _module_types.ComplexStruct, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def repeat_name( + self, + counter: _module_types.ComplexStruct, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> str: ... + + async def get_struct( + self, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _module_types.SimpleStruct: ... + + async def fib( + self, + n: int, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _typing.Sequence[int]: ... + + async def unique_words( + self, + words: _typing.Sequence[str], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _typing.AbstractSet[str]: ... + + async def words_count( + self, + words: _typing.Sequence[str], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _typing.Mapping[str, int]: ... + + async def set_enum( + self, + in_enum: _module_types.AnEnum, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _module_types.AnEnum: ... + + async def list_of_lists( + self, + num_lists: int, + num_items: int, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _typing.Sequence[_typing.Sequence[int]]: ... + + async def word_character_frequency( + self, + sentence: str, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _typing.Mapping[str, _typing.Mapping[str, int]]: ... + + async def list_of_sets( + self, + some_words: str, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _typing.Sequence[_typing.AbstractSet[str]]: ... + + async def nested_map_argument( + self, + struct_map: _typing.Mapping[str, _typing.Sequence[_module_types.SimpleStruct]], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + async def make_sentence( + self, + word_chars: _typing.Sequence[_typing.Sequence[str]], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> str: ... + + async def get_union( + self, + sets: _typing.Sequence[_typing.AbstractSet[int]], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _typing.AbstractSet[int]: ... + + async def get_keys( + self, + string_map: _typing.Sequence[_typing.Mapping[str, str]], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _typing.AbstractSet[str]: ... + + async def lookup_double( + self, + key: int, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> float: ... + + async def retrieve_binary( + self, + something: bytes, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> bytes: ... + + async def contain_binary( + self, + binaries: _typing.Sequence[bytes], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _typing.AbstractSet[bytes]: ... + + async def contain_enum( + self, + the_enum: _typing.Sequence[_module_types.AnEnum], + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _typing.Sequence[_module_types.AnEnum]: ... + + async def get_binary_union_struct( + self, + u: _module_types.BinaryUnion, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> _module_types.BinaryUnionStruct: ... + + + +_DerivedServiceT = _typing.TypeVar('_DerivedServiceT', bound='DerivedService') + + +class DerivedService(SimpleService): + + async def get_six( + self, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + + + +_RederivedServiceT = _typing.TypeVar('_RederivedServiceT', bound='RederivedService') + + +class RederivedService(DerivedService): + + async def get_seven( + self, + rpc_options: _typing.Optional[thrift.py3.common.RpcOptions]=None + ) -> int: ... + diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.pyx new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients.pyx @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients_wrapper.cpp b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients_wrapper.cpp new file mode 100644 index 00000000000000..118f3bfa242a68 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients_wrapper.cpp @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients_wrapper.h b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients_wrapper.h new file mode 100644 index 00000000000000..118f3bfa242a68 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients_wrapper.h @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients_wrapper.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients_wrapper.pxd new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/clients_wrapper.pxd @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/containers_FBTHRIFT_ONLY_DO_NOT_USE.py b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/containers_FBTHRIFT_ONLY_DO_NOT_USE.py new file mode 100644 index 00000000000000..277d1b8dd78bd4 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/containers_FBTHRIFT_ONLY_DO_NOT_USE.py @@ -0,0 +1,1475 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# + +import thrift.py3.types +import importlib +from collections.abc import Mapping, Sequence, Set + +""" + This is a helper module to define py3 container types. + All types defined here are re-exported in the parent `.types` module. + Only `import` types defined here via the parent `.types` module. + If you `import` them directly from here, you will get nasty import errors. +""" + +_fbthrift__module_name__ = "module.types" + +import module.types as _module_types + +def get_types_reflection(): + return importlib.import_module( + "module.types_reflection" + ) + +__all__ = [] + +class List__i16(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__i16): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = List__i16._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__i16) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, int): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__i16() + + +Sequence.register(List__i16) + +__all__.append('List__i16') + + +class List__i32(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__i32): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = List__i32._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__i32) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, int): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__i32() + + +Sequence.register(List__i32) + +__all__.append('List__i32') + + +class List__i64(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__i64): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = List__i64._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__i64) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, int): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__i64() + + +Sequence.register(List__i64) + +__all__.append('List__i64') + + +class List__string(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__string): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + if isinstance(items, str): + raise TypeError("If you really want to pass a string into a _typing.Sequence[str] field, explicitly convert it first.") + check_method = List__string._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__string) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, str) + ): + raise TypeError(f"{item!r} is not of type str") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, str): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__string() + + +Sequence.register(List__string) + +__all__.append('List__string') + + +class List__SimpleStruct(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__SimpleStruct): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = List__SimpleStruct._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__SimpleStruct) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, _module_types.SimpleStruct) + ): + raise TypeError(f"{item!r} is not of type _module_types.SimpleStruct") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, _module_types.SimpleStruct): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__SimpleStruct() + + +Sequence.register(List__SimpleStruct) + +__all__.append('List__SimpleStruct') + + +class Set__i32(thrift.py3.types.Set): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_set_private_ctor: + _py_obj = items + elif isinstance(items, Set__i32): + _py_obj = frozenset(items) + elif items is None: + _py_obj = frozenset() + else: + check_method = Set__i32._check_item_type_or_raise + _py_obj = frozenset(check_method(item) for item in items) + + super().__init__(_py_obj, Set__i32) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, int): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__Set__i32() + + +Set.register(Set__i32) + +__all__.append('Set__i32') + + +class Set__string(thrift.py3.types.Set): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_set_private_ctor: + _py_obj = items + elif isinstance(items, Set__string): + _py_obj = frozenset(items) + elif items is None: + _py_obj = frozenset() + else: + if isinstance(items, str): + raise TypeError("If you really want to pass a string into a _typing.AbstractSet[str] field, explicitly convert it first.") + check_method = Set__string._check_item_type_or_raise + _py_obj = frozenset(check_method(item) for item in items) + + super().__init__(_py_obj, Set__string) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, str) + ): + raise TypeError(f"{item!r} is not of type str") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, str): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__Set__string() + + +Set.register(Set__string) + +__all__.append('Set__string') + + +class Map__string_string(thrift.py3.types.Map): + __module__ = _fbthrift__module_name__ + __slots__ = () + + _FBTHRIFT_USE_SORTED_REPR = True + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_map_private_ctor: + _py_obj = items + elif isinstance(items, Map__string_string): + _py_obj = dict(items) + elif items is None: + _py_obj = dict() + else: + check_key = Map__string_string._check_key_type_or_raise + check_val = Map__string_string._check_val_type_or_raise + _py_obj = {check_key(k) : check_val(v) for k, v in items.items()} + + super().__init__(_py_obj, Map__string_string) + + @staticmethod + def _check_key_type_or_raise(key): + if not ( + isinstance(key, str) + ): + raise TypeError(f"{key!r} is not of type str") + return key + + @staticmethod + def _check_key_type_or_none(key): + if key is None: + return None + if isinstance(key, str): + return key + + @staticmethod + def _check_val_type_or_raise(item): + if not ( + isinstance(item, str) + ): + raise TypeError(f"{item!r} is not of type str") + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__Map__string_string() + + +Mapping.register(Map__string_string) +__all__.append('Map__string_string') + + +class Map__string_SimpleStruct(thrift.py3.types.Map): + __module__ = _fbthrift__module_name__ + __slots__ = () + + _FBTHRIFT_USE_SORTED_REPR = True + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_map_private_ctor: + _py_obj = items + elif isinstance(items, Map__string_SimpleStruct): + _py_obj = dict(items) + elif items is None: + _py_obj = dict() + else: + check_key = Map__string_SimpleStruct._check_key_type_or_raise + check_val = Map__string_SimpleStruct._check_val_type_or_raise + _py_obj = {check_key(k) : check_val(v) for k, v in items.items()} + + super().__init__(_py_obj, Map__string_SimpleStruct) + + @staticmethod + def _check_key_type_or_raise(key): + if not ( + isinstance(key, str) + ): + raise TypeError(f"{key!r} is not of type str") + return key + + @staticmethod + def _check_key_type_or_none(key): + if key is None: + return None + if isinstance(key, str): + return key + + @staticmethod + def _check_val_type_or_raise(item): + if not ( + isinstance(item, _module_types.SimpleStruct) + ): + raise TypeError(f"{item!r} is not of type _module_types.SimpleStruct") + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__Map__string_SimpleStruct() + + +Mapping.register(Map__string_SimpleStruct) +__all__.append('Map__string_SimpleStruct') + + +class Map__string_i16(thrift.py3.types.Map): + __module__ = _fbthrift__module_name__ + __slots__ = () + + _FBTHRIFT_USE_SORTED_REPR = True + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_map_private_ctor: + _py_obj = items + elif isinstance(items, Map__string_i16): + _py_obj = dict(items) + elif items is None: + _py_obj = dict() + else: + check_key = Map__string_i16._check_key_type_or_raise + check_val = Map__string_i16._check_val_type_or_raise + _py_obj = {check_key(k) : check_val(v) for k, v in items.items()} + + super().__init__(_py_obj, Map__string_i16) + + @staticmethod + def _check_key_type_or_raise(key): + if not ( + isinstance(key, str) + ): + raise TypeError(f"{key!r} is not of type str") + return key + + @staticmethod + def _check_key_type_or_none(key): + if key is None: + return None + if isinstance(key, str): + return key + + @staticmethod + def _check_val_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__Map__string_i16() + + +Mapping.register(Map__string_i16) +__all__.append('Map__string_i16') + + +class List__List__i32(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__List__i32): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = List__List__i32._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__List__i32) + + @staticmethod + def _check_item_type_or_raise(item): + if item is None: + raise TypeError("None is not of the type _typing.Sequence[int]") + if not isinstance(item, _module_types.List__i32): + item = _module_types.List__i32(item) + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, _module_types.List__i32): + return item + try: + return _module_types.List__i32(item) + except: + pass + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__List__i32() + + +Sequence.register(List__List__i32) + +__all__.append('List__List__i32') + + +class Map__string_i32(thrift.py3.types.Map): + __module__ = _fbthrift__module_name__ + __slots__ = () + + _FBTHRIFT_USE_SORTED_REPR = True + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_map_private_ctor: + _py_obj = items + elif isinstance(items, Map__string_i32): + _py_obj = dict(items) + elif items is None: + _py_obj = dict() + else: + check_key = Map__string_i32._check_key_type_or_raise + check_val = Map__string_i32._check_val_type_or_raise + _py_obj = {check_key(k) : check_val(v) for k, v in items.items()} + + super().__init__(_py_obj, Map__string_i32) + + @staticmethod + def _check_key_type_or_raise(key): + if not ( + isinstance(key, str) + ): + raise TypeError(f"{key!r} is not of type str") + return key + + @staticmethod + def _check_key_type_or_none(key): + if key is None: + return None + if isinstance(key, str): + return key + + @staticmethod + def _check_val_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__Map__string_i32() + + +Mapping.register(Map__string_i32) +__all__.append('Map__string_i32') + + +class Map__string_Map__string_i32(thrift.py3.types.Map): + __module__ = _fbthrift__module_name__ + __slots__ = () + + _FBTHRIFT_USE_SORTED_REPR = True + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_map_private_ctor: + _py_obj = items + elif isinstance(items, Map__string_Map__string_i32): + _py_obj = dict(items) + elif items is None: + _py_obj = dict() + else: + check_key = Map__string_Map__string_i32._check_key_type_or_raise + check_val = Map__string_Map__string_i32._check_val_type_or_raise + _py_obj = {check_key(k) : check_val(v) for k, v in items.items()} + + super().__init__(_py_obj, Map__string_Map__string_i32) + + @staticmethod + def _check_key_type_or_raise(key): + if not ( + isinstance(key, str) + ): + raise TypeError(f"{key!r} is not of type str") + return key + + @staticmethod + def _check_key_type_or_none(key): + if key is None: + return None + if isinstance(key, str): + return key + + @staticmethod + def _check_val_type_or_raise(item): + if item is None: + raise TypeError("None is not of the type _typing.Mapping[str, int]") + if not isinstance(item, _module_types.Map__string_i32): + item = _module_types.Map__string_i32(item) + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__Map__string_Map__string_i32() + + +Mapping.register(Map__string_Map__string_i32) +__all__.append('Map__string_Map__string_i32') + + +class List__Set__string(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__Set__string): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = List__Set__string._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__Set__string) + + @staticmethod + def _check_item_type_or_raise(item): + if item is None: + raise TypeError("None is not of the type _typing.AbstractSet[str]") + if not isinstance(item, _module_types.Set__string): + item = _module_types.Set__string(item) + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, _module_types.Set__string): + return item + try: + return _module_types.Set__string(item) + except: + pass + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__Set__string() + + +Sequence.register(List__Set__string) + +__all__.append('List__Set__string') + + +class Map__string_List__SimpleStruct(thrift.py3.types.Map): + __module__ = _fbthrift__module_name__ + __slots__ = () + + _FBTHRIFT_USE_SORTED_REPR = True + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_map_private_ctor: + _py_obj = items + elif isinstance(items, Map__string_List__SimpleStruct): + _py_obj = dict(items) + elif items is None: + _py_obj = dict() + else: + check_key = Map__string_List__SimpleStruct._check_key_type_or_raise + check_val = Map__string_List__SimpleStruct._check_val_type_or_raise + _py_obj = {check_key(k) : check_val(v) for k, v in items.items()} + + super().__init__(_py_obj, Map__string_List__SimpleStruct) + + @staticmethod + def _check_key_type_or_raise(key): + if not ( + isinstance(key, str) + ): + raise TypeError(f"{key!r} is not of type str") + return key + + @staticmethod + def _check_key_type_or_none(key): + if key is None: + return None + if isinstance(key, str): + return key + + @staticmethod + def _check_val_type_or_raise(item): + if item is None: + raise TypeError("None is not of the type _typing.Sequence[_module_types.SimpleStruct]") + if not isinstance(item, _module_types.List__SimpleStruct): + item = _module_types.List__SimpleStruct(item) + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__Map__string_List__SimpleStruct() + + +Mapping.register(Map__string_List__SimpleStruct) +__all__.append('Map__string_List__SimpleStruct') + + +class List__List__string(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__List__string): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = List__List__string._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__List__string) + + @staticmethod + def _check_item_type_or_raise(item): + if item is None: + raise TypeError("None is not of the type _typing.Sequence[str]") + if not isinstance(item, _module_types.List__string): + item = _module_types.List__string(item) + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, _module_types.List__string): + return item + try: + return _module_types.List__string(item) + except: + pass + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__List__string() + + +Sequence.register(List__List__string) + +__all__.append('List__List__string') + + +class List__Set__i32(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__Set__i32): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = List__Set__i32._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__Set__i32) + + @staticmethod + def _check_item_type_or_raise(item): + if item is None: + raise TypeError("None is not of the type _typing.AbstractSet[int]") + if not isinstance(item, _module_types.Set__i32): + item = _module_types.Set__i32(item) + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, _module_types.Set__i32): + return item + try: + return _module_types.Set__i32(item) + except: + pass + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__Set__i32() + + +Sequence.register(List__Set__i32) + +__all__.append('List__Set__i32') + + +class List__Map__string_string(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__Map__string_string): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = List__Map__string_string._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__Map__string_string) + + @staticmethod + def _check_item_type_or_raise(item): + if item is None: + raise TypeError("None is not of the type _typing.Mapping[str, str]") + if not isinstance(item, _module_types.Map__string_string): + item = _module_types.Map__string_string(item) + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, _module_types.Map__string_string): + return item + try: + return _module_types.Map__string_string(item) + except: + pass + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__Map__string_string() + + +Sequence.register(List__Map__string_string) + +__all__.append('List__Map__string_string') + + +class List__binary(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__binary): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + if isinstance(items, str): + raise TypeError("If you really want to pass a string into a _typing.Sequence[bytes] field, explicitly convert it first.") + check_method = List__binary._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__binary) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, bytes) + ): + raise TypeError(f"{item!r} is not of type bytes") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, bytes): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__binary() + + +Sequence.register(List__binary) + +__all__.append('List__binary') + + +class Set__binary(thrift.py3.types.Set): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_set_private_ctor: + _py_obj = items + elif isinstance(items, Set__binary): + _py_obj = frozenset(items) + elif items is None: + _py_obj = frozenset() + else: + if isinstance(items, str): + raise TypeError("If you really want to pass a string into a _typing.AbstractSet[bytes] field, explicitly convert it first.") + check_method = Set__binary._check_item_type_or_raise + _py_obj = frozenset(check_method(item) for item in items) + + super().__init__(_py_obj, Set__binary) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, bytes) + ): + raise TypeError(f"{item!r} is not of type bytes") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, bytes): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__Set__binary() + + +Set.register(Set__binary) + +__all__.append('Set__binary') + + +class List__AnEnum(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__AnEnum): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = List__AnEnum._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__AnEnum) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, _module_types.AnEnum) or + isinstance(item, thrift.py3.types.BadEnum) + ): + raise TypeError(f"{item!r} is not of type _module_types.AnEnum") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, _module_types.AnEnum): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__AnEnum() + + +Sequence.register(List__AnEnum) + +__all__.append('List__AnEnum') + + +class _std_unordered_map__Map__i32_i32(thrift.py3.types.Map): + __module__ = _fbthrift__module_name__ + __slots__ = () + + _FBTHRIFT_USE_SORTED_REPR = False + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_map_private_ctor: + _py_obj = items + elif isinstance(items, _std_unordered_map__Map__i32_i32): + _py_obj = dict(items) + elif items is None: + _py_obj = dict() + else: + check_key = _std_unordered_map__Map__i32_i32._check_key_type_or_raise + check_val = _std_unordered_map__Map__i32_i32._check_val_type_or_raise + _py_obj = {check_key(k) : check_val(v) for k, v in items.items()} + + super().__init__(_py_obj, _std_unordered_map__Map__i32_i32) + + @staticmethod + def _check_key_type_or_raise(key): + if not ( + isinstance(key, int) + ): + raise TypeError(f"{key!r} is not of type int") + return key + + @staticmethod + def _check_key_type_or_none(key): + if key is None: + return None + if isinstance(key, int): + return key + + @staticmethod + def _check_val_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection___std_unordered_map__Map__i32_i32() + + +Mapping.register(_std_unordered_map__Map__i32_i32) +__all__.append('_std_unordered_map__Map__i32_i32') + + +class _MyType__List__i32(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, _MyType__List__i32): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = _MyType__List__i32._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, _MyType__List__i32) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, int): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection___MyType__List__i32() + + +Sequence.register(_MyType__List__i32) + +__all__.append('_MyType__List__i32') + + +class _MyType__Set__i32(thrift.py3.types.Set): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_set_private_ctor: + _py_obj = items + elif isinstance(items, _MyType__Set__i32): + _py_obj = frozenset(items) + elif items is None: + _py_obj = frozenset() + else: + check_method = _MyType__Set__i32._check_item_type_or_raise + _py_obj = frozenset(check_method(item) for item in items) + + super().__init__(_py_obj, _MyType__Set__i32) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, int): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection___MyType__Set__i32() + + +Set.register(_MyType__Set__i32) + +__all__.append('_MyType__Set__i32') + + +class _MyType__Map__i32_i32(thrift.py3.types.Map): + __module__ = _fbthrift__module_name__ + __slots__ = () + + _FBTHRIFT_USE_SORTED_REPR = True + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_map_private_ctor: + _py_obj = items + elif isinstance(items, _MyType__Map__i32_i32): + _py_obj = dict(items) + elif items is None: + _py_obj = dict() + else: + check_key = _MyType__Map__i32_i32._check_key_type_or_raise + check_val = _MyType__Map__i32_i32._check_val_type_or_raise + _py_obj = {check_key(k) : check_val(v) for k, v in items.items()} + + super().__init__(_py_obj, _MyType__Map__i32_i32) + + @staticmethod + def _check_key_type_or_raise(key): + if not ( + isinstance(key, int) + ): + raise TypeError(f"{key!r} is not of type int") + return key + + @staticmethod + def _check_key_type_or_none(key): + if key is None: + return None + if isinstance(key, int): + return key + + @staticmethod + def _check_val_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection___MyType__Map__i32_i32() + + +Mapping.register(_MyType__Map__i32_i32) +__all__.append('_MyType__Map__i32_i32') + + +class _py3_simple_AdaptedList__List__i32(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, _py3_simple_AdaptedList__List__i32): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = _py3_simple_AdaptedList__List__i32._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, _py3_simple_AdaptedList__List__i32) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, int): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection___py3_simple_AdaptedList__List__i32() + + +Sequence.register(_py3_simple_AdaptedList__List__i32) + +__all__.append('_py3_simple_AdaptedList__List__i32') + + +class _py3_simple_AdaptedSet__Set__i32(thrift.py3.types.Set): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_set_private_ctor: + _py_obj = items + elif isinstance(items, _py3_simple_AdaptedSet__Set__i32): + _py_obj = frozenset(items) + elif items is None: + _py_obj = frozenset() + else: + check_method = _py3_simple_AdaptedSet__Set__i32._check_item_type_or_raise + _py_obj = frozenset(check_method(item) for item in items) + + super().__init__(_py_obj, _py3_simple_AdaptedSet__Set__i32) + + @staticmethod + def _check_item_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, int): + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection___py3_simple_AdaptedSet__Set__i32() + + +Set.register(_py3_simple_AdaptedSet__Set__i32) + +__all__.append('_py3_simple_AdaptedSet__Set__i32') + + +class _py3_simple_AdaptedMap__Map__i32_i32(thrift.py3.types.Map): + __module__ = _fbthrift__module_name__ + __slots__ = () + + _FBTHRIFT_USE_SORTED_REPR = True + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_map_private_ctor: + _py_obj = items + elif isinstance(items, _py3_simple_AdaptedMap__Map__i32_i32): + _py_obj = dict(items) + elif items is None: + _py_obj = dict() + else: + check_key = _py3_simple_AdaptedMap__Map__i32_i32._check_key_type_or_raise + check_val = _py3_simple_AdaptedMap__Map__i32_i32._check_val_type_or_raise + _py_obj = {check_key(k) : check_val(v) for k, v in items.items()} + + super().__init__(_py_obj, _py3_simple_AdaptedMap__Map__i32_i32) + + @staticmethod + def _check_key_type_or_raise(key): + if not ( + isinstance(key, int) + ): + raise TypeError(f"{key!r} is not of type int") + return key + + @staticmethod + def _check_key_type_or_none(key): + if key is None: + return None + if isinstance(key, int): + return key + + @staticmethod + def _check_val_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection___py3_simple_AdaptedMap__Map__i32_i32() + + +Mapping.register(_py3_simple_AdaptedMap__Map__i32_i32) +__all__.append('_py3_simple_AdaptedMap__Map__i32_i32') + + +class Map__i32_double(thrift.py3.types.Map): + __module__ = _fbthrift__module_name__ + __slots__ = () + + _FBTHRIFT_USE_SORTED_REPR = True + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_map_private_ctor: + _py_obj = items + elif isinstance(items, Map__i32_double): + _py_obj = dict(items) + elif items is None: + _py_obj = dict() + else: + check_key = Map__i32_double._check_key_type_or_raise + check_val = Map__i32_double._check_val_type_or_raise + _py_obj = {check_key(k) : check_val(v) for k, v in items.items()} + + super().__init__(_py_obj, Map__i32_double) + + @staticmethod + def _check_key_type_or_raise(key): + if not ( + isinstance(key, int) + ): + raise TypeError(f"{key!r} is not of type int") + return key + + @staticmethod + def _check_key_type_or_none(key): + if key is None: + return None + if isinstance(key, int): + return key + + @staticmethod + def _check_val_type_or_raise(item): + if not ( + isinstance(item, (float, int)) + ): + raise TypeError(f"{item!r} is not of type float") + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__Map__i32_double() + + +Mapping.register(Map__i32_double) +__all__.append('Map__i32_double') + + +class List__Map__i32_double(thrift.py3.types.List): + __module__ = _fbthrift__module_name__ + __slots__ = () + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_list_private_ctor: + _py_obj = items + elif isinstance(items, List__Map__i32_double): + _py_obj = list(items) + elif items is None: + _py_obj = [] + else: + check_method = List__Map__i32_double._check_item_type_or_raise + _py_obj = [check_method(item) for item in items] + + super().__init__(_py_obj, List__Map__i32_double) + + @staticmethod + def _check_item_type_or_raise(item): + if item is None: + raise TypeError("None is not of the type _typing.Mapping[int, float]") + if not isinstance(item, _module_types.Map__i32_double): + item = _module_types.Map__i32_double(item) + return item + + @staticmethod + def _check_item_type_or_none(item): + if item is None: + return None + if isinstance(item, _module_types.Map__i32_double): + return item + try: + return _module_types.Map__i32_double(item) + except: + pass + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__List__Map__i32_double() + + +Sequence.register(List__Map__i32_double) + +__all__.append('List__Map__i32_double') + + +class Map__AnEnumRenamed_i32(thrift.py3.types.Map): + __module__ = _fbthrift__module_name__ + __slots__ = () + + _FBTHRIFT_USE_SORTED_REPR = True + + def __init__(self, items=None, private_ctor_token=None) -> None: + if private_ctor_token is thrift.py3.types._fbthrift_map_private_ctor: + _py_obj = items + elif isinstance(items, Map__AnEnumRenamed_i32): + _py_obj = dict(items) + elif items is None: + _py_obj = dict() + else: + check_key = Map__AnEnumRenamed_i32._check_key_type_or_raise + check_val = Map__AnEnumRenamed_i32._check_val_type_or_raise + _py_obj = {check_key(k) : check_val(v) for k, v in items.items()} + + super().__init__(_py_obj, Map__AnEnumRenamed_i32) + + @staticmethod + def _check_key_type_or_raise(key): + if not ( + isinstance(key, _module_types.AnEnumRenamed) or + isinstance(key, thrift.py3.types.BadEnum) + ): + raise TypeError(f"{key!r} is not of type _module_types.AnEnumRenamed") + return key + + @staticmethod + def _check_key_type_or_none(key): + if key is None: + return None + if isinstance(key, _module_types.AnEnumRenamed): + return key + + @staticmethod + def _check_val_type_or_raise(item): + if not ( + isinstance(item, int) + ): + raise TypeError(f"{item!r} is not of type int") + return item + + @staticmethod + def __get_reflection__(): + return get_types_reflection().get_reflection__Map__AnEnumRenamed_i32() + + +Mapping.register(Map__AnEnumRenamed_i32) +__all__.append('Map__AnEnumRenamed_i32') + + diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/converter.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/converter.pxd new file mode 100644 index 00000000000000..63ce23a32e1025 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/converter.pxd @@ -0,0 +1,93 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# + +from libc.stdint cimport ( + int8_t as cint8_t, + int16_t as cint16_t, + int32_t as cint32_t, + int64_t as cint64_t, + uint16_t as cuint16_t, + uint32_t as cuint32_t, +) +from libcpp.string cimport string +from libcpp cimport bool as cbool, nullptr, nullptr_t +from cpython cimport bool as pbool +from libcpp.memory cimport shared_ptr, unique_ptr +from libcpp.vector cimport vector +from libcpp.set cimport set as cset +from libcpp.map cimport map as cmap, pair as cpair +from libcpp.unordered_map cimport unordered_map as cumap +cimport folly.iobuf as _fbthrift_iobuf + +cimport module.cbindings as _module_cbindings + +cimport module.cbindings as _fbthrift_cbindings + + +cdef shared_ptr[_fbthrift_cbindings.cSimpleException] SimpleException_convert_to_cpp(object inst) except* +cdef object SimpleException_from_cpp(const shared_ptr[_fbthrift_cbindings.cSimpleException]& c_struct) + +cdef shared_ptr[_fbthrift_cbindings.cOptionalRefStruct] OptionalRefStruct_convert_to_cpp(object inst) except* +cdef object OptionalRefStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cOptionalRefStruct]& c_struct) + +cdef shared_ptr[_fbthrift_cbindings.cSimpleStruct] SimpleStruct_convert_to_cpp(object inst) except* +cdef object SimpleStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cSimpleStruct]& c_struct) + +cdef shared_ptr[_fbthrift_cbindings.cHiddenTypeFieldsStruct] HiddenTypeFieldsStruct_convert_to_cpp(object inst) except* +cdef object HiddenTypeFieldsStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cHiddenTypeFieldsStruct]& c_struct) + +cdef shared_ptr[_fbthrift_cbindings.cComplexStruct] ComplexStruct_convert_to_cpp(object inst) except* +cdef object ComplexStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cComplexStruct]& c_struct) + +cdef shared_ptr[_fbthrift_cbindings.cBinaryUnion] BinaryUnion_convert_to_cpp(object inst) except* +cdef object BinaryUnion_from_cpp(const shared_ptr[_fbthrift_cbindings.cBinaryUnion]& c_struct) + +cdef shared_ptr[_fbthrift_cbindings.cBinaryUnionStruct] BinaryUnionStruct_convert_to_cpp(object inst) except* +cdef object BinaryUnionStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cBinaryUnionStruct]& c_struct) + +cdef shared_ptr[_fbthrift_cbindings.cCustomFields] CustomFields_convert_to_cpp(object inst) except* +cdef object CustomFields_from_cpp(const shared_ptr[_fbthrift_cbindings.cCustomFields]& c_struct) + +cdef shared_ptr[_fbthrift_cbindings.cCustomTypedefFields] CustomTypedefFields_convert_to_cpp(object inst) except* +cdef object CustomTypedefFields_from_cpp(const shared_ptr[_fbthrift_cbindings.cCustomTypedefFields]& c_struct) + +cdef shared_ptr[_fbthrift_cbindings.cAdaptedTypedefFields] AdaptedTypedefFields_convert_to_cpp(object inst) except* +cdef object AdaptedTypedefFields_from_cpp(const shared_ptr[_fbthrift_cbindings.cAdaptedTypedefFields]& c_struct) + +cdef vector[cint16_t] List__i16__make_instance(object items) except * +cdef vector[cint32_t] List__i32__make_instance(object items) except * +cdef vector[cint64_t] List__i64__make_instance(object items) except * +cdef vector[string] List__string__make_instance(object items) except * +cdef vector[_module_cbindings.cSimpleStruct] List__SimpleStruct__make_instance(object items) except * +cdef cset[cint32_t] Set__i32__make_instance(object items) except * +cdef cset[string] Set__string__make_instance(object items) except * +cdef cmap[string,string] Map__string_string__make_instance(object items) except * +cdef cmap[string,_module_cbindings.cSimpleStruct] Map__string_SimpleStruct__make_instance(object items) except * +cdef cmap[string,cint16_t] Map__string_i16__make_instance(object items) except * +cdef vector[vector[cint32_t]] List__List__i32__make_instance(object items) except * +cdef cmap[string,cint32_t] Map__string_i32__make_instance(object items) except * +cdef cmap[string,cmap[string,cint32_t]] Map__string_Map__string_i32__make_instance(object items) except * +cdef vector[cset[string]] List__Set__string__make_instance(object items) except * +cdef cmap[string,vector[_module_cbindings.cSimpleStruct]] Map__string_List__SimpleStruct__make_instance(object items) except * +cdef vector[vector[string]] List__List__string__make_instance(object items) except * +cdef vector[cset[cint32_t]] List__Set__i32__make_instance(object items) except * +cdef vector[cmap[string,string]] List__Map__string_string__make_instance(object items) except * +cdef vector[string] List__binary__make_instance(object items) except * +cdef cset[string] Set__binary__make_instance(object items) except * +cdef vector[_module_cbindings.cAnEnum] List__AnEnum__make_instance(object items) except * +cdef _module_cbindings._std_unordered_map[cint32_t,cint32_t] _std_unordered_map__Map__i32_i32__make_instance(object items) except * +cdef _module_cbindings._MyType _MyType__List__i32__make_instance(object items) except * +cdef _module_cbindings._MyType _MyType__Set__i32__make_instance(object items) except * +cdef _module_cbindings._MyType _MyType__Map__i32_i32__make_instance(object items) except * +cdef _module_cbindings._py3_simple_AdaptedList _py3_simple_AdaptedList__List__i32__make_instance(object items) except * +cdef _module_cbindings._py3_simple_AdaptedSet _py3_simple_AdaptedSet__Set__i32__make_instance(object items) except * +cdef _module_cbindings._py3_simple_AdaptedMap _py3_simple_AdaptedMap__Map__i32_i32__make_instance(object items) except * +cdef cmap[cint32_t,double] Map__i32_double__make_instance(object items) except * +cdef vector[cmap[cint32_t,double]] List__Map__i32_double__make_instance(object items) except * +cdef cmap[_module_cbindings.cAnEnumRenamed,cint32_t] Map__AnEnumRenamed_i32__make_instance(object items) except * +cdef extern from "thrift/compiler/test/fixtures/py3/gen-python-capi/module/thrift_types_capi.h": + pass diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/converter.pyx new file mode 100644 index 00000000000000..286814321e1a12 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/converter.pyx @@ -0,0 +1,452 @@ + +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# + +from libcpp.memory cimport make_shared +from thrift.python.capi.cpp_converter cimport cpp_to_python, python_to_cpp +from cython.operator cimport dereference as deref +from libcpp.utility cimport move as cmove + +import module.types as _module_types + + +cdef shared_ptr[_fbthrift_cbindings.cSimpleException] SimpleException_convert_to_cpp(object inst) except*: + return make_shared[_fbthrift_cbindings.cSimpleException](python_to_cpp[_fbthrift_cbindings.cSimpleException](inst)) +cdef object SimpleException_from_cpp(const shared_ptr[_fbthrift_cbindings.cSimpleException]& c_struct): + return cpp_to_python[_fbthrift_cbindings.cSimpleException](deref(c_struct)) + +cdef shared_ptr[_fbthrift_cbindings.cOptionalRefStruct] OptionalRefStruct_convert_to_cpp(object inst) except*: + return make_shared[_fbthrift_cbindings.cOptionalRefStruct](python_to_cpp[_fbthrift_cbindings.cOptionalRefStruct](inst)) +cdef object OptionalRefStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cOptionalRefStruct]& c_struct): + return cpp_to_python[_fbthrift_cbindings.cOptionalRefStruct](deref(c_struct)) + +cdef shared_ptr[_fbthrift_cbindings.cSimpleStruct] SimpleStruct_convert_to_cpp(object inst) except*: + return make_shared[_fbthrift_cbindings.cSimpleStruct](python_to_cpp[_fbthrift_cbindings.cSimpleStruct](inst)) +cdef object SimpleStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cSimpleStruct]& c_struct): + return cpp_to_python[_fbthrift_cbindings.cSimpleStruct](deref(c_struct)) + +cdef shared_ptr[_fbthrift_cbindings.cHiddenTypeFieldsStruct] HiddenTypeFieldsStruct_convert_to_cpp(object inst) except*: + return make_shared[_fbthrift_cbindings.cHiddenTypeFieldsStruct](python_to_cpp[_fbthrift_cbindings.cHiddenTypeFieldsStruct](inst)) +cdef object HiddenTypeFieldsStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cHiddenTypeFieldsStruct]& c_struct): + return cpp_to_python[_fbthrift_cbindings.cHiddenTypeFieldsStruct](deref(c_struct)) + +cdef shared_ptr[_fbthrift_cbindings.cComplexStruct] ComplexStruct_convert_to_cpp(object inst) except*: + return make_shared[_fbthrift_cbindings.cComplexStruct](python_to_cpp[_fbthrift_cbindings.cComplexStruct](inst)) +cdef object ComplexStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cComplexStruct]& c_struct): + return cpp_to_python[_fbthrift_cbindings.cComplexStruct](deref(c_struct)) + +cdef shared_ptr[_fbthrift_cbindings.cBinaryUnion] BinaryUnion_convert_to_cpp(object inst) except*: + return make_shared[_fbthrift_cbindings.cBinaryUnion](python_to_cpp[_fbthrift_cbindings.cBinaryUnion](inst)) +cdef object BinaryUnion_from_cpp(const shared_ptr[_fbthrift_cbindings.cBinaryUnion]& c_struct): + return cpp_to_python[_fbthrift_cbindings.cBinaryUnion](deref(c_struct)) + +cdef shared_ptr[_fbthrift_cbindings.cBinaryUnionStruct] BinaryUnionStruct_convert_to_cpp(object inst) except*: + return make_shared[_fbthrift_cbindings.cBinaryUnionStruct](python_to_cpp[_fbthrift_cbindings.cBinaryUnionStruct](inst)) +cdef object BinaryUnionStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cBinaryUnionStruct]& c_struct): + return cpp_to_python[_fbthrift_cbindings.cBinaryUnionStruct](deref(c_struct)) + +cdef shared_ptr[_fbthrift_cbindings.cCustomFields] CustomFields_convert_to_cpp(object inst) except*: + return make_shared[_fbthrift_cbindings.cCustomFields](python_to_cpp[_fbthrift_cbindings.cCustomFields](inst)) +cdef object CustomFields_from_cpp(const shared_ptr[_fbthrift_cbindings.cCustomFields]& c_struct): + return cpp_to_python[_fbthrift_cbindings.cCustomFields](deref(c_struct)) + +cdef shared_ptr[_fbthrift_cbindings.cCustomTypedefFields] CustomTypedefFields_convert_to_cpp(object inst) except*: + return make_shared[_fbthrift_cbindings.cCustomTypedefFields](python_to_cpp[_fbthrift_cbindings.cCustomTypedefFields](inst)) +cdef object CustomTypedefFields_from_cpp(const shared_ptr[_fbthrift_cbindings.cCustomTypedefFields]& c_struct): + return cpp_to_python[_fbthrift_cbindings.cCustomTypedefFields](deref(c_struct)) + +cdef shared_ptr[_fbthrift_cbindings.cAdaptedTypedefFields] AdaptedTypedefFields_convert_to_cpp(object inst) except*: + return make_shared[_fbthrift_cbindings.cAdaptedTypedefFields](python_to_cpp[_fbthrift_cbindings.cAdaptedTypedefFields](inst)) +cdef object AdaptedTypedefFields_from_cpp(const shared_ptr[_fbthrift_cbindings.cAdaptedTypedefFields]& c_struct): + return cpp_to_python[_fbthrift_cbindings.cAdaptedTypedefFields](deref(c_struct)) + + +cdef vector[cint16_t] List__i16__make_instance(object items) except *: + cdef vector[cint16_t] c_inst + if items is None: + return cmove(c_inst) + for item in items: + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + c_inst.push_back(item) + return cmove(c_inst) + +cdef vector[cint32_t] List__i32__make_instance(object items) except *: + cdef vector[cint32_t] c_inst + if items is None: + return cmove(c_inst) + for item in items: + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + c_inst.push_back(item) + return cmove(c_inst) + +cdef vector[cint64_t] List__i64__make_instance(object items) except *: + cdef vector[cint64_t] c_inst + if items is None: + return cmove(c_inst) + for item in items: + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + c_inst.push_back(item) + return cmove(c_inst) + +cdef vector[string] List__string__make_instance(object items) except *: + cdef vector[string] c_inst + if items is None: + return cmove(c_inst) + if isinstance(items, str): + raise TypeError("If you really want to pass a string into a _typing.Sequence[str] field, explicitly convert it first.") + for item in items: + if not isinstance(item, str): + raise TypeError(f"{item!r} is not of type str") + c_inst.push_back(item.encode('UTF-8')) + return cmove(c_inst) + +cdef vector[_module_cbindings.cSimpleStruct] List__SimpleStruct__make_instance(object items) except *: + cdef vector[_module_cbindings.cSimpleStruct] c_inst + if items is None: + return cmove(c_inst) + for item in items: + if not isinstance(item, _module_types.SimpleStruct): + raise TypeError(f"{item!r} is not of type _module_types.SimpleStruct") + c_inst.push_back(python_to_cpp[_module_cbindings.cSimpleStruct](item)) + return cmove(c_inst) + +cdef cset[cint32_t] Set__i32__make_instance(object items) except *: + cdef cset[cint32_t] c_inst + if items is None: + return cmove(c_inst) + for item in items: + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + c_inst.insert(item) + return cmove(c_inst) + +cdef cset[string] Set__string__make_instance(object items) except *: + cdef cset[string] c_inst + if items is None: + return cmove(c_inst) + if isinstance(items, str): + raise TypeError("If you really want to pass a string into a _typing.AbstractSet[str] field, explicitly convert it first.") + for item in items: + if not isinstance(item, str): + raise TypeError(f"{item!r} is not of type str") + c_inst.insert(item.encode('UTF-8')) + return cmove(c_inst) + +cdef cmap[string,string] Map__string_string__make_instance(object items) except *: + cdef cmap[string,string] c_inst + if items is None: + return cmove(c_inst) + for key, item in items.items(): + if not isinstance(key, str): + raise TypeError(f"{key!r} is not of type str") + if not isinstance(item, str): + raise TypeError(f"{item!r} is not of type str") + + c_inst[key.encode('UTF-8')] = item.encode('UTF-8') + return cmove(c_inst) + +cdef cmap[string,_module_cbindings.cSimpleStruct] Map__string_SimpleStruct__make_instance(object items) except *: + cdef cmap[string,_module_cbindings.cSimpleStruct] c_inst + if items is None: + return cmove(c_inst) + for key, item in items.items(): + if not isinstance(key, str): + raise TypeError(f"{key!r} is not of type str") + if not isinstance(item, _module_types.SimpleStruct): + raise TypeError(f"{item!r} is not of type _module_types.SimpleStruct") + + c_inst[key.encode('UTF-8')] = python_to_cpp[_module_cbindings.cSimpleStruct](item) + return cmove(c_inst) + +cdef cmap[string,cint16_t] Map__string_i16__make_instance(object items) except *: + cdef cmap[string,cint16_t] c_inst + if items is None: + return cmove(c_inst) + for key, item in items.items(): + if not isinstance(key, str): + raise TypeError(f"{key!r} is not of type str") + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + + c_inst[key.encode('UTF-8')] = item + return cmove(c_inst) + +cdef vector[vector[cint32_t]] List__List__i32__make_instance(object items) except *: + cdef vector[vector[cint32_t]] c_inst + if items is None: + return cmove(c_inst) + for item in items: + if item is None: + raise TypeError("None is not of the type _typing.Sequence[int]") + if not isinstance(item, _module_types.List__i32): + item = _module_types.List__i32(item) + c_inst.push_back(List__i32__make_instance(item)) + return cmove(c_inst) + +cdef cmap[string,cint32_t] Map__string_i32__make_instance(object items) except *: + cdef cmap[string,cint32_t] c_inst + if items is None: + return cmove(c_inst) + for key, item in items.items(): + if not isinstance(key, str): + raise TypeError(f"{key!r} is not of type str") + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + + c_inst[key.encode('UTF-8')] = item + return cmove(c_inst) + +cdef cmap[string,cmap[string,cint32_t]] Map__string_Map__string_i32__make_instance(object items) except *: + cdef cmap[string,cmap[string,cint32_t]] c_inst + if items is None: + return cmove(c_inst) + for key, item in items.items(): + if not isinstance(key, str): + raise TypeError(f"{key!r} is not of type str") + if item is None: + raise TypeError("None is not of type _typing.Mapping[str, int]") + if not isinstance(item, _module_types.Map__string_i32): + item = _module_types.Map__string_i32(item) + + c_inst[key.encode('UTF-8')] = Map__string_i32__make_instance(item) + return cmove(c_inst) + +cdef vector[cset[string]] List__Set__string__make_instance(object items) except *: + cdef vector[cset[string]] c_inst + if items is None: + return cmove(c_inst) + for item in items: + if item is None: + raise TypeError("None is not of the type _typing.AbstractSet[str]") + if not isinstance(item, _module_types.Set__string): + item = _module_types.Set__string(item) + c_inst.push_back(Set__string__make_instance(item)) + return cmove(c_inst) + +cdef cmap[string,vector[_module_cbindings.cSimpleStruct]] Map__string_List__SimpleStruct__make_instance(object items) except *: + cdef cmap[string,vector[_module_cbindings.cSimpleStruct]] c_inst + if items is None: + return cmove(c_inst) + for key, item in items.items(): + if not isinstance(key, str): + raise TypeError(f"{key!r} is not of type str") + if item is None: + raise TypeError("None is not of type _typing.Sequence[_module_types.SimpleStruct]") + if not isinstance(item, _module_types.List__SimpleStruct): + item = _module_types.List__SimpleStruct(item) + + c_inst[key.encode('UTF-8')] = List__SimpleStruct__make_instance(item) + return cmove(c_inst) + +cdef vector[vector[string]] List__List__string__make_instance(object items) except *: + cdef vector[vector[string]] c_inst + if items is None: + return cmove(c_inst) + for item in items: + if item is None: + raise TypeError("None is not of the type _typing.Sequence[str]") + if not isinstance(item, _module_types.List__string): + item = _module_types.List__string(item) + c_inst.push_back(List__string__make_instance(item)) + return cmove(c_inst) + +cdef vector[cset[cint32_t]] List__Set__i32__make_instance(object items) except *: + cdef vector[cset[cint32_t]] c_inst + if items is None: + return cmove(c_inst) + for item in items: + if item is None: + raise TypeError("None is not of the type _typing.AbstractSet[int]") + if not isinstance(item, _module_types.Set__i32): + item = _module_types.Set__i32(item) + c_inst.push_back(Set__i32__make_instance(item)) + return cmove(c_inst) + +cdef vector[cmap[string,string]] List__Map__string_string__make_instance(object items) except *: + cdef vector[cmap[string,string]] c_inst + if items is None: + return cmove(c_inst) + for item in items: + if item is None: + raise TypeError("None is not of the type _typing.Mapping[str, str]") + if not isinstance(item, _module_types.Map__string_string): + item = _module_types.Map__string_string(item) + c_inst.push_back(Map__string_string__make_instance(item)) + return cmove(c_inst) + +cdef vector[string] List__binary__make_instance(object items) except *: + cdef vector[string] c_inst + if items is None: + return cmove(c_inst) + if isinstance(items, str): + raise TypeError("If you really want to pass a string into a _typing.Sequence[bytes] field, explicitly convert it first.") + for item in items: + if not isinstance(item, bytes): + raise TypeError(f"{item!r} is not of type bytes") + c_inst.push_back(item) + return cmove(c_inst) + +cdef cset[string] Set__binary__make_instance(object items) except *: + cdef cset[string] c_inst + if items is None: + return cmove(c_inst) + if isinstance(items, str): + raise TypeError("If you really want to pass a string into a _typing.AbstractSet[bytes] field, explicitly convert it first.") + for item in items: + if not isinstance(item, bytes): + raise TypeError(f"{item!r} is not of type bytes") + c_inst.insert(item) + return cmove(c_inst) + +cdef vector[_module_cbindings.cAnEnum] List__AnEnum__make_instance(object items) except *: + cdef vector[_module_cbindings.cAnEnum] c_inst + if items is None: + return cmove(c_inst) + for item in items: + if not isinstance(item, _module_types.AnEnum): + raise TypeError(f"{item!r} is not of type _module_types.AnEnum") + c_inst.push_back(<_module_cbindings.cAnEnum>item) + return cmove(c_inst) + +cdef _module_cbindings._std_unordered_map[cint32_t,cint32_t] _std_unordered_map__Map__i32_i32__make_instance(object items) except *: + cdef _module_cbindings._std_unordered_map[cint32_t,cint32_t] c_inst + if items is None: + return cmove(c_inst) + for key, item in items.items(): + if not isinstance(key, int): + raise TypeError(f"{key!r} is not of type int") + key = key + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + + c_inst[key] = item + return cmove(c_inst) + +cdef _module_cbindings._MyType _MyType__List__i32__make_instance(object items) except *: + cdef _module_cbindings._MyType c_inst + if items is None: + return cmove(c_inst) + for item in items: + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + c_inst.push_back(item) + return cmove(c_inst) + +cdef _module_cbindings._MyType _MyType__Set__i32__make_instance(object items) except *: + cdef _module_cbindings._MyType c_inst + if items is None: + return cmove(c_inst) + for item in items: + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + c_inst.insert(item) + return cmove(c_inst) + +cdef _module_cbindings._MyType _MyType__Map__i32_i32__make_instance(object items) except *: + cdef _module_cbindings._MyType c_inst + if items is None: + return cmove(c_inst) + for key, item in items.items(): + if not isinstance(key, int): + raise TypeError(f"{key!r} is not of type int") + key = key + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + + c_inst[key] = item + return cmove(c_inst) + +cdef _module_cbindings._py3_simple_AdaptedList _py3_simple_AdaptedList__List__i32__make_instance(object items) except *: + cdef _module_cbindings._py3_simple_AdaptedList c_inst + if items is None: + return cmove(c_inst) + for item in items: + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + c_inst.push_back(item) + return cmove(c_inst) + +cdef _module_cbindings._py3_simple_AdaptedSet _py3_simple_AdaptedSet__Set__i32__make_instance(object items) except *: + cdef _module_cbindings._py3_simple_AdaptedSet c_inst + if items is None: + return cmove(c_inst) + for item in items: + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + c_inst.insert(item) + return cmove(c_inst) + +cdef _module_cbindings._py3_simple_AdaptedMap _py3_simple_AdaptedMap__Map__i32_i32__make_instance(object items) except *: + cdef _module_cbindings._py3_simple_AdaptedMap c_inst + if items is None: + return cmove(c_inst) + for key, item in items.items(): + if not isinstance(key, int): + raise TypeError(f"{key!r} is not of type int") + key = key + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + + c_inst[key] = item + return cmove(c_inst) + +cdef cmap[cint32_t,double] Map__i32_double__make_instance(object items) except *: + cdef cmap[cint32_t,double] c_inst + if items is None: + return cmove(c_inst) + for key, item in items.items(): + if not isinstance(key, int): + raise TypeError(f"{key!r} is not of type int") + key = key + if not isinstance(item, (float, int)): + raise TypeError(f"{item!r} is not of type float") + + c_inst[key] = item + return cmove(c_inst) + +cdef vector[cmap[cint32_t,double]] List__Map__i32_double__make_instance(object items) except *: + cdef vector[cmap[cint32_t,double]] c_inst + if items is None: + return cmove(c_inst) + for item in items: + if item is None: + raise TypeError("None is not of the type _typing.Mapping[int, float]") + if not isinstance(item, _module_types.Map__i32_double): + item = _module_types.Map__i32_double(item) + c_inst.push_back(Map__i32_double__make_instance(item)) + return cmove(c_inst) + +cdef cmap[_module_cbindings.cAnEnumRenamed,cint32_t] Map__AnEnumRenamed_i32__make_instance(object items) except *: + cdef cmap[_module_cbindings.cAnEnumRenamed,cint32_t] c_inst + if items is None: + return cmove(c_inst) + for key, item in items.items(): + if not isinstance(key, _module_types.AnEnumRenamed): + raise TypeError(f"{key!r} is not of type _module_types.AnEnumRenamed") + if not isinstance(item, int): + raise TypeError(f"{item!r} is not of type int") + item = item + + c_inst[<_module_cbindings.cAnEnumRenamed>key] = item + return cmove(c_inst) + diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.cpp b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.cpp new file mode 100644 index 00000000000000..118f3bfa242a68 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.cpp @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.h b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.h new file mode 100644 index 00000000000000..118f3bfa242a68 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.h @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.pxd new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.pxd @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.py b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.py new file mode 100644 index 00000000000000..fc01cacd08e4a1 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.py @@ -0,0 +1,7 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# +from module.thrift_metadata import * diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.pyi b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.pyi new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.pyi @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.pyx new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/metadata.pyx @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.pxd new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.pxd @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.py b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.py new file mode 100644 index 00000000000000..eeda9c07376e4b --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.py @@ -0,0 +1,7 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# +from module.thrift_services import * diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.pyi b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.pyi new file mode 100644 index 00000000000000..f068a43764c594 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.pyi @@ -0,0 +1,342 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# + +import folly.iobuf as _fbthrift_iobuf +import typing as _typing +from thrift.py3.server import RequestContext, ServiceInterface +from abc import abstractmethod, ABCMeta + +import module.types as _module_types + +_SimpleServiceInterfaceT = _typing.TypeVar('_SimpleServiceInterfaceT', bound='SimpleServiceInterface') + + +class SimpleServiceInterface( + ServiceInterface, + metaclass=ABCMeta, +): + + + @abstractmethod + async def get_five( + self + ) -> int: ... + + + @abstractmethod + async def add_five( + self, + num: int + ) -> int: ... + + + @abstractmethod + async def do_nothing( + self + ) -> None: ... + + + @abstractmethod + async def concat( + self, + first: str, + second: str + ) -> str: ... + + + @abstractmethod + async def get_value( + self, + simple_struct: _module_types.SimpleStruct + ) -> int: ... + + + @abstractmethod + async def negate( + self, + input: bool + ) -> bool: ... + + + @abstractmethod + async def tiny( + self, + input: int + ) -> int: ... + + + @abstractmethod + async def small( + self, + input: int + ) -> int: ... + + + @abstractmethod + async def big( + self, + input: int + ) -> int: ... + + + @abstractmethod + async def two( + self, + input: float + ) -> float: ... + + + @abstractmethod + async def expected_exception( + self + ) -> None: ... + + + @abstractmethod + async def unexpected_exception( + self + ) -> int: ... + + + @abstractmethod + async def sum_i16_list( + self, + numbers: _typing.Sequence[int] + ) -> int: ... + + + @abstractmethod + async def sum_i32_list( + self, + numbers: _typing.Sequence[int] + ) -> int: ... + + + @abstractmethod + async def sum_i64_list( + self, + numbers: _typing.Sequence[int] + ) -> int: ... + + + @abstractmethod + async def concat_many( + self, + words: _typing.Sequence[str] + ) -> str: ... + + + @abstractmethod + async def count_structs( + self, + items: _typing.Sequence[_module_types.SimpleStruct] + ) -> int: ... + + + @abstractmethod + async def sum_set( + self, + numbers: _typing.AbstractSet[int] + ) -> int: ... + + + @abstractmethod + async def contains_word( + self, + words: _typing.AbstractSet[str], + word: str + ) -> bool: ... + + + @abstractmethod + async def get_map_value( + self, + words: _typing.Mapping[str, str], + key: str + ) -> str: ... + + + @abstractmethod + async def map_length( + self, + items: _typing.Mapping[str, _module_types.SimpleStruct] + ) -> int: ... + + + @abstractmethod + async def sum_map_values( + self, + items: _typing.Mapping[str, int] + ) -> int: ... + + + @abstractmethod + async def complex_sum_i32( + self, + counter: _module_types.ComplexStruct + ) -> int: ... + + + @abstractmethod + async def repeat_name( + self, + counter: _module_types.ComplexStruct + ) -> str: ... + + + @abstractmethod + async def get_struct( + self + ) -> _module_types.SimpleStruct: ... + + + @abstractmethod + async def fib( + self, + n: int + ) -> _typing.Sequence[int]: ... + + + @abstractmethod + async def unique_words( + self, + words: _typing.Sequence[str] + ) -> _typing.AbstractSet[str]: ... + + + @abstractmethod + async def words_count( + self, + words: _typing.Sequence[str] + ) -> _typing.Mapping[str, int]: ... + + + @abstractmethod + async def set_enum( + self, + in_enum: _module_types.AnEnum + ) -> _module_types.AnEnum: ... + + + @abstractmethod + async def list_of_lists( + self, + num_lists: int, + num_items: int + ) -> _typing.Sequence[_typing.Sequence[int]]: ... + + + @abstractmethod + async def word_character_frequency( + self, + sentence: str + ) -> _typing.Mapping[str, _typing.Mapping[str, int]]: ... + + + @abstractmethod + async def list_of_sets( + self, + some_words: str + ) -> _typing.Sequence[_typing.AbstractSet[str]]: ... + + + @abstractmethod + async def nested_map_argument( + self, + struct_map: _typing.Mapping[str, _typing.Sequence[_module_types.SimpleStruct]] + ) -> int: ... + + + @abstractmethod + async def make_sentence( + self, + word_chars: _typing.Sequence[_typing.Sequence[str]] + ) -> str: ... + + + @abstractmethod + async def get_union( + self, + sets: _typing.Sequence[_typing.AbstractSet[int]] + ) -> _typing.AbstractSet[int]: ... + + + @abstractmethod + async def get_keys( + self, + string_map: _typing.Sequence[_typing.Mapping[str, str]] + ) -> _typing.AbstractSet[str]: ... + + + @abstractmethod + async def lookup_double( + self, + key: int + ) -> float: ... + + + @abstractmethod + async def retrieve_binary( + self, + something: bytes + ) -> bytes: ... + + + @abstractmethod + async def contain_binary( + self, + binaries: _typing.Sequence[bytes] + ) -> _typing.AbstractSet[bytes]: ... + + + @abstractmethod + async def contain_enum( + self, + the_enum: _typing.Sequence[_module_types.AnEnum] + ) -> _typing.Sequence[_module_types.AnEnum]: ... + + + @abstractmethod + async def get_binary_union_struct( + self, + u: _module_types.BinaryUnion + ) -> _module_types.BinaryUnionStruct: ... + pass + + +_DerivedServiceInterfaceT = _typing.TypeVar('_DerivedServiceInterfaceT', bound='DerivedServiceInterface') + + +class DerivedServiceInterface( +SimpleServiceInterface, + metaclass=ABCMeta, +): + + + @abstractmethod + async def get_six( + self + ) -> int: ... + pass + + +_RederivedServiceInterfaceT = _typing.TypeVar('_RederivedServiceInterfaceT', bound='RederivedServiceInterface') + + +class RederivedServiceInterface( +DerivedServiceInterface, + metaclass=ABCMeta, +): + + + @abstractmethod + async def get_seven( + self + ) -> int: ... + pass + + diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.pyx new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services.pyx @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_interface.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_interface.pxd new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_interface.pxd @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_wrapper.cpp b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_wrapper.cpp new file mode 100644 index 00000000000000..118f3bfa242a68 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_wrapper.cpp @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_wrapper.h b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_wrapper.h new file mode 100644 index 00000000000000..118f3bfa242a68 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_wrapper.h @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_wrapper.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_wrapper.pxd new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/services_wrapper.pxd @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.h b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.h new file mode 100644 index 00000000000000..118f3bfa242a68 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.h @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.pxd new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.pxd @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.py b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.py new file mode 100644 index 00000000000000..a51e0c52710bf9 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.py @@ -0,0 +1,640 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# +from module.thrift_types import * +import thrift.python.types as _fbthrift_python_types +import module.thrift_types as _module_thrift_types +class List__i16__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_i16, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__i16(_fbthrift_python_types.List, metaclass=List__i16__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__i16._fbthrift_type_info(), + *args, + **kwargs, + ) + +class List__i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_i32, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__i32(_fbthrift_python_types.List, metaclass=List__i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class List__i64__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_i64, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__i64(_fbthrift_python_types.List, metaclass=List__i64__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__i64._fbthrift_type_info(), + *args, + **kwargs, + ) + +class List__string__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_string, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__string(_fbthrift_python_types.List, metaclass=List__string__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__string._fbthrift_type_info(), + *args, + **kwargs, + ) + +class List__SimpleStruct__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.StructTypeInfo(_module_thrift_types.SimpleStruct), + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__SimpleStruct(_fbthrift_python_types.List, metaclass=List__SimpleStruct__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__SimpleStruct._fbthrift_type_info(), + *args, + **kwargs, + ) + +class Set__i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_i32, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Set) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class Set__i32(_fbthrift_python_types.Set, metaclass=Set__i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *Set__i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class Set__string__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_string, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Set) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class Set__string(_fbthrift_python_types.Set, metaclass=Set__string__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *Set__string._fbthrift_type_info(), + *args, + **kwargs, + ) + +class Map__string_string__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_string, + _fbthrift_python_types.typeinfo_string, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Map) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class Map__string_string(_fbthrift_python_types.Map, metaclass=Map__string_string__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *Map__string_string._fbthrift_type_info(), + *args, + **kwargs, + ) + +class Map__string_SimpleStruct__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_string, + _fbthrift_python_types.StructTypeInfo(_module_thrift_types.SimpleStruct), + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Map) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class Map__string_SimpleStruct(_fbthrift_python_types.Map, metaclass=Map__string_SimpleStruct__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *Map__string_SimpleStruct._fbthrift_type_info(), + *args, + **kwargs, + ) + +class Map__string_i16__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_string, + _fbthrift_python_types.typeinfo_i16, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Map) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class Map__string_i16(_fbthrift_python_types.Map, metaclass=Map__string_i16__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *Map__string_i16._fbthrift_type_info(), + *args, + **kwargs, + ) + +class List__List__i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.ListTypeInfo(_fbthrift_python_types.typeinfo_i32), + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__List__i32(_fbthrift_python_types.List, metaclass=List__List__i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__List__i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class Map__string_i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_string, + _fbthrift_python_types.typeinfo_i32, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Map) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class Map__string_i32(_fbthrift_python_types.Map, metaclass=Map__string_i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *Map__string_i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class Map__string_Map__string_i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_string, + _fbthrift_python_types.MapTypeInfo(_fbthrift_python_types.typeinfo_string, _fbthrift_python_types.typeinfo_i32), + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Map) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class Map__string_Map__string_i32(_fbthrift_python_types.Map, metaclass=Map__string_Map__string_i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *Map__string_Map__string_i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class List__Set__string__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.SetTypeInfo(_fbthrift_python_types.typeinfo_string), + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__Set__string(_fbthrift_python_types.List, metaclass=List__Set__string__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__Set__string._fbthrift_type_info(), + *args, + **kwargs, + ) + +class Map__string_List__SimpleStruct__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_string, + _fbthrift_python_types.ListTypeInfo(_fbthrift_python_types.StructTypeInfo(_module_thrift_types.SimpleStruct)), + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Map) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class Map__string_List__SimpleStruct(_fbthrift_python_types.Map, metaclass=Map__string_List__SimpleStruct__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *Map__string_List__SimpleStruct._fbthrift_type_info(), + *args, + **kwargs, + ) + +class List__List__string__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.ListTypeInfo(_fbthrift_python_types.typeinfo_string), + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__List__string(_fbthrift_python_types.List, metaclass=List__List__string__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__List__string._fbthrift_type_info(), + *args, + **kwargs, + ) + +class List__Set__i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.SetTypeInfo(_fbthrift_python_types.typeinfo_i32), + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__Set__i32(_fbthrift_python_types.List, metaclass=List__Set__i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__Set__i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class List__Map__string_string__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.MapTypeInfo(_fbthrift_python_types.typeinfo_string, _fbthrift_python_types.typeinfo_string), + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__Map__string_string(_fbthrift_python_types.List, metaclass=List__Map__string_string__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__Map__string_string._fbthrift_type_info(), + *args, + **kwargs, + ) + +class List__binary__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_binary, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__binary(_fbthrift_python_types.List, metaclass=List__binary__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__binary._fbthrift_type_info(), + *args, + **kwargs, + ) + +class Set__binary__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_binary, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Set) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class Set__binary(_fbthrift_python_types.Set, metaclass=Set__binary__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *Set__binary._fbthrift_type_info(), + *args, + **kwargs, + ) + +class List__AnEnum__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.EnumTypeInfo(_module_thrift_types.AnEnum), + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__AnEnum(_fbthrift_python_types.List, metaclass=List__AnEnum__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__AnEnum._fbthrift_type_info(), + *args, + **kwargs, + ) + +class _std_unordered_map__Map__i32_i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_i32, + _fbthrift_python_types.typeinfo_i32, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Map) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class _std_unordered_map__Map__i32_i32(_fbthrift_python_types.Map, metaclass=_std_unordered_map__Map__i32_i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *_std_unordered_map__Map__i32_i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class _MyType__List__i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_i32, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class _MyType__List__i32(_fbthrift_python_types.List, metaclass=_MyType__List__i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *_MyType__List__i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class _MyType__Set__i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_i32, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Set) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class _MyType__Set__i32(_fbthrift_python_types.Set, metaclass=_MyType__Set__i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *_MyType__Set__i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class _MyType__Map__i32_i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_i32, + _fbthrift_python_types.typeinfo_i32, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Map) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class _MyType__Map__i32_i32(_fbthrift_python_types.Map, metaclass=_MyType__Map__i32_i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *_MyType__Map__i32_i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class _py3_simple_AdaptedList__List__i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_i32, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class _py3_simple_AdaptedList__List__i32(_fbthrift_python_types.List, metaclass=_py3_simple_AdaptedList__List__i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *_py3_simple_AdaptedList__List__i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class _py3_simple_AdaptedSet__Set__i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_i32, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Set) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class _py3_simple_AdaptedSet__Set__i32(_fbthrift_python_types.Set, metaclass=_py3_simple_AdaptedSet__Set__i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *_py3_simple_AdaptedSet__Set__i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class _py3_simple_AdaptedMap__Map__i32_i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_i32, + _fbthrift_python_types.typeinfo_i32, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Map) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class _py3_simple_AdaptedMap__Map__i32_i32(_fbthrift_python_types.Map, metaclass=_py3_simple_AdaptedMap__Map__i32_i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *_py3_simple_AdaptedMap__Map__i32_i32._fbthrift_type_info(), + *args, + **kwargs, + ) + +class Map__i32_double__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.typeinfo_i32, + _fbthrift_python_types.typeinfo_double, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Map) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class Map__i32_double(_fbthrift_python_types.Map, metaclass=Map__i32_double__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *Map__i32_double._fbthrift_type_info(), + *args, + **kwargs, + ) + +class List__Map__i32_double__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.MapTypeInfo(_fbthrift_python_types.typeinfo_i32, _fbthrift_python_types.typeinfo_double), + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.List) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class List__Map__i32_double(_fbthrift_python_types.List, metaclass=List__Map__i32_double__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *List__Map__i32_double._fbthrift_type_info(), + *args, + **kwargs, + ) + +class Map__AnEnumRenamed_i32__Meta(type): + def _fbthrift_type_info(cls): + return ( + _fbthrift_python_types.EnumTypeInfo(_module_thrift_types.AnEnumRenamed), + _fbthrift_python_types.typeinfo_i32, + ) + + def __instancecheck__(cls, instance): + return ( + isinstance(instance, _fbthrift_python_types.Map) and + instance._fbthrift_same_type(*cls._fbthrift_type_info()) + ) + +class Map__AnEnumRenamed_i32(_fbthrift_python_types.Map, metaclass=Map__AnEnumRenamed_i32__Meta): + def __init__(self, *args, **kwargs): + super().__init__( + *Map__AnEnumRenamed_i32._fbthrift_type_info(), + *args, + **kwargs, + ) + diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.pyi b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.pyi new file mode 100644 index 00000000000000..8bf8def49455e7 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.pyi @@ -0,0 +1,964 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# + +import enum as _python_std_enum +import folly.iobuf as _fbthrift_iobuf +import thrift.py3.types +import thrift.python.types +import thrift.py3.exceptions +import typing as _typing + +import sys +import itertools + + +class AnEnum(thrift.python.types.Enum): + NOTSET: AnEnum = ... + ONE: AnEnum = ... + TWO: AnEnum = ... + THREE: AnEnum = ... + FOUR: AnEnum = ... + def _to_python(self) -> "module.thrift_types.AnEnum": ... # type: ignore + def _to_py3(self) -> AnEnum: ... + def _to_py_deprecated(self) -> int: ... + def __int__(self) -> int: ... + def __index__(self) -> int: ... + + +class AnEnumRenamed(thrift.python.types.Enum): + name_: AnEnumRenamed = ... + value_: AnEnumRenamed = ... + renamed_: AnEnumRenamed = ... + def _to_python(self) -> "module.thrift_types.AnEnumRenamed": ... # type: ignore + def _to_py3(self) -> AnEnumRenamed: ... + def _to_py_deprecated(self) -> int: ... + def __int__(self) -> int: ... + def __index__(self) -> int: ... + + +class Flags(thrift.python.types.Flag): + flag_A: Flags = ... + flag_B: Flags = ... + flag_C: Flags = ... + flag_D: Flags = ... + def _to_python(self) -> "module.thrift_types.Flags": ... # type: ignore + def _to_py3(self) -> Flags: ... + def _to_py_deprecated(self) -> int: ... + def __int__(self) -> int: ... + def __index__(self) -> int: ... + + +class SimpleException(thrift.py3.exceptions.GeneratedError, _typing.Hashable): + class __fbthrift_IsSet: + err_code: bool + pass + + err_code: _typing.Final[int] = ... + + def __init__( + self, *, + err_code: _typing.Optional[int]=None + ) -> None: ... + + def __hash__(self) -> int: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __lt__(self, other: 'SimpleException') -> bool: ... + def __gt__(self, other: 'SimpleException') -> bool: ... + def __le__(self, other: 'SimpleException') -> bool: ... + def __ge__(self, other: 'SimpleException') -> bool: ... + + def _to_python(self) -> "module.thrift_types.SimpleException": ... # type: ignore + def _to_py3(self) -> SimpleException: ... + def _to_py_deprecated(self) -> "module.ttypes.SimpleException": ... # type: ignore + +class OptionalRefStruct(thrift.py3.types.Struct, _typing.Hashable): + class __fbthrift_IsSet: + optional_blob: bool + pass + + optional_blob: _typing.Final[_typing.Optional[_fbthrift_iobuf.IOBuf]] = ... + + def __init__( + self, *, + optional_blob: _typing.Optional[_fbthrift_iobuf.IOBuf]=None + ) -> None: ... + + def __call__( + self, *, + optional_blob: _typing.Union[_fbthrift_iobuf.IOBuf, None]=None + ) -> OptionalRefStruct: ... + + def __reduce__(self) -> _typing.Tuple[_typing.Callable, _typing.Tuple[_typing.Type['OptionalRefStruct'], bytes]]: ... + def __hash__(self) -> int: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __lt__(self, other: 'OptionalRefStruct') -> bool: ... + def __gt__(self, other: 'OptionalRefStruct') -> bool: ... + def __le__(self, other: 'OptionalRefStruct') -> bool: ... + def __ge__(self, other: 'OptionalRefStruct') -> bool: ... + + def _to_python(self) -> "module.thrift_types.OptionalRefStruct": ... # type: ignore + def _to_py3(self) -> OptionalRefStruct: ... + def _to_py_deprecated(self) -> "module.ttypes.OptionalRefStruct": ... # type: ignore + +class SimpleStruct(thrift.py3.types.Struct, _typing.Hashable): + class __fbthrift_IsSet: + is_on: bool + tiny_int: bool + small_int: bool + nice_sized_int: bool + big_int: bool + real: bool + smaller_real: bool + something: bool + pass + + is_on: _typing.Final[bool] = ... + tiny_int: _typing.Final[int] = ... + small_int: _typing.Final[int] = ... + nice_sized_int: _typing.Final[int] = ... + big_int: _typing.Final[int] = ... + real: _typing.Final[float] = ... + smaller_real: _typing.Final[float] = ... + something: _typing.Final[_typing.Mapping[int, int]] = ... + + def __init__( + self, *, + is_on: _typing.Optional[bool]=None, + tiny_int: _typing.Optional[int]=None, + small_int: _typing.Optional[int]=None, + nice_sized_int: _typing.Optional[int]=None, + big_int: _typing.Optional[int]=None, + real: _typing.Optional[float]=None, + smaller_real: _typing.Optional[float]=None, + something: _typing.Optional[_typing.Mapping[int, int]]=None + ) -> None: ... + + def __call__( + self, *, + is_on: _typing.Union[bool, None]=None, + tiny_int: _typing.Union[int, None]=None, + small_int: _typing.Union[int, None]=None, + nice_sized_int: _typing.Union[int, None]=None, + big_int: _typing.Union[int, None]=None, + real: _typing.Union[float, None]=None, + smaller_real: _typing.Union[float, None]=None, + something: _typing.Union[_typing.Mapping[int, int], None]=None + ) -> SimpleStruct: ... + + def __reduce__(self) -> _typing.Tuple[_typing.Callable, _typing.Tuple[_typing.Type['SimpleStruct'], bytes]]: ... + def __hash__(self) -> int: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + + def _to_python(self) -> "module.thrift_types.SimpleStruct": ... # type: ignore + def _to_py3(self) -> SimpleStruct: ... + def _to_py_deprecated(self) -> "module.ttypes.SimpleStruct": ... # type: ignore + +class HiddenTypeFieldsStruct(thrift.py3.types.Struct, _typing.Hashable): + class __fbthrift_IsSet: + pass + + + def __init__( + self, + ) -> None: ... + + def __call__( + self, + ) -> HiddenTypeFieldsStruct: ... + + def __reduce__(self) -> _typing.Tuple[_typing.Callable, _typing.Tuple[_typing.Type['HiddenTypeFieldsStruct'], bytes]]: ... + def __hash__(self) -> int: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + + def _to_python(self) -> "module.thrift_types.HiddenTypeFieldsStruct": ... # type: ignore + def _to_py3(self) -> HiddenTypeFieldsStruct: ... + def _to_py_deprecated(self) -> "module.ttypes.HiddenTypeFieldsStruct": ... # type: ignore + +class ComplexStruct(thrift.py3.types.Struct, _typing.Hashable): + class __fbthrift_IsSet: + structOne: bool + structTwo: bool + an_integer: bool + name: bool + an_enum: bool + some_bytes: bool + sender: bool + cdef_: bool + bytes_with_cpp_type: bool + pass + + structOne: _typing.Final[SimpleStruct] = ... + structTwo: _typing.Final[SimpleStruct] = ... + an_integer: _typing.Final[int] = ... + name: _typing.Final[str] = ... + an_enum: _typing.Final[AnEnum] = ... + some_bytes: _typing.Final[bytes] = ... + sender: _typing.Final[str] = ... + cdef_: _typing.Final[str] = ... + bytes_with_cpp_type: _typing.Final[bytes] = ... + + def __init__( + self, *, + structOne: _typing.Optional[SimpleStruct]=None, + structTwo: _typing.Optional[SimpleStruct]=None, + an_integer: _typing.Optional[int]=None, + name: _typing.Optional[str]=None, + an_enum: _typing.Optional[AnEnum]=None, + some_bytes: _typing.Optional[bytes]=None, + sender: _typing.Optional[str]=None, + cdef_: _typing.Optional[str]=None, + bytes_with_cpp_type: _typing.Optional[bytes]=None + ) -> None: ... + + def __call__( + self, *, + structOne: _typing.Union[SimpleStruct, None]=None, + structTwo: _typing.Union[SimpleStruct, None]=None, + an_integer: _typing.Union[int, None]=None, + name: _typing.Union[str, None]=None, + an_enum: _typing.Union[AnEnum, None]=None, + some_bytes: _typing.Union[bytes, None]=None, + sender: _typing.Union[str, None]=None, + cdef_: _typing.Union[str, None]=None, + bytes_with_cpp_type: _typing.Union[bytes, None]=None + ) -> ComplexStruct: ... + + def __reduce__(self) -> _typing.Tuple[_typing.Callable, _typing.Tuple[_typing.Type['ComplexStruct'], bytes]]: ... + def __hash__(self) -> int: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + + def _to_python(self) -> "module.thrift_types.ComplexStruct": ... # type: ignore + def _to_py3(self) -> ComplexStruct: ... + def _to_py_deprecated(self) -> "module.ttypes.ComplexStruct": ... # type: ignore + +_BinaryUnionValueType = _typing.Union[None, _fbthrift_iobuf.IOBuf] + +class BinaryUnion(thrift.py3.types.Union, _typing.Hashable): + class __fbthrift_IsSet: + iobuf_val: bool + pass + + iobuf_val: _typing.Final[_fbthrift_iobuf.IOBuf] = ... + + def __init__( + self, *, + iobuf_val: _typing.Optional[_fbthrift_iobuf.IOBuf]=None + ) -> None: ... + + def __hash__(self) -> int: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __lt__(self, other: 'BinaryUnion') -> bool: ... + def __gt__(self, other: 'BinaryUnion') -> bool: ... + def __le__(self, other: 'BinaryUnion') -> bool: ... + def __ge__(self, other: 'BinaryUnion') -> bool: ... + + class Type(_python_std_enum.Enum): + EMPTY: BinaryUnion.Type = ... + iobuf_val: BinaryUnion.Type = ... + + @staticmethod + def fromValue(value: _BinaryUnionValueType) -> BinaryUnion: ... + type: _typing.Final[BinaryUnion.Type] + value: _typing.Final[_BinaryUnionValueType] + def get_type(self) -> BinaryUnion.Type: ... + + def _to_python(self) -> "module.thrift_types.BinaryUnion": ... # type: ignore + def _to_py3(self) -> BinaryUnion: ... + def _to_py_deprecated(self) -> "module.ttypes.BinaryUnion": ... # type: ignore + +class BinaryUnionStruct(thrift.py3.types.Struct, _typing.Hashable): + class __fbthrift_IsSet: + u: bool + pass + + u: _typing.Final[BinaryUnion] = ... + + def __init__( + self, *, + u: _typing.Optional[BinaryUnion]=None + ) -> None: ... + + def __call__( + self, *, + u: _typing.Union[BinaryUnion, None]=None + ) -> BinaryUnionStruct: ... + + def __reduce__(self) -> _typing.Tuple[_typing.Callable, _typing.Tuple[_typing.Type['BinaryUnionStruct'], bytes]]: ... + def __hash__(self) -> int: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __lt__(self, other: 'BinaryUnionStruct') -> bool: ... + def __gt__(self, other: 'BinaryUnionStruct') -> bool: ... + def __le__(self, other: 'BinaryUnionStruct') -> bool: ... + def __ge__(self, other: 'BinaryUnionStruct') -> bool: ... + + def _to_python(self) -> "module.thrift_types.BinaryUnionStruct": ... # type: ignore + def _to_py3(self) -> BinaryUnionStruct: ... + def _to_py_deprecated(self) -> "module.ttypes.BinaryUnionStruct": ... # type: ignore + +class CustomFields(thrift.py3.types.Struct, _typing.Hashable): + class __fbthrift_IsSet: + bool_field: bool + integer_field: bool + double_field: bool + string_field: bool + binary_field: bool + list_field: bool + set_field: bool + map_field: bool + struct_field: bool + pass + + bool_field: _typing.Final[bool] = ... + integer_field: _typing.Final[int] = ... + double_field: _typing.Final[float] = ... + string_field: _typing.Final[str] = ... + binary_field: _typing.Final[bytes] = ... + list_field: _typing.Final[_typing.Sequence[int]] = ... + set_field: _typing.Final[_typing.AbstractSet[int]] = ... + map_field: _typing.Final[_typing.Mapping[int, int]] = ... + struct_field: _typing.Final[SimpleStruct] = ... + + def __init__( + self, *, + bool_field: _typing.Optional[bool]=None, + integer_field: _typing.Optional[int]=None, + double_field: _typing.Optional[float]=None, + string_field: _typing.Optional[str]=None, + binary_field: _typing.Optional[bytes]=None, + list_field: _typing.Optional[_typing.Sequence[int]]=None, + set_field: _typing.Optional[_typing.AbstractSet[int]]=None, + map_field: _typing.Optional[_typing.Mapping[int, int]]=None, + struct_field: _typing.Optional[SimpleStruct]=None + ) -> None: ... + + def __call__( + self, *, + bool_field: _typing.Union[bool, None]=None, + integer_field: _typing.Union[int, None]=None, + double_field: _typing.Union[float, None]=None, + string_field: _typing.Union[str, None]=None, + binary_field: _typing.Union[bytes, None]=None, + list_field: _typing.Union[_typing.Sequence[int], None]=None, + set_field: _typing.Union[_typing.AbstractSet[int], None]=None, + map_field: _typing.Union[_typing.Mapping[int, int], None]=None, + struct_field: _typing.Union[SimpleStruct, None]=None + ) -> CustomFields: ... + + def __reduce__(self) -> _typing.Tuple[_typing.Callable, _typing.Tuple[_typing.Type['CustomFields'], bytes]]: ... + def __hash__(self) -> int: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + + def _to_python(self) -> "module.thrift_types.CustomFields": ... # type: ignore + def _to_py3(self) -> CustomFields: ... + def _to_py_deprecated(self) -> "module.ttypes.CustomFields": ... # type: ignore + +class CustomTypedefFields(thrift.py3.types.Struct, _typing.Hashable): + class __fbthrift_IsSet: + bool_field: bool + integer_field: bool + double_field: bool + string_field: bool + binary_field: bool + list_field: bool + set_field: bool + map_field: bool + struct_field: bool + pass + + bool_field: _typing.Final[bool] = ... + integer_field: _typing.Final[int] = ... + double_field: _typing.Final[float] = ... + string_field: _typing.Final[str] = ... + binary_field: _typing.Final[bytes] = ... + list_field: _typing.Final[_typing.Sequence[int]] = ... + set_field: _typing.Final[_typing.AbstractSet[int]] = ... + map_field: _typing.Final[_typing.Mapping[int, int]] = ... + struct_field: _typing.Final[SimpleStruct] = ... + + def __init__( + self, *, + bool_field: _typing.Optional[bool]=None, + integer_field: _typing.Optional[int]=None, + double_field: _typing.Optional[float]=None, + string_field: _typing.Optional[str]=None, + binary_field: _typing.Optional[bytes]=None, + list_field: _typing.Optional[_typing.Sequence[int]]=None, + set_field: _typing.Optional[_typing.AbstractSet[int]]=None, + map_field: _typing.Optional[_typing.Mapping[int, int]]=None, + struct_field: _typing.Optional[SimpleStruct]=None + ) -> None: ... + + def __call__( + self, *, + bool_field: _typing.Union[bool, None]=None, + integer_field: _typing.Union[int, None]=None, + double_field: _typing.Union[float, None]=None, + string_field: _typing.Union[str, None]=None, + binary_field: _typing.Union[bytes, None]=None, + list_field: _typing.Union[_typing.Sequence[int], None]=None, + set_field: _typing.Union[_typing.AbstractSet[int], None]=None, + map_field: _typing.Union[_typing.Mapping[int, int], None]=None, + struct_field: _typing.Union[SimpleStruct, None]=None + ) -> CustomTypedefFields: ... + + def __reduce__(self) -> _typing.Tuple[_typing.Callable, _typing.Tuple[_typing.Type['CustomTypedefFields'], bytes]]: ... + def __hash__(self) -> int: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + + def _to_python(self) -> "module.thrift_types.CustomTypedefFields": ... # type: ignore + def _to_py3(self) -> CustomTypedefFields: ... + def _to_py_deprecated(self) -> "module.ttypes.CustomTypedefFields": ... # type: ignore + +class AdaptedTypedefFields(thrift.py3.types.Struct, _typing.Hashable): + class __fbthrift_IsSet: + bool_field: bool + integer_field: bool + double_field: bool + string_field: bool + binary_field: bool + list_field: bool + set_field: bool + map_field: bool + struct_field: bool + pass + + bool_field: _typing.Final[bool] = ... + integer_field: _typing.Final[int] = ... + double_field: _typing.Final[float] = ... + string_field: _typing.Final[str] = ... + binary_field: _typing.Final[bytes] = ... + list_field: _typing.Final[_typing.Sequence[int]] = ... + set_field: _typing.Final[_typing.AbstractSet[int]] = ... + map_field: _typing.Final[_typing.Mapping[int, int]] = ... + struct_field: _typing.Final[SimpleStruct] = ... + + def __init__( + self, *, + bool_field: _typing.Optional[bool]=None, + integer_field: _typing.Optional[int]=None, + double_field: _typing.Optional[float]=None, + string_field: _typing.Optional[str]=None, + binary_field: _typing.Optional[bytes]=None, + list_field: _typing.Optional[_typing.Sequence[int]]=None, + set_field: _typing.Optional[_typing.AbstractSet[int]]=None, + map_field: _typing.Optional[_typing.Mapping[int, int]]=None, + struct_field: _typing.Optional[SimpleStruct]=None + ) -> None: ... + + def __call__( + self, *, + bool_field: _typing.Union[bool, None]=None, + integer_field: _typing.Union[int, None]=None, + double_field: _typing.Union[float, None]=None, + string_field: _typing.Union[str, None]=None, + binary_field: _typing.Union[bytes, None]=None, + list_field: _typing.Union[_typing.Sequence[int], None]=None, + set_field: _typing.Union[_typing.AbstractSet[int], None]=None, + map_field: _typing.Union[_typing.Mapping[int, int], None]=None, + struct_field: _typing.Union[SimpleStruct, None]=None + ) -> AdaptedTypedefFields: ... + + def __reduce__(self) -> _typing.Tuple[_typing.Callable, _typing.Tuple[_typing.Type['AdaptedTypedefFields'], bytes]]: ... + def __hash__(self) -> int: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + + def _to_python(self) -> "module.thrift_types.AdaptedTypedefFields": ... # type: ignore + def _to_py3(self) -> AdaptedTypedefFields: ... + def _to_py_deprecated(self) -> "module.ttypes.AdaptedTypedefFields": ... # type: ignore + +_List__i16T = _typing.TypeVar('_List__i16T', bound=_typing.Sequence[int]) + + +class List__i16(_typing.Sequence[int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[int]: ... + @_typing.overload + def __getitem__(self, i: int) -> int: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[int]: ... + def __add__(self, other: _typing.Sequence[int]) -> 'List__i16': ... + def __radd__(self, other: _List__i16T) -> _List__i16T: ... + def __reversed__(self) -> _typing.Iterator[int]: ... + def __iter__(self) -> _typing.Iterator[int]: ... + + +_List__i32T = _typing.TypeVar('_List__i32T', bound=_typing.Sequence[int]) + + +class List__i32(_typing.Sequence[int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[int]: ... + @_typing.overload + def __getitem__(self, i: int) -> int: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[int]: ... + def __add__(self, other: _typing.Sequence[int]) -> 'List__i32': ... + def __radd__(self, other: _List__i32T) -> _List__i32T: ... + def __reversed__(self) -> _typing.Iterator[int]: ... + def __iter__(self) -> _typing.Iterator[int]: ... + + +_List__i64T = _typing.TypeVar('_List__i64T', bound=_typing.Sequence[int]) + + +class List__i64(_typing.Sequence[int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[int]: ... + @_typing.overload + def __getitem__(self, i: int) -> int: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[int]: ... + def __add__(self, other: _typing.Sequence[int]) -> 'List__i64': ... + def __radd__(self, other: _List__i64T) -> _List__i64T: ... + def __reversed__(self) -> _typing.Iterator[int]: ... + def __iter__(self) -> _typing.Iterator[int]: ... + + +_List__stringT = _typing.TypeVar('_List__stringT', bound=_typing.Sequence[str]) + + +class List__string(_typing.Sequence[str], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[str]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[str]: ... + @_typing.overload + def __getitem__(self, i: int) -> str: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[str]: ... + def __add__(self, other: _typing.Sequence[str]) -> 'List__string': ... + def __radd__(self, other: _List__stringT) -> _List__stringT: ... + def __reversed__(self) -> _typing.Iterator[str]: ... + def __iter__(self) -> _typing.Iterator[str]: ... + + +_List__SimpleStructT = _typing.TypeVar('_List__SimpleStructT', bound=_typing.Sequence[SimpleStruct]) + + +class List__SimpleStruct(_typing.Sequence[SimpleStruct], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[SimpleStruct]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[SimpleStruct]: ... + @_typing.overload + def __getitem__(self, i: int) -> SimpleStruct: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[SimpleStruct]: ... + def __add__(self, other: _typing.Sequence[SimpleStruct]) -> 'List__SimpleStruct': ... + def __radd__(self, other: _List__SimpleStructT) -> _List__SimpleStructT: ... + def __reversed__(self) -> _typing.Iterator[SimpleStruct]: ... + def __iter__(self) -> _typing.Iterator[SimpleStruct]: ... + + +class Set__i32(_typing.AbstractSet[int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.AbstractSet[int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.AbstractSet[int]: ... + def __contains__(self, x: object) -> bool: ... + def union(self, other: _typing.AbstractSet[int]) -> 'Set__i32': ... + def intersection(self, other: _typing.AbstractSet[int]) -> 'Set__i32': ... + def difference(self, other: _typing.AbstractSet[int]) -> 'Set__i32': ... + def symmetric_difference(self, other: _typing.AbstractSet[int]) -> 'Set__i32': ... + def issubset(self, other: _typing.AbstractSet[int]) -> bool: ... + def issuperset(self, other: _typing.AbstractSet[int]) -> bool: ... + def __iter__(self) -> _typing.Iterator[int]: ... + + +class Set__string(_typing.AbstractSet[str], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.AbstractSet[str]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.AbstractSet[str]: ... + def __contains__(self, x: object) -> bool: ... + def union(self, other: _typing.AbstractSet[str]) -> 'Set__string': ... + def intersection(self, other: _typing.AbstractSet[str]) -> 'Set__string': ... + def difference(self, other: _typing.AbstractSet[str]) -> 'Set__string': ... + def symmetric_difference(self, other: _typing.AbstractSet[str]) -> 'Set__string': ... + def issubset(self, other: _typing.AbstractSet[str]) -> bool: ... + def issuperset(self, other: _typing.AbstractSet[str]) -> bool: ... + def __iter__(self) -> _typing.Iterator[str]: ... + + +class Map__string_string(_typing.Mapping[str, str], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Mapping[str, str]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Mapping[str, str]: ... + def __getitem__(self, key: str) -> str: ... + def __iter__(self) -> _typing.Iterator[str]: ... + + +class Map__string_SimpleStruct(_typing.Mapping[str, SimpleStruct], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Mapping[str, SimpleStruct]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Mapping[str, SimpleStruct]: ... + def __getitem__(self, key: str) -> SimpleStruct: ... + def __iter__(self) -> _typing.Iterator[str]: ... + + +class Map__string_i16(_typing.Mapping[str, int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Mapping[str, int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Mapping[str, int]: ... + def __getitem__(self, key: str) -> int: ... + def __iter__(self) -> _typing.Iterator[str]: ... + + +_List__List__i32T = _typing.TypeVar('_List__List__i32T', bound=_typing.Sequence[_typing.Sequence[int]]) + + +class List__List__i32(_typing.Sequence[_typing.Sequence[int]], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[_typing.Sequence[int]]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[_typing.Sequence[int]]: ... + @_typing.overload + def __getitem__(self, i: int) -> _typing.Sequence[int]: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[_typing.Sequence[int]]: ... + def __add__(self, other: _typing.Sequence[_typing.Sequence[int]]) -> 'List__List__i32': ... + def __radd__(self, other: _List__List__i32T) -> _List__List__i32T: ... + def __reversed__(self) -> _typing.Iterator[_typing.Sequence[int]]: ... + def __iter__(self) -> _typing.Iterator[_typing.Sequence[int]]: ... + + +class Map__string_i32(_typing.Mapping[str, int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Mapping[str, int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Mapping[str, int]: ... + def __getitem__(self, key: str) -> int: ... + def __iter__(self) -> _typing.Iterator[str]: ... + + +class Map__string_Map__string_i32(_typing.Mapping[str, _typing.Mapping[str, int]], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Mapping[str, _typing.Mapping[str, int]]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Mapping[str, _typing.Mapping[str, int]]: ... + def __getitem__(self, key: str) -> _typing.Mapping[str, int]: ... + def __iter__(self) -> _typing.Iterator[str]: ... + + +_List__Set__stringT = _typing.TypeVar('_List__Set__stringT', bound=_typing.Sequence[_typing.AbstractSet[str]]) + + +class List__Set__string(_typing.Sequence[_typing.AbstractSet[str]], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[_typing.AbstractSet[str]]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[_typing.AbstractSet[str]]: ... + @_typing.overload + def __getitem__(self, i: int) -> _typing.AbstractSet[str]: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[_typing.AbstractSet[str]]: ... + def __add__(self, other: _typing.Sequence[_typing.AbstractSet[str]]) -> 'List__Set__string': ... + def __radd__(self, other: _List__Set__stringT) -> _List__Set__stringT: ... + def __reversed__(self) -> _typing.Iterator[_typing.AbstractSet[str]]: ... + def __iter__(self) -> _typing.Iterator[_typing.AbstractSet[str]]: ... + + +class Map__string_List__SimpleStruct(_typing.Mapping[str, _typing.Sequence[SimpleStruct]], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Mapping[str, _typing.Sequence[SimpleStruct]]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Mapping[str, _typing.Sequence[SimpleStruct]]: ... + def __getitem__(self, key: str) -> _typing.Sequence[SimpleStruct]: ... + def __iter__(self) -> _typing.Iterator[str]: ... + + +_List__List__stringT = _typing.TypeVar('_List__List__stringT', bound=_typing.Sequence[_typing.Sequence[str]]) + + +class List__List__string(_typing.Sequence[_typing.Sequence[str]], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[_typing.Sequence[str]]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[_typing.Sequence[str]]: ... + @_typing.overload + def __getitem__(self, i: int) -> _typing.Sequence[str]: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[_typing.Sequence[str]]: ... + def __add__(self, other: _typing.Sequence[_typing.Sequence[str]]) -> 'List__List__string': ... + def __radd__(self, other: _List__List__stringT) -> _List__List__stringT: ... + def __reversed__(self) -> _typing.Iterator[_typing.Sequence[str]]: ... + def __iter__(self) -> _typing.Iterator[_typing.Sequence[str]]: ... + + +_List__Set__i32T = _typing.TypeVar('_List__Set__i32T', bound=_typing.Sequence[_typing.AbstractSet[int]]) + + +class List__Set__i32(_typing.Sequence[_typing.AbstractSet[int]], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[_typing.AbstractSet[int]]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[_typing.AbstractSet[int]]: ... + @_typing.overload + def __getitem__(self, i: int) -> _typing.AbstractSet[int]: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[_typing.AbstractSet[int]]: ... + def __add__(self, other: _typing.Sequence[_typing.AbstractSet[int]]) -> 'List__Set__i32': ... + def __radd__(self, other: _List__Set__i32T) -> _List__Set__i32T: ... + def __reversed__(self) -> _typing.Iterator[_typing.AbstractSet[int]]: ... + def __iter__(self) -> _typing.Iterator[_typing.AbstractSet[int]]: ... + + +_List__Map__string_stringT = _typing.TypeVar('_List__Map__string_stringT', bound=_typing.Sequence[_typing.Mapping[str, str]]) + + +class List__Map__string_string(_typing.Sequence[_typing.Mapping[str, str]], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[_typing.Mapping[str, str]]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[_typing.Mapping[str, str]]: ... + @_typing.overload + def __getitem__(self, i: int) -> _typing.Mapping[str, str]: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[_typing.Mapping[str, str]]: ... + def __add__(self, other: _typing.Sequence[_typing.Mapping[str, str]]) -> 'List__Map__string_string': ... + def __radd__(self, other: _List__Map__string_stringT) -> _List__Map__string_stringT: ... + def __reversed__(self) -> _typing.Iterator[_typing.Mapping[str, str]]: ... + def __iter__(self) -> _typing.Iterator[_typing.Mapping[str, str]]: ... + + +_List__binaryT = _typing.TypeVar('_List__binaryT', bound=_typing.Sequence[bytes]) + + +class List__binary(_typing.Sequence[bytes], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[bytes]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[bytes]: ... + @_typing.overload + def __getitem__(self, i: int) -> bytes: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[bytes]: ... + def __add__(self, other: _typing.Sequence[bytes]) -> 'List__binary': ... + def __radd__(self, other: _List__binaryT) -> _List__binaryT: ... + def __reversed__(self) -> _typing.Iterator[bytes]: ... + def __iter__(self) -> _typing.Iterator[bytes]: ... + + +class Set__binary(_typing.AbstractSet[bytes], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.AbstractSet[bytes]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.AbstractSet[bytes]: ... + def __contains__(self, x: object) -> bool: ... + def union(self, other: _typing.AbstractSet[bytes]) -> 'Set__binary': ... + def intersection(self, other: _typing.AbstractSet[bytes]) -> 'Set__binary': ... + def difference(self, other: _typing.AbstractSet[bytes]) -> 'Set__binary': ... + def symmetric_difference(self, other: _typing.AbstractSet[bytes]) -> 'Set__binary': ... + def issubset(self, other: _typing.AbstractSet[bytes]) -> bool: ... + def issuperset(self, other: _typing.AbstractSet[bytes]) -> bool: ... + def __iter__(self) -> _typing.Iterator[bytes]: ... + + +_List__AnEnumT = _typing.TypeVar('_List__AnEnumT', bound=_typing.Sequence[AnEnum]) + + +class List__AnEnum(_typing.Sequence[AnEnum], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[AnEnum]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[AnEnum]: ... + @_typing.overload + def __getitem__(self, i: int) -> AnEnum: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[AnEnum]: ... + def __add__(self, other: _typing.Sequence[AnEnum]) -> 'List__AnEnum': ... + def __radd__(self, other: _List__AnEnumT) -> _List__AnEnumT: ... + def __reversed__(self) -> _typing.Iterator[AnEnum]: ... + def __iter__(self) -> _typing.Iterator[AnEnum]: ... + + +class _std_unordered_map__Map__i32_i32(_typing.Mapping[int, int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Mapping[int, int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Mapping[int, int]: ... + def __getitem__(self, key: int) -> int: ... + def __iter__(self) -> _typing.Iterator[int]: ... + + +__MyType__List__i32T = _typing.TypeVar('__MyType__List__i32T', bound=_typing.Sequence[int]) + + +class _MyType__List__i32(_typing.Sequence[int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[int]: ... + @_typing.overload + def __getitem__(self, i: int) -> int: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[int]: ... + def __add__(self, other: _typing.Sequence[int]) -> '_MyType__List__i32': ... + def __radd__(self, other: __MyType__List__i32T) -> __MyType__List__i32T: ... + def __reversed__(self) -> _typing.Iterator[int]: ... + def __iter__(self) -> _typing.Iterator[int]: ... + + +class _MyType__Set__i32(_typing.AbstractSet[int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.AbstractSet[int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.AbstractSet[int]: ... + def __contains__(self, x: object) -> bool: ... + def union(self, other: _typing.AbstractSet[int]) -> '_MyType__Set__i32': ... + def intersection(self, other: _typing.AbstractSet[int]) -> '_MyType__Set__i32': ... + def difference(self, other: _typing.AbstractSet[int]) -> '_MyType__Set__i32': ... + def symmetric_difference(self, other: _typing.AbstractSet[int]) -> '_MyType__Set__i32': ... + def issubset(self, other: _typing.AbstractSet[int]) -> bool: ... + def issuperset(self, other: _typing.AbstractSet[int]) -> bool: ... + def __iter__(self) -> _typing.Iterator[int]: ... + + +class _MyType__Map__i32_i32(_typing.Mapping[int, int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Mapping[int, int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Mapping[int, int]: ... + def __getitem__(self, key: int) -> int: ... + def __iter__(self) -> _typing.Iterator[int]: ... + + +__py3_simple_AdaptedList__List__i32T = _typing.TypeVar('__py3_simple_AdaptedList__List__i32T', bound=_typing.Sequence[int]) + + +class _py3_simple_AdaptedList__List__i32(_typing.Sequence[int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[int]: ... + @_typing.overload + def __getitem__(self, i: int) -> int: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[int]: ... + def __add__(self, other: _typing.Sequence[int]) -> '_py3_simple_AdaptedList__List__i32': ... + def __radd__(self, other: __py3_simple_AdaptedList__List__i32T) -> __py3_simple_AdaptedList__List__i32T: ... + def __reversed__(self) -> _typing.Iterator[int]: ... + def __iter__(self) -> _typing.Iterator[int]: ... + + +class _py3_simple_AdaptedSet__Set__i32(_typing.AbstractSet[int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.AbstractSet[int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.AbstractSet[int]: ... + def __contains__(self, x: object) -> bool: ... + def union(self, other: _typing.AbstractSet[int]) -> '_py3_simple_AdaptedSet__Set__i32': ... + def intersection(self, other: _typing.AbstractSet[int]) -> '_py3_simple_AdaptedSet__Set__i32': ... + def difference(self, other: _typing.AbstractSet[int]) -> '_py3_simple_AdaptedSet__Set__i32': ... + def symmetric_difference(self, other: _typing.AbstractSet[int]) -> '_py3_simple_AdaptedSet__Set__i32': ... + def issubset(self, other: _typing.AbstractSet[int]) -> bool: ... + def issuperset(self, other: _typing.AbstractSet[int]) -> bool: ... + def __iter__(self) -> _typing.Iterator[int]: ... + + +class _py3_simple_AdaptedMap__Map__i32_i32(_typing.Mapping[int, int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Mapping[int, int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Mapping[int, int]: ... + def __getitem__(self, key: int) -> int: ... + def __iter__(self) -> _typing.Iterator[int]: ... + + +class Map__i32_double(_typing.Mapping[int, float], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Mapping[int, float]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Mapping[int, float]: ... + def __getitem__(self, key: int) -> float: ... + def __iter__(self) -> _typing.Iterator[int]: ... + + +_List__Map__i32_doubleT = _typing.TypeVar('_List__Map__i32_doubleT', bound=_typing.Sequence[_typing.Mapping[int, float]]) + + +class List__Map__i32_double(_typing.Sequence[_typing.Mapping[int, float]], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Sequence[_typing.Mapping[int, float]]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Sequence[_typing.Mapping[int, float]]: ... + @_typing.overload + def __getitem__(self, i: int) -> _typing.Mapping[int, float]: ... + @_typing.overload + def __getitem__(self, s: slice) -> _typing.Sequence[_typing.Mapping[int, float]]: ... + def __add__(self, other: _typing.Sequence[_typing.Mapping[int, float]]) -> 'List__Map__i32_double': ... + def __radd__(self, other: _List__Map__i32_doubleT) -> _List__Map__i32_doubleT: ... + def __reversed__(self) -> _typing.Iterator[_typing.Mapping[int, float]]: ... + def __iter__(self) -> _typing.Iterator[_typing.Mapping[int, float]]: ... + + +class Map__AnEnumRenamed_i32(_typing.Mapping[AnEnumRenamed, int], _typing.Hashable): + def __init__(self, items: _typing.Optional[_typing.Mapping[AnEnumRenamed, int]]=None) -> None: ... + def __len__(self) -> int: ... + def __hash__(self) -> int: ... + def __copy__(self) -> _typing.Mapping[AnEnumRenamed, int]: ... + def __getitem__(self, key: AnEnumRenamed) -> int: ... + def __iter__(self) -> _typing.Iterator[AnEnumRenamed]: ... + + +A_BOOL: bool = ... +A_BYTE: int = ... +THE_ANSWER: int = ... +A_NUMBER: int = ... +A_BIG_NUMBER: int = ... +A_REAL_NUMBER: float = ... +A_FAKE_NUMBER: float = ... +A_WORD: str = ... +SOME_BYTES: bytes = ... +A_STRUCT: SimpleStruct = ... +EMPTY: SimpleStruct = ... +WORD_LIST: List__string = ... +SOME_MAP: List__Map__i32_double = ... +DIGITS: Set__i32 = ... +A_CONST_MAP: Map__string_SimpleStruct = ... +ANOTHER_CONST_MAP: Map__AnEnumRenamed_i32 = ... +IOBufPtr = _fbthrift_iobuf.IOBuf +IOBuf = _fbthrift_iobuf.IOBuf +AdaptedTypeDef = SimpleStruct +foo_bar = bytes +CustomBool = bool +CustomInteger = int +CustomDouble = float +CustomString = str +CustomBinary = bytes +CustomList = _MyType__List__i32 +CustomSet = _MyType__Set__i32 +CustomMap = _MyType__Map__i32_i32 +CustomStruct = SimpleStruct +AdaptedBool = bool +AdaptedInteger = int +AdaptedDouble = float +AdaptedString = str +AdaptedBinary = bytes +AdaptedList = _py3_simple_AdaptedList__List__i32 +AdaptedSet = _py3_simple_AdaptedSet__Set__i32 +AdaptedMap = _py3_simple_AdaptedMap__Map__i32_i32 +AdaptedStruct = SimpleStruct diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.pyx new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types.pyx @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_empty.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_empty.pyx new file mode 100644 index 00000000000000..fc5c9c6591909a --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_empty.pyx @@ -0,0 +1,9 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# +# pump UP the NODE count +# PUMP up THE node COUNT +# pump UP the NODE count diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_fields.pxd b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_fields.pxd new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_fields.pxd @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_fields.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_fields.pyx new file mode 100644 index 00000000000000..23ce2f67166ade --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_fields.pyx @@ -0,0 +1,6 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_impl_FBTHRIFT_ONLY_DO_NOT_USE.py b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_impl_FBTHRIFT_ONLY_DO_NOT_USE.py new file mode 100644 index 00000000000000..7f73bff7346115 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_impl_FBTHRIFT_ONLY_DO_NOT_USE.py @@ -0,0 +1,152 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# + +import enum +import thrift.py3.types +import module.thrift_enums as _fbthrift_python_enums + +_fbthrift__module_name__ = "module.types" + + + +class AnEnum(thrift.py3.types.CompiledEnum): + NOTSET = 0 + ONE = 1 + TWO = 2 + THREE = 3 + FOUR = 4 + + __module__ = _fbthrift__module_name__ + __slots__ = () + + @staticmethod + def __get_metadata__(): + return _fbthrift_python_enums.gen_metadata_enum_AnEnum() + + @staticmethod + def __get_thrift_name__(): + return "module.AnEnum" + + def _to_python(self): + return _fbthrift_python_enums.AnEnum(self._fbthrift_value_) + + def _to_py3(self): + return self + + def _to_py_deprecated(self): + return self._fbthrift_value_ + + def __lt__(self, other): + if isinstance(other, AnEnum): + return self._fbthrift_value_ < other._fbthrift_value_ + + raise NotImplementedError( + "'<' only implemented for comparisons with AnEnum" + ) + + def __int__(self): + return self._fbthrift_value_ + + def __index__(self): + return self._fbthrift_value_ + + + + +class AnEnumRenamed(thrift.py3.types.CompiledEnum): + name_ = 0 + value_ = 1 + renamed_ = 2 + + __module__ = _fbthrift__module_name__ + __slots__ = () + + @staticmethod + def __get_metadata__(): + return _fbthrift_python_enums.gen_metadata_enum_AnEnumRenamed() + + @staticmethod + def __get_thrift_name__(): + return "module.AnEnumRenamed" + + def _to_python(self): + return _fbthrift_python_enums.AnEnumRenamed(self._fbthrift_value_) + + def _to_py3(self): + return self + + def _to_py_deprecated(self): + return self._fbthrift_value_ + + def __lt__(self, other): + if isinstance(other, AnEnumRenamed): + return self._fbthrift_value_ < other._fbthrift_value_ + + raise NotImplementedError( + "'<' only implemented for comparisons with AnEnumRenamed" + ) + + def __int__(self): + return self._fbthrift_value_ + + def __index__(self): + return self._fbthrift_value_ + + + + +class Flags(thrift.py3.types.Flag): + flag_A = 1 + flag_B = 2 + flag_C = 4 + flag_D = 8 + + __module__ = _fbthrift__module_name__ + __slots__ = () + + @staticmethod + def __get_metadata__(): + return _fbthrift_python_enums.gen_metadata_enum_Flags() + + @staticmethod + def __get_thrift_name__(): + return "module.Flags" + + def _to_python(self): + return _fbthrift_python_enums.Flags(self._fbthrift_value_) + + def _to_py3(self): + return self + + def _to_py_deprecated(self): + return self._fbthrift_value_ + + def __lt__(self, other): + if isinstance(other, Flags): + return self._fbthrift_value_ < other._fbthrift_value_ + + raise NotImplementedError( + "'<' only implemented for comparisons with Flags" + ) + + def __int__(self): + return self._fbthrift_value_ + + def __index__(self): + return self._fbthrift_value_ + + + + + +class __BinaryUnionType(enum.Enum): + iobuf_val = 1 + EMPTY = 0 + + __module__ = _fbthrift__module_name__ + __slots__ = () + diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_reflection.py b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_reflection.py new file mode 100644 index 00000000000000..37af12ca772303 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/module/types_reflection.py @@ -0,0 +1,730 @@ +# +# Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# @generated +# + + +import folly.iobuf as _fbthrift_iobuf + +from thrift.py3.reflection import ( + NumberType as __NumberType, + StructType as __StructType, + Qualifier as __Qualifier, + StructSpec as __StructSpec, + ListSpec as __ListSpec, + SetSpec as __SetSpec, + MapSpec as __MapSpec, + FieldSpec as __FieldSpec, +) + + +import module.thrift_types as _module_types + + + +def get_reflection__SimpleException() -> __StructSpec: + spec: __StructSpec = __StructSpec._fbthrift_create( + name="SimpleException", + kind=__StructType.EXCEPTION, + annotations={ + }, + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=1, + name="err_code", + py_name="err_code", + type=int, + kind=__NumberType.I16, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + return spec +def get_reflection__OptionalRefStruct() -> __StructSpec: + spec: __StructSpec = __StructSpec._fbthrift_create( + name="OptionalRefStruct", + kind=__StructType.STRUCT, + annotations={ + }, + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=1, + name="optional_blob", + py_name="optional_blob", + type=_fbthrift_iobuf.IOBuf, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.OPTIONAL, + default=None, + annotations={ + }, + ), + ) + return spec +def get_reflection__SimpleStruct() -> __StructSpec: + spec: __StructSpec = __StructSpec._fbthrift_create( + name="SimpleStruct", + kind=__StructType.STRUCT, + annotations={ + }, + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=1, + name="is_on", + py_name="is_on", + type=bool, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=2, + name="tiny_int", + py_name="tiny_int", + type=int, + kind=__NumberType.BYTE, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=3, + name="small_int", + py_name="small_int", + type=int, + kind=__NumberType.I16, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=4, + name="nice_sized_int", + py_name="nice_sized_int", + type=int, + kind=__NumberType.I32, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=5, + name="big_int", + py_name="big_int", + type=int, + kind=__NumberType.I64, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=6, + name="real", + py_name="real", + type=float, + kind=__NumberType.DOUBLE, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=7, + name="smaller_real", + py_name="smaller_real", + type=float, + kind=__NumberType.FLOAT, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=9, + name="something", + py_name="something", + type=_module_types._std_unordered_map__Map__i32_i32, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + return spec +def get_reflection__HiddenTypeFieldsStruct() -> __StructSpec: + spec: __StructSpec = __StructSpec._fbthrift_create( + name="HiddenTypeFieldsStruct", + kind=__StructType.STRUCT, + annotations={ + }, + ) + return spec +def get_reflection__ComplexStruct() -> __StructSpec: + spec: __StructSpec = __StructSpec._fbthrift_create( + name="ComplexStruct", + kind=__StructType.STRUCT, + annotations={ + }, + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=1, + name="structOne", + py_name="structOne", + type=_module_types.SimpleStruct, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=2, + name="structTwo", + py_name="structTwo", + type=_module_types.SimpleStruct, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=3, + name="an_integer", + py_name="an_integer", + type=int, + kind=__NumberType.I32, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=4, + name="name", + py_name="name", + type=str, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=5, + name="an_enum", + py_name="an_enum", + type=_module_types.AnEnum, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=6, + name="some_bytes", + py_name="some_bytes", + type=bytes, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=7, + name="from", + py_name="sender", + type=str, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=8, + name="cdef", + py_name="cdef_", + type=str, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=9, + name="bytes_with_cpp_type", + py_name="bytes_with_cpp_type", + type=bytes, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + return spec +def get_reflection__BinaryUnion() -> __StructSpec: + spec: __StructSpec = __StructSpec._fbthrift_create( + name="BinaryUnion", + kind=__StructType.UNION, + annotations={ + """cpp.noncomparable""": """1""", }, + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=1, + name="iobuf_val", + py_name="iobuf_val", + type=_fbthrift_iobuf.IOBuf, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + return spec +def get_reflection__BinaryUnionStruct() -> __StructSpec: + spec: __StructSpec = __StructSpec._fbthrift_create( + name="BinaryUnionStruct", + kind=__StructType.STRUCT, + annotations={ + """cpp.noncomparable""": """1""", }, + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=1, + name="u", + py_name="u", + type=_module_types.BinaryUnion, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + return spec +def get_reflection__CustomFields() -> __StructSpec: + spec: __StructSpec = __StructSpec._fbthrift_create( + name="CustomFields", + kind=__StructType.STRUCT, + annotations={ + }, + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=1, + name="bool_field", + py_name="bool_field", + type=bool, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=2, + name="integer_field", + py_name="integer_field", + type=int, + kind=__NumberType.I64, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=3, + name="double_field", + py_name="double_field", + type=float, + kind=__NumberType.DOUBLE, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=4, + name="string_field", + py_name="string_field", + type=str, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=5, + name="binary_field", + py_name="binary_field", + type=bytes, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=6, + name="list_field", + py_name="list_field", + type=_module_types._MyType__List__i32, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=7, + name="set_field", + py_name="set_field", + type=_module_types._MyType__Set__i32, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=8, + name="map_field", + py_name="map_field", + type=_module_types._MyType__Map__i32_i32, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=9, + name="struct_field", + py_name="struct_field", + type=_module_types.SimpleStruct, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + return spec +def get_reflection__CustomTypedefFields() -> __StructSpec: + spec: __StructSpec = __StructSpec._fbthrift_create( + name="CustomTypedefFields", + kind=__StructType.STRUCT, + annotations={ + }, + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=1, + name="bool_field", + py_name="bool_field", + type=bool, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=2, + name="integer_field", + py_name="integer_field", + type=int, + kind=__NumberType.I64, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=3, + name="double_field", + py_name="double_field", + type=float, + kind=__NumberType.DOUBLE, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=4, + name="string_field", + py_name="string_field", + type=str, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=5, + name="binary_field", + py_name="binary_field", + type=bytes, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=6, + name="list_field", + py_name="list_field", + type=_module_types._MyType__List__i32, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=7, + name="set_field", + py_name="set_field", + type=_module_types._MyType__Set__i32, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=8, + name="map_field", + py_name="map_field", + type=_module_types._MyType__Map__i32_i32, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=9, + name="struct_field", + py_name="struct_field", + type=_module_types.SimpleStruct, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + return spec +def get_reflection__AdaptedTypedefFields() -> __StructSpec: + spec: __StructSpec = __StructSpec._fbthrift_create( + name="AdaptedTypedefFields", + kind=__StructType.STRUCT, + annotations={ + }, + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=1, + name="bool_field", + py_name="bool_field", + type=bool, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=2, + name="integer_field", + py_name="integer_field", + type=int, + kind=__NumberType.I64, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=3, + name="double_field", + py_name="double_field", + type=float, + kind=__NumberType.DOUBLE, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=4, + name="string_field", + py_name="string_field", + type=str, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=5, + name="binary_field", + py_name="binary_field", + type=bytes, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=6, + name="list_field", + py_name="list_field", + type=_module_types._py3_simple_AdaptedList__List__i32, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=7, + name="set_field", + py_name="set_field", + type=_module_types._py3_simple_AdaptedSet__Set__i32, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=8, + name="map_field", + py_name="map_field", + type=_module_types._py3_simple_AdaptedMap__Map__i32_i32, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + spec.add_field( + __FieldSpec._fbthrift_create( + id=9, + name="struct_field", + py_name="struct_field", + type=_module_types.SimpleStruct, + kind=__NumberType.NOT_A_NUMBER, + qualifier=__Qualifier.UNQUALIFIED, + default=None, + annotations={ + }, + ), + ) + return spec diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/python/metadata.cpp b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/python/metadata.cpp new file mode 100644 index 00000000000000..d0d9536bfa1bff --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/python/metadata.cpp @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/annotation/python.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/python/metadata.h b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/python/metadata.h new file mode 100644 index 00000000000000..d0d9536bfa1bff --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/python/metadata.h @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/annotation/python.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/python/types.h b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/python/types.h new file mode 100644 index 00000000000000..d0d9536bfa1bff --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/python/types.h @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/annotation/python.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/scope/metadata.cpp b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/scope/metadata.cpp new file mode 100644 index 00000000000000..693fc6601a0bf9 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/scope/metadata.cpp @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/annotation/scope.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/scope/metadata.h b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/scope/metadata.h new file mode 100644 index 00000000000000..693fc6601a0bf9 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/scope/metadata.h @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/annotation/scope.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/scope/types.h b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/scope/types.h new file mode 100644 index 00000000000000..693fc6601a0bf9 --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/scope/types.h @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/annotation/scope.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/thrift/metadata.cpp b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/thrift/metadata.cpp new file mode 100644 index 00000000000000..ab26c5fcd2a96c --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/thrift/metadata.cpp @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/annotation/thrift.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/thrift/metadata.h b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/thrift/metadata.h new file mode 100644 index 00000000000000..ab26c5fcd2a96c --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/thrift/metadata.h @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/annotation/thrift.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/thrift/types.h b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/thrift/types.h new file mode 100644 index 00000000000000..ab26c5fcd2a96c --- /dev/null +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_auto_migrate_legacy_container_converters/gen-py3/thrift/types.h @@ -0,0 +1,6 @@ +/** + * Autogenerated by Thrift for thrift/annotation/thrift.thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/converter.pyx index c68ae151757a45..25b7a914435461 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_empty/gen-py3/empty/converter.pyx @@ -9,4 +9,3 @@ cimport empty.types as _fbthrift_ctypes - diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_legacy_container_converters/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_legacy_container_converters/gen-py3/module/converter.pyx index 86d119728c6592..fb75d005142576 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_legacy_container_converters/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/py3/out/py3_legacy_container_converters/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cSimpleException] SimpleException_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.SimpleException?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/qualified/out/py3/gen-py3/module0/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/qualified/out/py3/gen-py3/module0/converter.pyx index f7a407a003f9f9..0e75cf97cb3945 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/qualified/out/py3/gen-py3/module0/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/qualified/out/py3/gen-py3/module0/converter.pyx @@ -8,7 +8,6 @@ cimport module0.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cStruct] Struct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Struct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/qualified/out/py3/gen-py3/module1/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/qualified/out/py3/gen-py3/module1/converter.pyx index d1df6b9020644f..df6fb41a631360 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/qualified/out/py3/gen-py3/module1/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/qualified/out/py3/gen-py3/module1/converter.pyx @@ -8,7 +8,6 @@ cimport module1.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cStruct] Struct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Struct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/qualified/out/py3/gen-py3/module2/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/qualified/out/py3/gen-py3/module2/converter.pyx index a598e6f52d5f4b..9655593d9e0d07 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/qualified/out/py3/gen-py3/module2/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/qualified/out/py3/gen-py3/module2/converter.pyx @@ -8,7 +8,6 @@ cimport module2.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cStruct] Struct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Struct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/refs/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/refs/out/py3/gen-py3/module/converter.pyx index e38a1192764760..e9196501e869de 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/refs/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/refs/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cMyUnion] MyUnion_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.MyUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/req-opt/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/req-opt/out/py3/gen-py3/module/converter.pyx index f5bd77f35fc9a4..1b9e9b6a23986d 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/req-opt/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/req-opt/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Foo?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/serialization_field_order/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/serialization_field_order/out/py3/gen-py3/module/converter.pyx index a4757a9f4b8e04..bc12fcc80aaa7a 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/serialization_field_order/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/serialization_field_order/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Foo?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/converter.pyx index 55c53804d7b110..540286b3ac2246 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/single_file_service/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Foo?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/converter.pyx index b8dbd59635bec1..e97578693bee52 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/single_file_service/out/py3_module_structs/gen-py3/module_structs/converter.pyx @@ -8,7 +8,6 @@ cimport module_structs.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFoo] Foo_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.Foo?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/converter.pyx index cff049cbbc66dd..93a87a835165cb 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/sink/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cInitialResponse] InitialResponse_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.InitialResponse?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/converter.pyx index 74511da267df3c..b4fe6d91cf2ae8 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/stream/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cFooStreamEx] FooStreamEx_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.FooStreamEx?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/templated-deserialize/out/py3/gen-py3/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/templated-deserialize/out/py3/gen-py3/module/converter.pyx index b9b37341f98b83..f6163241c85b88 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/templated-deserialize/out/py3/gen-py3/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/templated-deserialize/out/py3/gen-py3/module/converter.pyx @@ -8,7 +8,6 @@ cimport module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cSmallStruct] SmallStruct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.SmallStruct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_a/gen-py3/a/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_a/gen-py3/a/converter.pyx index 7ccd4c2c8700e9..acef73b3e030c5 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_a/gen-py3/a/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_a/gen-py3/a/converter.pyx @@ -8,7 +8,6 @@ cimport a.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cA] A_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.A?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_a/gen-py3/b/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_a/gen-py3/b/converter.pyx index bb187a639f7dc9..0db8113ece6ec4 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_a/gen-py3/b/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_a/gen-py3/b/converter.pyx @@ -9,4 +9,3 @@ cimport b.types as _fbthrift_ctypes - diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_a/gen-py3/c/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_a/gen-py3/c/converter.pyx index b968b409ff4f8a..1a05c62c3a8076 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_a/gen-py3/c/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_a/gen-py3/c/converter.pyx @@ -8,7 +8,6 @@ cimport c.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cC] C_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.C?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/b/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/b/converter.pyx index bb187a639f7dc9..0db8113ece6ec4 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/b/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/b/converter.pyx @@ -9,4 +9,3 @@ cimport b.types as _fbthrift_ctypes - diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/c/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/c/converter.pyx index b968b409ff4f8a..1a05c62c3a8076 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/c/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/c/converter.pyx @@ -8,7 +8,6 @@ cimport c.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cC] C_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.C?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/converter.pyx index 47802bd58a0298..73f062af8f74d8 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/transitive-deps/out/py3_s/gen-py3/s/converter.pyx @@ -9,4 +9,3 @@ cimport s.types as _fbthrift_ctypes - diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/included/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/included/converter.pyx index cfb440ff6ef16b..a994b0259f9bbc 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/included/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/included/converter.pyx @@ -9,4 +9,3 @@ cimport apache.thrift.fixtures.types.included.types as _fbthrift_ctypes - diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/converter.pyx b/third-party/thrift/src/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/converter.pyx index 44553434e62676..5d4de32b05edd6 100644 --- a/third-party/thrift/src/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/converter.pyx +++ b/third-party/thrift/src/thrift/compiler/test/fixtures/types/out/py3/gen-py3/apache/thrift/fixtures/types/module/converter.pyx @@ -8,7 +8,6 @@ cimport apache.thrift.fixtures.types.module.types as _fbthrift_ctypes - cdef shared_ptr[_fbthrift_cbindings.cempty_struct] empty_struct_convert_to_cpp(object inst) except*: return (<_fbthrift_ctypes.empty_struct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE