MCPcopy Index your code
hub / github.com/numpy/numpy / __format__

Method __format__

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

Source from the content-addressed store, hash-verified

328 f"symbol='{self.symbol}')")
329
330 def __format__(self, fmt_str):
331 if fmt_str == '':
332 return self.__str__()
333 if fmt_str not in ('ascii', 'unicode'):
334 raise ValueError(
335 f"Unsupported format string '{fmt_str}' passed to "
336 f"{self.__class__}.__format__. Valid options are "
337 f"'ascii' and 'unicode'"
338 )
339 if fmt_str == 'ascii':
340 return self._generate_string(self._str_term_ascii)
341 return self._generate_string(self._str_term_unicode)
342
343 def __str__(self):
344 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