MCPcopy Create free account
hub / github.com/numpy/numpy / __getattr__

Function __getattr__

numpy/lib/__init__.py:78–91  ·  view source on GitHub ↗
(attr)

Source from the content-addressed store, hash-verified

76del PytestTester
77
78def __getattr__(attr):
79 # Warn for reprecated attributes
80 import math
81 import warnings
82
83 if attr == 'math':
84 warnings.warn(
85 "`np.lib.math` is a deprecated alias for the standard library "
86 "`math` module (Deprecated Numpy 1.25). Replace usages of "
87 "`numpy.lib.math` with `math`", DeprecationWarning, stacklevel=2)
88 return math
89 else:
90 raise AttributeError("module {!r} has no attribute "
91 "{!r}".format(__name__, attr))
92

Callers

nothing calls this directly

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected