# PycodeSerializer

class xsdata.formats.dataclass.serializers.PycodeSerializer(config=<factory>, context=<factory>)

  Pycode serializer for dataclasses.

  Return a python representation code of a model instance.

  Parameters:

    - config (`SerializerConfig`) – Serializer configuration

    - context (`XmlContext`) – Model context provider

  render(obj, var_name='obj')

    Convert and return the given object tree as python representation code.

    Parameters:

      - obj (`object`) – The input dataclass instance

      - var_name (`str`) – The var name to assign the model instance

    Return type:

      `str`

  write(out, obj, var_name)

    Write the given object tree to the output text stream.

    Parameters:

      - out (`TextIO`) – The output stream

      - obj (`Any`) – The input dataclass instance

      - var_name (`str`) – The var name to assign the model instance

  __eq__(other)

    Return self==value.

  __hash__ = None