jeking3 commented on a change in pull request #2523:
URL: https://github.com/apache/thrift/pull/2523#discussion_r841067092



##########
File path: compiler/cpp/src/thrift/generate/t_py_generator.cc
##########
@@ -2497,6 +2513,11 @@ void t_py_generator::generate_serialize_field(ostream& 
out, t_field* tfield, str
  * @param prefix  String prefix to attach to all fields
  */
 void t_py_generator::generate_serialize_struct(ostream& out, t_struct* 
tstruct, string prefix) {
+  if(gen_type_hints_) {
+    indent(out) << "if not type(" << prefix << ") is " << 
type_to_py_type(tstruct)

Review comment:
       This is not a type hint, it is a run-time check.  I don't think it 
belongs in this set of changes.  This is likely to break code relying on duck 
typing such as mocking.




-- 
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