Converts G2 element @x into an array of bytes. If @compress is True, 
    the point will be compressed resulting in a much shorter string of bytes.

def serializeG2(x, compress=True):
    """
    Converts G2 element @x into an array of bytes. If @compress is True, 
    the point will be compressed resulting in a much shorter string of bytes.
    """
    assertType(x, G2Element)
    return _serialize(x, compress, librelic.g2_size_bin_abi,
        librelic.g2_write_bin_abi)