(self)
| 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) |
nothing calls this directly
no test coverage detected