def _generate_union_class_variant_creators(self, ns, data_type):
for field in data_type.fields:<EOL><INDENT>if not is_void_type(field.data_type):<EOL><INDENT>field_name = fmt_func(field.name)<EOL>field_name_reserved_check = fmt_func(field.name, check_reserved=True)<EOL>if is_nullable_type(field.data_type):<EOL><INDENT>field_dt = field.data_type.data_type<EOL><DEDENT>else:<EOL><INDENT>field_dt = field.data_type<EOL><DEDENT>self.emit('<STR_LIT>')<EOL>self.emit('<STR_LIT>'.format(field_name_reserved_check))<EOL>with self.indent():<EOL><INDENT>self.emit('<STR_LIT>')<EOL>self.emit_wrapped_text(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' % field_name)<EOL>self.emit()<EOL>self.emit('<STR_LIT>'.format(<EOL>self._python_type_mapping(ns, field_dt)))<EOL>self.emit('<STR_LIT>'.format(<EOL>self._python_type_mapping(ns, data_type)))<EOL>self.emit('<STR_LIT>')<EOL>self.emit("<STR_LIT>".format(field_name))<EOL><DEDENT>self.emit()<EOL><DEDENT><DEDENT>
Each non-symbol, non-any variant has a corresponding class method that
can be used to construct a union with that variant selected.