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