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

Function _deprecate_shape_0_as_None

numpy/core/records.py:576–585  ·  view source on GitHub ↗
(shape)

Source from the content-addressed store, hash-verified

574
575
576def _deprecate_shape_0_as_None(shape):
577 if shape == 0:
578 warnings.warn(
579 "Passing `shape=0` to have the shape be inferred is deprecated, "
580 "and in future will be equivalent to `shape=(0,)`. To infer "
581 "the shape and suppress this warning, pass `shape=None` instead.",
582 FutureWarning, stacklevel=3)
583 return None
584 else:
585 return shape
586
587
588@set_module("numpy.rec")

Callers 4

fromarraysFunction · 0.85
fromrecordsFunction · 0.85
fromstringFunction · 0.85
fromfileFunction · 0.85

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected