MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / __getitem__

Method __getitem__

lib/matplotlib/tests/test_units.py:37–41  ·  view source on GitHub ↗
(self, item)

Source from the content-addressed store, hash-verified

35 return getattr(self.magnitude, attr)
36
37 def __getitem__(self, item):
38 if np.iterable(self.magnitude):
39 return Quantity(self.magnitude[item], self.units)
40 else:
41 return Quantity(self.magnitude, self.units)
42
43 def __array__(self):
44 return np.asarray(self.magnitude)

Callers

nothing calls this directly

Calls 1

QuantityClass · 0.85

Tested by

no test coverage detected