(self, obj)
| 6566 | return cls.__singleton |
| 6567 | |
| 6568 | def __array_finalize__(self, obj): |
| 6569 | if not self.__has_singleton(): |
| 6570 | # this handles the `.view` in __new__, which we want to copy across |
| 6571 | # properties normally |
| 6572 | return super().__array_finalize__(obj) |
| 6573 | elif self is self.__singleton: |
| 6574 | # not clear how this can happen, play it safe |
| 6575 | pass |
| 6576 | else: |
| 6577 | # everywhere else, we want to downcast to MaskedArray, to prevent a |
| 6578 | # duplicate maskedconstant. |
| 6579 | self.__class__ = MaskedArray |
| 6580 | MaskedArray.__array_finalize__(self, obj) |
| 6581 | |
| 6582 | def __array_prepare__(self, obj, context=None): |
| 6583 | return self.view(MaskedArray).__array_prepare__(obj, context) |
nothing calls this directly
no test coverage detected