from typing import Any


def isnamedtuple(x: Any) -> bool:
    """Test whether an object is a named-tuple.

    Named tuples are essentially extended tuples and instance checks don't work.
    The best thing you can do is just test if they have the special attributes that
    differentiate it from a standard tuple.

    Examples
    ------
    >>> from collections import namedtuple
    >>> from typing import NamedTuple
    >>> class Foo(NamedTuple):
    ...     bar: str
    ...
    >>> isnamedtuple(Foo('bar'))
    True
    >>> Foo = namedtuple('Foo', ['bar'])
    >>> isnamedtuple(Foo('bar'))
    True
    >>> isnamedtuple(tuple())
    False
    """
    return isinstance(x, tuple) and hasattr(x, "_fields") and hasattr(x, "_asdict")