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

Function _wrapit

numpy/core/fromnumeric.py:40–50  ·  view source on GitHub ↗
(obj, method, *args, **kwds)

Source from the content-addressed store, hash-verified

38
39# functions that are now methods
40def _wrapit(obj, method, *args, **kwds):
41 try:
42 wrap = obj.__array_wrap__
43 except AttributeError:
44 wrap = None
45 result = getattr(asarray(obj), method)(*args, **kwds)
46 if wrap:
47 if not isinstance(result, mu.ndarray):
48 result = asarray(result)
49 result = wrap(result)
50 return result
51
52
53def _wrapfunc(obj, method, *args, **kwds):

Callers 2

_wrapfuncFunction · 0.85
squeezeFunction · 0.85

Calls 2

wrapFunction · 0.85
asarrayFunction · 0.70

Tested by

no test coverage detected