Generate thrift_spec class attribute (with type hints)
diff --git a/compiler/cpp/src/thrift/generate/t_py_generator.cc b/compiler/cpp/src/thrift/generate/t_py_generator.cc
index 7b5c54d..893d635 100644
--- a/compiler/cpp/src/thrift/generate/t_py_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_py_generator.cc
@@ -831,6 +831,8 @@
out << ":" << '\n';
indent_up();
generate_python_docstring(out, tstruct);
+ std::string thrift_spec_type = gen_type_hints_ ? ": typing.Any" : "";
+ out << indent() << "thrift_spec" << thrift_spec_type << " = None" << '\n';
out << '\n';