def infer_sedes(obj):
if is_sedes(obj.__class__):<EOL><INDENT>return obj.__class__<EOL><DEDENT>elif not isinstance(obj, bool) and isinstance(obj, int) and obj >= <NUM_LIT:0>:<EOL><INDENT>return big_endian_int<EOL><DEDENT>elif BinaryClass.is_valid_type(obj):<EOL><INDENT>return binary<EOL><DEDENT>elif not isinstance(obj, str) and isinstance(obj, collections.Sequence):<EOL><INDENT>return List(map(infer_sedes, obj))<EOL><DEDENT>elif isinstance(obj, bool):<EOL><INDENT>return boolean<EOL><DEDENT>elif isinstance(obj, str):<EOL><INDENT>return text<EOL><DEDENT>msg = '<STR_LIT>'.format(type(obj).__name__)<EOL>raise TypeError(msg)<EOL>
Try to find a sedes objects suitable for a given Python object.

    The sedes objects considered are `obj`'s class, `big_endian_int` and
    `binary`. If `obj` is a sequence, a :class:`rlp.sedes.List` will be
    constructed recursively.

    :param obj: the python object for which to find a sedes object
    :raises: :exc:`TypeError` if no appropriate sedes could be found