B
    S\                 @   s   d dl Z d dlmZ d dlmZ d dlmZ d dlZd ZZ	yd dl
mZ	 d dlmZ W n ek
rl   Y nX edddgZded	d
dZdeedddZeee dddZdS )    N)
namedtuple)partial)OptionalFunctionTypeargtypesreturnsF)parse_python_twoc             C   s   | r
t }nt}|ptS )N)_ast_py2_ast_py3ast)r   Zparser_module r   +lib/python3.7/site-packages/astroid/_ast.py_get_parser_module   s    r   )stringr   c             C   s0   t |d}|j}tr(|s(t|tjjd}|| S )N)r   )Zfeature_version)r   parser
   r   sysversion_infominor)r   r   Zparse_moduleZ
parse_funcr   r   r   _parse   s
    
r   )type_commentreturnc             C   s*   t dkrdS t | dd}t|j|jdS )z:Given a correct type comment, obtain a FunctionType objectNz<type_comment>	func_type)r   r   )r
   r   r   r   r   )r   r   r   r   r   parse_function_type_comment"   s    r   )F)F)r   collectionsr   	functoolsr   typingr   r   r	   r
   Ztyped_ast.ast3Zast3Ztyped_ast.ast27Zast27ImportErrorr   boolr   strr   r   r   r   r   r   <module>   s   