(self, *, quote_annotation_strings=True)
| 2775 | return self._format() |
| 2776 | |
| 2777 | def _format(self, *, quote_annotation_strings=True): |
| 2778 | kind = self.kind |
| 2779 | formatted = self._name |
| 2780 | |
| 2781 | # Add annotation and default value |
| 2782 | if self._annotation is not _empty: |
| 2783 | annotation = formatannotation(self._annotation, |
| 2784 | quote_annotation_strings=quote_annotation_strings) |
| 2785 | formatted = '{}: {}'.format(formatted, annotation) |
| 2786 | |
| 2787 | if self._default is not _empty: |
| 2788 | if self._annotation is not _empty: |
| 2789 | formatted = '{} = {}'.format(formatted, repr(self._default)) |
| 2790 | else: |
| 2791 | formatted = '{}={}'.format(formatted, repr(self._default)) |
| 2792 | |
| 2793 | if kind == _VAR_POSITIONAL: |
| 2794 | formatted = '*' + formatted |
| 2795 | elif kind == _VAR_KEYWORD: |
| 2796 | formatted = '**' + formatted |
| 2797 | |
| 2798 | return formatted |
| 2799 | |
| 2800 | __replace__ = replace |
| 2801 |
no test coverage detected