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

Method __bool__

numpy/_globals.py:87–95  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

85 NEVER = 2
86
87 def __bool__(self):
88 # For backwards compatibility
89 if self == _CopyMode.ALWAYS:
90 return True
91
92 if self == _CopyMode.IF_NEEDED:
93 return False
94
95 raise ValueError(f"{self} is neither True nor False.")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected