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)
| 1903 | return None |
| 1904 | |
| 1905 | def _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 = { |
no test coverage detected