def serialize(expr):
    """
    Return code to write expression to buffer.

    :param expr str: string python expression that is evaluated for serialization
    :returns str: python call to write value returned by expr to serialization buffer
    """
    return 'buff.write(%s)' % expr
