diff options
author | pravindalve | 2023-05-30 04:20:14 +0530 |
---|---|---|
committer | GitHub | 2023-05-30 04:20:14 +0530 |
commit | cbdd7ca21f1f673a3a739065098f7cc6c9c4b881 (patch) | |
tree | 595e888c38f00a314e751096b6bf636a544a5efe /venv/Lib/site-packages/astroid/_ast.py | |
parent | 7740d1ca0c2e6bf34900460b0c58fa4d528577fb (diff) | |
parent | 280c6aa89a15331fb76b7014957953dc72af6093 (diff) | |
download | Chemical-Simulator-GUI-master.tar.gz Chemical-Simulator-GUI-master.tar.bz2 Chemical-Simulator-GUI-master.zip |
Restructure Project and Deployment
Diffstat (limited to 'venv/Lib/site-packages/astroid/_ast.py')
-rw-r--r-- | venv/Lib/site-packages/astroid/_ast.py | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/venv/Lib/site-packages/astroid/_ast.py b/venv/Lib/site-packages/astroid/_ast.py deleted file mode 100644 index 2e44c1f..0000000 --- a/venv/Lib/site-packages/astroid/_ast.py +++ /dev/null @@ -1,49 +0,0 @@ -import ast -from collections import namedtuple -from functools import partial -from typing import Optional -import sys - -_ast_py2 = _ast_py3 = None -try: - import typed_ast.ast3 as _ast_py3 - import typed_ast.ast27 as _ast_py2 -except ImportError: - pass - - -PY38 = sys.version_info[:2] >= (3, 8) -if PY38: - # On Python 3.8, typed_ast was merged back into `ast` - _ast_py3 = ast - - -FunctionType = namedtuple("FunctionType", ["argtypes", "returns"]) - - -def _get_parser_module(parse_python_two: bool = False): - if parse_python_two: - parser_module = _ast_py2 - else: - parser_module = _ast_py3 - return parser_module or ast - - -def _parse(string: str, parse_python_two: bool = False): - parse_module = _get_parser_module(parse_python_two=parse_python_two) - parse_func = parse_module.parse - if _ast_py3: - if PY38: - parse_func = partial(parse_func, type_comments=True) - if not parse_python_two: - parse_func = partial(parse_func, feature_version=sys.version_info.minor) - return parse_func(string) - - -def parse_function_type_comment(type_comment: str) -> Optional[FunctionType]: - """Given a correct type comment, obtain a FunctionType object""" - if _ast_py3 is None: - return None - - func_type = _ast_py3.parse(type_comment, "<type_comment>", "func_type") - return FunctionType(argtypes=func_type.argtypes, returns=func_type.returns) |