MCPcopy Create free account
hub / github.com/numpy/numpy / __format__

Method __format__

numpy/polynomial/_polybase.py:342–353  ·  view source on GitHub ↗
(self, fmt_str)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 2

__str__Method · 0.95
_generate_stringMethod · 0.95

Tested by

no test coverage detected