def isnamedtuple(obj):
    """
    Heuristic check if an object is a namedtuple.

    """
    return isinstance(obj, tuple) and hasattr(obj, '_fields') and hasattr(obj,
        '_asdict') and callable(obj._asdict)
