| 1233 | |
| 1234 | |
| 1235 | class BoolFormat: |
| 1236 | def __init__(self, data, **kwargs): |
| 1237 | # add an extra space so " True" and "False" have the same length and |
| 1238 | # array elements align nicely when printed, except in 0d arrays |
| 1239 | self.truestr = ' True' if data.shape != () else 'True' |
| 1240 | |
| 1241 | def __call__(self, x): |
| 1242 | return self.truestr if x else "False" |
| 1243 | |
| 1244 | |
| 1245 | class ComplexFloatingFormat: |