(self, fmt_str)
| 340 | f"symbol='{self.symbol}')") |
| 341 | |
| 342 | def __format__(self, fmt_str): |
| 343 | if fmt_str == '': |
| 344 | return self.__str__() |
| 345 | if fmt_str not in ('ascii', 'unicode'): |
| 346 | raise ValueError( |
| 347 | f"Unsupported format string '{fmt_str}' passed to " |
| 348 | f"{self.__class__}.__format__. Valid options are " |
| 349 | f"'ascii' and 'unicode'" |
| 350 | ) |
| 351 | if fmt_str == 'ascii': |
| 352 | return self._generate_string(self._str_term_ascii) |
| 353 | return self._generate_string(self._str_term_unicode) |
| 354 | |
| 355 | def __str__(self): |
| 356 | if self._use_unicode: |
nothing calls this directly
no test coverage detected