roshanjrajan-zip commented on code in PR #2825:
URL: https://github.com/apache/thrift/pull/2825#discussion_r1248313097


##########
compiler/cpp/src/thrift/generate/t_py_generator.cc:
##########
@@ -871,7 +871,12 @@ void 
t_py_generator::generate_py_struct_definition(ostream& out,
       }
 
       if (is_immutable(tstruct)) {
-        if (gen_newstyle_ || gen_dynamic_) {
+        if (gen_enum_ && type->is_enum()) {
+          indent(out) << "super(" << tstruct->get_name() << ", 
self).__setattr__('"

Review Comment:
   Yeah I was thinking about this and then I realized that the fix was actually 
broken because I wasn't running one of the tests that I added.... 😓 . So 
actually this fix is needed to make sure existing users aren't broken.
   
   ```python
   if __name__ == "__main__":
       serialization_deserialization_enum_test()
       serialization_deserialization_string_test
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to