from typing import Sequence


def to_sequence(obj):
    """Convert an object to sequence.

    Parameters
    ----------
    obj : `object`

    Returns
    -------
    `collections.Sequence`

    Examples
    --------
    >>> to_sequence(None)
    ()
    >>> to_sequence(1)
    (1,)
    >>> to_sequence('str')
    ('str',)
    >>> x = [0, 1, 2]
    >>> to_sequence(x)
    [0, 1, 2]
    >>> to_sequence(x) is x
    True
    """
    if obj is None:
        return ()
    if isinstance(obj, str) or not isinstance(obj, Sequence):
        return (obj,)
    return obj