(self, obj)
| 6767 | return cls.__singleton |
| 6768 | |
| 6769 | def __array_finalize__(self, obj): |
| 6770 | if not self.__has_singleton(): |
| 6771 | # this handles the `.view` in __new__, which we want to copy across |
| 6772 | # properties normally |
| 6773 | return super().__array_finalize__(obj) |
| 6774 | elif self is self.__singleton: |
| 6775 | # not clear how this can happen, play it safe |
| 6776 | pass |
| 6777 | else: |
| 6778 | # everywhere else, we want to downcast to MaskedArray, to prevent a |
| 6779 | # duplicate maskedconstant. |
| 6780 | self.__class__ = MaskedArray |
| 6781 | MaskedArray.__array_finalize__(self, obj) |
| 6782 | |
| 6783 | def __array_wrap__(self, obj, context=None, return_scalar=False): |
| 6784 | return self.view(MaskedArray).__array_wrap__(obj, context) |
nothing calls this directly
no test coverage detected