(self, indx)
| 506 | return self.setfield(val, *res) |
| 507 | |
| 508 | def __getitem__(self, indx): |
| 509 | obj = super().__getitem__(indx) |
| 510 | |
| 511 | # copy behavior of getattr, except that here |
| 512 | # we might also be returning a single element |
| 513 | if isinstance(obj, ndarray): |
| 514 | if obj.dtype.names is not None: |
| 515 | obj = obj.view(type(self)) |
| 516 | if issubclass(obj.dtype.type, nt.void): |
| 517 | return obj.view(dtype=(self.dtype.type, obj.dtype)) |
| 518 | return obj |
| 519 | else: |
| 520 | return obj.view(type=ndarray) |
| 521 | else: |
| 522 | # return a single element |
| 523 | return obj |
| 524 | |
| 525 | def __repr__(self): |
| 526 |
nothing calls this directly
no test coverage detected