MCPcopy Create free account
hub / github.com/ipython/traitlets / warn

Function warn

traitlets/utils/warnings.py:9–14  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

7
8
9def 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
17def deprecated_method(method: t.Any, cls: t.Any, method_name: str, msg: str) -> None:

Callers 15

__init__Method · 0.90
isidentifierFunction · 0.85
__init__Method · 0.85
get_default_valueMethod · 0.85
init_default_valueMethod · 0.85
getMethod · 0.85
get_metadataMethod · 0.85
set_metadataMethod · 0.85
tagMethod · 0.85
__new__Method · 0.85
compatible_observerFunction · 0.85
__init__Method · 0.85

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…