Show More
@@ -1028,15 +1028,15 b' def _render_signature(obj_signature, obj_name):' | |||
|
1028 | 1028 | pos_only = False |
|
1029 | 1029 | kw_only = True |
|
1030 | 1030 | for param in obj_signature.parameters.values(): |
|
1031 | if param.kind == _POSITIONAL_ONLY: | |
|
1031 | if param.kind == inspect._POSITIONAL_ONLY: | |
|
1032 | 1032 | pos_only = True |
|
1033 | 1033 | elif pos_only: |
|
1034 | 1034 | result.append('/') |
|
1035 | 1035 | pos_only = False |
|
1036 | 1036 | |
|
1037 | if param.kind == _VAR_POSITIONAL: | |
|
1037 | if param.kind == inspect._VAR_POSITIONAL: | |
|
1038 | 1038 | kw_only = False |
|
1039 | elif param.kind == _KEYWORD_ONLY and kw_only: | |
|
1039 | elif param.kind == inspect._KEYWORD_ONLY and kw_only: | |
|
1040 | 1040 | result.append('*') |
|
1041 | 1041 | kw_only = False |
|
1042 | 1042 | |
@@ -1052,8 +1052,8 b' def _render_signature(obj_signature, obj_name):' | |||
|
1052 | 1052 | else: |
|
1053 | 1053 | rendered = '{}({})'.format(obj_name, ', '.join(result)) |
|
1054 | 1054 | |
|
1055 | if obj_signature.return_annotation is not _empty: | |
|
1056 | anno = formatannotation(obj_signature.return_annotation) | |
|
1055 | if obj_signature.return_annotation is not inspect._empty: | |
|
1056 | anno = inspect.formatannotation(obj_signature.return_annotation) | |
|
1057 | 1057 | rendered += ' -> {}'.format(anno) |
|
1058 | 1058 | |
|
1059 | 1059 | return rendered |
General Comments 0
You need to be logged in to leave comments.
Login now