def _generate_union_class_get_helpers(self, ns, data_type):
for field in data_type.fields:<EOL><INDENT>field_name = fmt_func(field.name)<EOL>if not is_void_type(field.data_type):<EOL><INDENT>self.emit('<STR_LIT>'.format(field_name))<EOL>with self.indent():<EOL><INDENT>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>if field.doc:<EOL><INDENT>self.emit_wrapped_text(<EOL>self.process_doc(field.doc, self._docf))<EOL>self.emit()<EOL><DEDENT>self.emit("<STR_LIT>" %<EOL>field_name)<EOL>self.emit()<EOL>self.emit('<STR_LIT>'.format(<EOL>self._python_type_mapping(ns, field_dt)))<EOL>self.emit('<STR_LIT>')<EOL>self.emit('<STR_LIT>'.format(field_name))<EOL>with self.indent():<EOL><INDENT>self.emit(<EOL>'<STR_LIT>'.format(<EOL>field_name))<EOL><DEDENT>self.emit('<STR_LIT>')<EOL><DEDENT>self.emit()<EOL><DEDENT><DEDENT>
These are the getters used to access the value of a variant, once
the tag has been switched on.