|
2 | 2 | """ |
3 | 3 |
|
4 | 4 | import re |
5 | | -from typing import Dict, List, Optional |
| 5 | +from typing import Dict, List, Match, Optional |
6 | 6 |
|
7 | 7 | ARGS_OR_KWARGS_NAME_LIST: List[str] = [ |
8 | 8 | '*args', |
@@ -72,7 +72,7 @@ def get_func_name_list(code_str: str) -> List[str]: |
72 | 72 | break |
73 | 73 | if not_func_str: |
74 | 74 | continue |
75 | | - match: Optional[re.Match] = _get_func_match( |
| 75 | + match: Optional[Match] = _get_func_match( |
76 | 76 | py_module_str=code_str, func_name=func_name) |
77 | 77 | if match is None: |
78 | 78 | continue |
@@ -210,7 +210,7 @@ def get_func_indent_num(py_module_str: str, func_name: str) -> int: |
210 | 210 | ValueError |
211 | 211 | If the target function can not be found. |
212 | 212 | """ |
213 | | - match: Optional[re.Match] = _get_func_match( |
| 213 | + match: Optional[Match] = _get_func_match( |
214 | 214 | py_module_str=py_module_str, func_name=func_name) |
215 | 215 | if match is None: |
216 | 216 | err_msg = 'Target function not found: %s' % func_name |
@@ -273,7 +273,7 @@ def get_func_overall_docstring( |
273 | 273 | docstring : str |
274 | 274 | Target docstring string. |
275 | 275 | """ |
276 | | - match: Optional[re.Match] = _get_func_match( |
| 276 | + match: Optional[Match] = _get_func_match( |
277 | 277 | py_module_str=py_module_str, func_name=func_name) |
278 | 278 | if match is None: |
279 | 279 | return '' |
@@ -366,7 +366,7 @@ def _type_anotation_comment_exists(line_str: str) -> bool: |
366 | 366 | return result |
367 | 367 |
|
368 | 368 |
|
369 | | -def _get_func_match(py_module_str: str, func_name: str) -> Optional[re.Match]: |
| 369 | +def _get_func_match(py_module_str: str, func_name: str) -> Optional[Match]: |
370 | 370 | """ |
371 | 371 | Get a Match object of search result of target function. |
372 | 372 |
|
|
0 commit comments