<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def new_union(self, type, name):
 """Defines a new union to template of `type` and `name`. Fields inside the union are alternatives and the length of the union is the length of its longest field. Example: | New union | IntOrAddress | foo | | Chars | 16 | ipAddress | | u32 | int | | End union | """

        self._message_stack.append(UnionTemplate(type, name, self._current_container))