async def variant(self, elem=None, elem_type=None, params=None, wrapped=None):
elem_type = elem_type if elem_type else elem.__class__<EOL>if hasattr(elem_type, "<STR_LIT>"):<EOL><INDENT>elem = elem_type() if elem is None else elem<EOL>return await elem.serialize_archive(<EOL>self, elem=elem, elem_type=elem_type, params=params<EOL>)<EOL><DEDENT>if self.writing:<EOL><INDENT>return await self._dump_variant(<EOL>self.iobj,<EOL>elem=elem,<EOL>elem_type=elem_type if elem_type else elem.__class__,<EOL>params=params,<EOL>)<EOL><DEDENT>else:<EOL><INDENT>return await self._load_variant(<EOL>self.iobj,<EOL>elem_type=elem_type if elem_type else elem.__class__,<EOL>params=params,<EOL>elem=elem,<EOL>wrapped=wrapped,<EOL>)<EOL><DEDENT>
Loads/dumps variant type
:param elem:
:param elem_type:
:param params:
:return: