(depth=3)
Allow instance and class checks for special stdlib modules.

    The abc and functools modules indiscriminately call isinstance() and
    issubclass() on the whole MRO of a user class, which may contain protocols.
Allow instance and class checks for special stdlib modules.
Allow instance and class checks for special stdlib modules .
def _allow_reckless_class_checks(depth=3):
    """Allow instance and class checks for special stdlib modules.

    The abc and functools modules indiscriminately call isinstance() and
    issubclass() on the whole MRO of a user class, which may contain protocols.
    """
    try:
        return sys._getframe(depth).f_globals['__name__'] in ['abc', 'functools']
    except (AttributeError, ValueError):  # For platforms without _getframe().
        return True
def _allow_reckless_class_checks ( depth = 3 ) : try : return sys . _getframe ( depth ) . f_globals [ '__name__' ] in [ 'abc' , 'functools' ] except ( AttributeError , ValueError ) : # For platforms without _getframe(). return True