| 6596 | return object.__repr__(self) |
| 6597 | |
| 6598 | def __format__(self, format_spec): |
| 6599 | # Replace ndarray.__format__ with the default, which supports no format characters. |
| 6600 | # Supporting format characters is unwise here, because we do not know what type |
| 6601 | # the user was expecting - better to not guess. |
| 6602 | try: |
| 6603 | return object.__format__(self, format_spec) |
| 6604 | except TypeError: |
| 6605 | # 2020-03-23, NumPy 1.19.0 |
| 6606 | warnings.warn( |
| 6607 | "Format strings passed to MaskedConstant are ignored, but in future may " |
| 6608 | "error or produce different behavior", |
| 6609 | FutureWarning, stacklevel=2 |
| 6610 | ) |
| 6611 | return object.__format__(self, "") |
| 6612 | |
| 6613 | def __reduce__(self): |
| 6614 | """Override of MaskedArray's __reduce__. |