MCPcopy Index your code
hub / github.com/RustPython/RustPython / _allow_reckless_class_checks

Function _allow_reckless_class_checks

Lib/typing.py:1905–1911  ·  view source on GitHub ↗

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.

(depth=2)

Source from the content-addressed store, hash-verified

1903 return None
1904
1905def _allow_reckless_class_checks(depth=2):
1906 """Allow instance and class checks for special stdlib modules.
1907
1908 The abc and functools modules indiscriminately call isinstance() and
1909 issubclass() on the whole MRO of a user class, which may contain protocols.
1910 """
1911 return _caller(depth) in {'abc', 'functools', None}
1912
1913
1914_PROTO_ALLOWLIST = {

Callers 2

__subclasscheck__Method · 0.85
__instancecheck__Method · 0.85

Calls 1

_callerFunction · 0.85

Tested by

no test coverage detected