MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __str__

Method __str__

tools/python-3.11.9-amd64/Lib/inspect.py:2756–2776  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2754 return type(self)(name, kind, default=default, annotation=annotation)
2755
2756 def __str__(self):
2757 kind = self.kind
2758 formatted = self._name
2759
2760 # Add annotation and default value
2761 if self._annotation is not _empty:
2762 formatted = '{}: {}'.format(formatted,
2763 formatannotation(self._annotation))
2764
2765 if self._default is not _empty:
2766 if self._annotation is not _empty:
2767 formatted = '{} = {}'.format(formatted, repr(self._default))
2768 else:
2769 formatted = '{}={}'.format(formatted, repr(self._default))
2770
2771 if kind == _VAR_POSITIONAL:
2772 formatted = '*' + formatted
2773 elif kind == _VAR_KEYWORD:
2774 formatted = '**' + formatted
2775
2776 return formatted
2777
2778 def __repr__(self):
2779 return '<{} "{}">'.format(self.__class__.__name__, self)

Callers

nothing calls this directly

Calls 2

formatannotationFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected