def is_namedtuple(x):
    """
    Check if x is a namedtuple.

    :rtype: Boolean.
    """
    return all((type(x).__bases__[0] is tuple,
                len(type(x).__bases__) == 1,
                isinstance(getattr(x, '_fields', None), tuple)))