Like warnings.warn(), but category and stacklevel are required. You pretty much never want the default stacklevel of 1, so this helps encourage setting it explicitly.
(msg: str, category: t.Any, *, stacklevel: int, source: t.Any = None)
| 7 | |
| 8 | |
| 9 | def warn(msg: str, category: t.Any, *, stacklevel: int, source: t.Any = None) -> None: |
| 10 | """Like warnings.warn(), but category and stacklevel are required. |
| 11 | |
| 12 | You pretty much never want the default stacklevel of 1, so this helps |
| 13 | encourage setting it explicitly.""" |
| 14 | warnings.warn(msg, category=category, stacklevel=stacklevel, source=source) |
| 15 | |
| 16 | |
| 17 | def deprecated_method(method: t.Any, cls: t.Any, method_name: str, msg: str) -> None: |
no test coverage detected
searching dependent graphs…