If the given argument annotation expression is a star unpack e.g. `'*Ts'` rewrite it to a valid expression.
(arg)
| 1102 | |
| 1103 | |
| 1104 | def _rewrite_star_unpack(arg): |
| 1105 | """If the given argument annotation expression is a star unpack e.g. `'*Ts'` |
| 1106 | rewrite it to a valid expression. |
| 1107 | """ |
| 1108 | if arg.lstrip().startswith("*"): |
| 1109 | return f"({arg},)[0]" # E.g. (*Ts,)[0] or (*tuple[int, int],)[0] |
| 1110 | else: |
| 1111 | return arg |
| 1112 | |
| 1113 | |
| 1114 | def _get_and_call_annotate(obj, format): |
no test coverage detected