o
    7fu                     @  sF  d Z ddlmZ ddlZddlZddlZddlZddlZddl	m
Z
mZ ddlmZmZ ddlmZ ddlmZ ddlmZmZmZmZmZmZmZmZmZmZ dd	lmZm Z m!Z!m"Z"m#Z#m$Z$ G d
d de"Z%G dd de"Z&d4ddZ'	d5ddddd6d!d"Z(G d#d$ d$Z)G d%d& d&eZ*d7d(d)Z+d8d+d,Z,	d9d:d2d3Z-dS );zTStub generator for C modules.

The public interface is via the mypy.stubgen module.
    )annotationsN)FunctionType
ModuleType)AnyMapping)parse_type_comment)is_c_module)
ArgSigFunctionSigSigfind_unique_signatures!infer_arg_sig_from_anon_docstringinfer_prop_type_from_docstring&infer_ret_type_sig_from_anon_docstring!infer_ret_type_sig_from_docstringinfer_sig_from_docstringparse_all_signatures)BaseStubGenerator	ClassInfoFunctionContextSignatureGeneratorinfer_method_arg_typesinfer_method_ret_typec                   @  s<   e Zd Z	ddddZedddZdddZdddZdS )ExternalSignatureGeneratorN	func_sigsdict[str, str] | None
class_sigsreturnNonec                 C  s   |pi | _ |pi | _dS )z
        Takes a mapping of function/method names to signatures and class name to
        class signatures (usually corresponds to __init__).
        N)r   r   )selfr   r    r    F/home/ertert/spirit/venv/lib/python3.10/site-packages/mypy/stubgenc.py__init__*   s   
z#ExternalSignatureGenerator.__init__doc_dirstrc           
   	   C  s   g }g }t  | dD ]&}t|}t| \}}W d   n1 s%w   Y  ||7 }||7 }qtt|}tt|}	t||	S )z+Instantiate from a directory of .rst files.z/*.rstN)globopenr   	readlinesdictr   r   )
clsr#   all_sigsall_class_sigspathfloc_sigsloc_class_sigssigsr   r    r    r!   from_doc_dir4   s   


z'ExternalSignatureGenerator.from_doc_dirdefault_sigr
   ctxr   list[FunctionSig] | Nonec                 C  s   |j r(|jdv r(|j| jvr(|j j| jv r(t|jt| j|j j t|jdgS |j| jvr0d S t|jt| j|j d dg}|j rJ| ||j jS |S )N__new__r"   nameargsret_type)	
class_infor8   r   r   r
   r   r   remove_self_typeself_varr   r2   r3   inferredr    r    r!   get_function_sigB   s,   
	z+ExternalSignatureGenerator.get_function_sigdefault_type
str | Nonec                 C  s   d S Nr    )r   rA   r3   r    r    r!   get_property_typed   s   z,ExternalSignatureGenerator.get_property_type)NN)r   r   r   r   r   r   )r#   r$   r   r   r2   r
   r3   r   r   r4   rA   rB   r3   r   r   rB   )__name__
__module____qualname__r"   classmethodr1   r@   rD   r    r    r    r!   r   )   s    

"r   c                   @  s    e Zd ZdddZdddZdS )DocstringSignatureGeneratorr2   r
   r3   r   r   r4   c                 C  s   t |j|j}|r|jd usJ t|j|jr|d= |jr>|s6|jdkr6t |jj|jj}|r6dd |D }| ||jjS |S )Nr"   c                 S  s   g | ]}|j d dqS )r"   r8   )_replace.0sigr    r    r!   
<listcomp>x       z@DocstringSignatureGenerator.get_function_sig.<locals>.<listcomp>)r   	docstringr8   )is_pybind11_overloaded_function_docstringr;   r<   r=   r>   r    r    r!   r@   i   s   z,DocstringSignatureGenerator.get_function_sigrA   rB   c                 C  sD   |j dur t|j }|r|S t|j |j}|r|S t|j }|S dS )z:Infer property type from docstring or docstring signature.N)rT   r   r   r8   r   )r   rA   r3   r?   r    r    r!   rD   }   s   


z-DocstringSignatureGenerator.get_property_typeNrE   rF   )rG   rH   rI   r@   rD   r    r    r    r!   rK   h   s    
rK   rT   r$   r8   r   boolc                 C  s   |  | dS )Nz((*args, **kwargs)
Overloaded function.


startswith)rT   r8   r    r    r!   rU      s   rU    Finclude_privateexport_lessinclude_docstringsmodule_nametargetknown_modules	list[str]r#   r[   r\   r]   r   c                C  s   t j|}|rt j|st | t| |||||d}|  | }	t|d}
|
	|	 W d   dS 1 s;w   Y  dS )a  Generate stub for C module.

    Signature generators are called in order until a list of signatures is returned.  The order
    is:
    - signatures inferred from .rst documentation (if given)
    - simple runtime introspection (looking for docstrings and attributes
      with simple builtin types)
    - fallback based special method names or "(*args, **kwargs)"

    If directory for target doesn't exist it will be created. Existing stub
    will be overwritten.
    rZ   wN)
osr,   dirnameisdirmakedirsInspectionStubGeneratorgenerate_moduleoutputr&   write)r^   r_   r`   r#   r[   r\   r]   subdirgenri   filer    r    r!   generate_stub_for_c_module   s    
"rn   c                   @  sF   e Zd ZdZddd
dZeddddZeddddZdddZdS )CFunctionStubzR
    Class that mimics a C function in order to provide parseable docstrings.
    Fr8   r$   docis_abstractrV   r   r   c                 C  s   || _ || _|| _d S rC   )rG   __doc____abstractmethod__)r   r8   rp   rq   r    r    r!   r"      s   
zCFunctionStub.__init__rQ   r
   c                 C  s   t |j| d d |S N)ro   r8   
format_sig)r)   rQ   rq   r    r    r!   	_from_sig   s   zCFunctionStub._from_sigr0   list[FunctionSig]c                 C  s"   t |d jddd |D |S )Nr   
c                 s  s     | ]}|  d d V  qd S rt   )rv   rO   r    r    r!   	<genexpr>   s    z+CFunctionStub._from_sigs.<locals>.<genexpr>)ro   r8   join)r)   r0   rq   r    r    r!   
_from_sigs   s   zCFunctionStub._from_sigsc                 C  s   dS )z
        This exists to make this object look like a method descriptor and thus
        return true for CStubGenerator.ismethod()
        Nr    r   r    r    r!   __get__   s   zCFunctionStub.__get__N)F)r8   r$   rp   r$   rq   rV   r   r   )rQ   r
   rq   rV   r   ro   )r0   rx   rq   rV   r   ro   r   r   )	rG   rH   rI   rr   r"   rJ   rw   r|   r~   r    r    r    r!   ro      s    ro   c                      sJ  e Zd ZdZ						dhdi fddZdjddZdkddZdld!d"Zdmd%d&Zdnd'd(Z	dod)d*Z
dpd,d-Zdqd/d0Zdrd1d2Zdnd3d4Zdsd8d9Zdsd:d;Zdtd=d>Zednd?d@ZedsdAdBZedudEdFZdndGdHZdvdKdLZddMdwdOdPZdxdRdSZdydTdUZ	dzd{dZd[Zd|d^d_Zd}d`daZd~dddeZddfdgZ  Z S )rg   zStub generator that does not parse code.

    Generation is performed by inspecting the module's contents, and thus works
    for highly dynamic modules, pyc files, and C modules (via the CStubGenerator
    subclass).
    rY   NFr^   r$   r`   ra   r#   _all_list[str] | Noner[   rV   r\   r]   moduleModuleType | Noner   r   c	           	        sv   || _ |d u rt|| _n|| _t| j| _|| _| j| _t |||| || _	| jr9| j
dg di d S d S )Ntyping)r   CallableClassVarDictIterableIteratorList
NamedTupleOptionalTupleUnion)r#   	importlibimport_moduler   r   r`   resort_memberssuperr"   r^   known_importsupdate)	r   r^   r`   r#   r   r[   r\   r]   r   	__class__r    r!   r"      s   z InspectionStubGenerator.__init__funcobjectr3   r   r
   c                   s  d }j szt|}W n	 ty   Y nw |d u r@|jd ur0t|jt|j|jjt	|jdS t|jt
ddt
ddgd dS |j}|j}|j}|j}|j d fd	d
}g }	t|D ]O\}
}|r|
t|t| kr||
t|t|   }| v r | }n|}|dkrd}| d}|	t
||dd q]|	t
|||dd q]|r|	t
d| || |r|	t
d| || |jd urtdd |	D rt|j|jjdd |	D }|d ur|}	|dpt	|j}t|j|	|S )Nr7   *argsrM   **kwargskeyr$   r   rB   c                   s8   |  vrd S  |  }|d u rdS t |ts|S |S )Nr   )
isinstancer$   get_type_fullname)r   argtyper   r   r    r!   get_annotation'  s   

zHInspectionStubGenerator.get_default_function_sig.<locals>.get_annotationr   _typeshed.Incompletez | NoneT)defaultF*z**c                 s  s$    | ]}|j d u o|jdu V  qd S )NF)typer   rP   argr    r    r!   rz   M  s    
zCInspectionStubGenerator.get_default_function_sig.<locals>.<genexpr>c                 S  s   g | ]}|j r|j qS r    rM   r   r    r    r!   rR   Q  rS   zDInspectionStubGenerator.get_default_function_sig.<locals>.<listcomp>)r   r$   r   rB   )r   inspectgetfullargspec	TypeErrorr;   r
   r8   infer_c_method_argsr=   r   r	   r9   defaultsvarargsvarkwr   	enumeratelenget_type_annotationadd_nameappendallr   )r   r   r3   argspecr9   r   r   kwargsr   arglistir   default_valuer   
incompletenew_argsr:   r    r   r!   get_default_function_sig  sf   





z0InspectionStubGenerator.get_default_function_siglist[SignatureGenerator]c                 C  s0   | j sg S t g}| jr|dt| j |S Nr   )r   rK   r#   insertr   r1   )r   sig_generatorsr    r    r!   get_sig_generatorsY  s   z*InspectionStubGenerator.get_sig_generators	type_namec                 C  s<   d| j g}t|dddd }|dusJ || || j|S )a  Strips unnecessary module names from typ.

        If typ represents a type that is inside module or is a type coming from builtins, remove
        module declaration from it. Return stripped name of the type.

        Arguments:
            typ: name of the type
        builtinsr   N   )r^   r   print_annotationr`   )r   r   local_modulesparsed_typer    r    r!   strip_or_importc  s   
	z'InspectionStubGenerator.strip_or_importobjrB   c                 C  s   t |ddS )z!Return module name of the object.rH   Ngetattrr   r   r    r    r!   get_obj_moduleq     z&InspectionStubGenerator.get_obj_modulec                 C  s   |  |}|du p|| jkS )z<Check if object is considered defined in the current module.N)r   r^   )r   r   r   r    r    r!   is_defined_in_moduleu  s   
z,InspectionStubGenerator.is_defined_in_modulec                 C  s  |  | j}| jrt|dd d}g }|D ]}\}}t|ra|j| jv ra|j}|| j	d rS|
dd\}}|t| j	d  pAd}| j|||fg | j| q| j|| | j| q| |rst|ss|||f q| |}	|	r| j|	|d fg | j||	ddr| j| q| dd	 |D  | jrg }
g }g }ng }| }
 }}|D ](\}}| |r| j|||
d
 qt|r| j|||d
 q| j|||d
 qg | _| jr-|D ]
}| j|d  q|D ] }|dr| jr| jd r| jd | j|d  q| jr|
r| jd |
D ]}| j|d  q nQt|D ]L\}}| jr[|dr[| jd drnt||d kr[||d  dsn| jrt| jd drt|dst| jd | j|d  q1|   d S )Nc                 S  s   | d S r   r    xr    r    r!   <lambda>}  s    z9InspectionStubGenerator.generate_module.<locals>.<lambda>r   .r   F)name_is_aliasc                 S  s   h | ]\}}t |s|qS r    )r   ismodule)rP   r8   r   r    r    r!   	<setcomp>  s    z:InspectionStubGenerator.generate_module.<locals>.<setcomp>)ri   ry   classrL       def)get_membersr   r   sortedr   r   rG   r`   rX   r^   rsplitr   import_trackeradd_import_fromreexport
add_importr   r   r   should_reexportset_defined_namesis_functiongenerate_function_stubisclassgenerate_class_stubgenerate_variable_stub_outputr   check_undefined_names)r   	all_itemsitemsr8   r   r^   pkg_namemod_name
rel_moduleobj_module_name	functionstypes	variablesri   liner   r    r    r!   rh   z  s   


 &z'InspectionStubGenerator.generate_moduleattrc                 C  s$   |dv p|| j v pt|pt|S )N)	r   __getattribute____str____repr__rr   __dict__rH   __weakref____annotations__)IGNORED_DUNDERSis_pybind_skipped_attributekeyword	iskeyword)r   r   r    r    r!   is_skipped_attribute  s   z,InspectionStubGenerator.is_skipped_attributelist[tuple[str, Any]]c              	   C  sX   t |d}g }|D ] }| |rq	zt ||}W n	 ty!   Y q	w |||f q	|S )Nr   )r   r   AttributeErrorr   )r   r   obj_dictresultsr8   valuer    r    r!   r     s   

z#InspectionStubGenerator.get_membersc                 C  sl   |du s
|t du rdS t|rd| |S t|tr#| dS t|tr/| jdddS | t |S )z
        Given an instance, return a string representation of its type that is valid
        to use as a type annotation.
        Nr   ztype[{}]ztyping.Callableztypes.ModuleTypeF)require)	r   r   r   formatr   r   r   r   r   r   r    r    r!   r     s   



z+InspectionStubGenerator.get_type_annotationc                 C  s   | j rt|S t|S rC   )r   r   	isbuiltin
isfunctionr   r    r    r!   r     s   

z#InspectionStubGenerator.is_functionr;   r   r8   c                 C  s>   | j rt|pt|ttjttjttjfv S t|S rC   )	r   r   ismethoddescriptorr   r$   index__add__r6   r  r   r;   r8   r   r    r    r!   	is_method   s   
z!InspectionStubGenerator.is_methodc                 C  s(   | j rt|pt|jdv S t|S )N)rJ   classmethod_descriptor)r   r   r  r   rG   ismethodr  r    r    r!   is_classmethod  s   
z&InspectionStubGenerator.is_classmethodClassInfo | Nonec                 C  sH   |d u rdS | j rt|jd}|||}t|tS tt|j|tS )NFr   )r   r   r)   getr   staticmethodr   getattr_static)r   r;   r8   r   
raw_lookup	raw_valuer    r    r!   is_staticmethod  s   
z'InspectionStubGenerator.is_staticmethodc                 C  s   t | ddS )Nrs   Fr   )r   r    r    r!   is_abstract_method  r   z*InspectionStubGenerator.is_abstract_methodc                 C  s   t |p	t|dS )Nfget)r   isdatadescriptorhasattr)r;   r8   r   r    r    r!   is_property"     z#InspectionStubGenerator.is_propertypropr   c                 C  s   t | do	| jd u S )Nfset)r  r  )r  r    r    r!   is_property_readonly&  r  z,InspectionStubGenerator.is_property_readonlyc                 C  s   | j r
t|jdv S dS )z=For c-modules, whether the property behaves like an attribute)pybind11_static_propertyStaticPropertyF)r   r   rG   r   r    r    r!   is_static_property*  s   z*InspectionStubGenerator.is_static_propertyr?   rx   c                 C  s\   t |D ]'\}}|jD ]}|jd ur| |j|_q|jd ur+|j| |jd||< qd S )N)r:   )r   r9   r   r   r:   rN   )r   r?   r   rQ   r   r    r    r!   process_inferred_sigs2  s   


z-InspectionStubGenerator.process_inferred_sigs)r;   ri   c                C  sz  t |dd}t|tsd}t| j||| ||d}| ||js&| |r(dS | 	|j
 | ||}| || j|}| | g }	t|dkrT|	d| d |jrb|	d| d |dur| |||rs|	d n/|D ]}
|
jr|
jd	 j
d
vr|
jd	t|jd qu|d	 jr|d	 jd	 j
dkr|	d |r| |}|| j||	|d | ||| dS )a(  Generate stub for a single function or method.

        The result (always a single line) will be appended to 'output'.
        If necessary, any required names will be added to 'imports'.
        The 'class_name' is used to find signature of __init__ or __new__ in
        'class_sigs'.
        rr   NrT   rq   r;   r   z@{}ztyping.overloadzabc.abstractmethodz@staticmethodr   )r   r)   rM   r)   z@classmethod)
decoratorsrT   )r   r   r$   r   r^   r  is_private_namefullnameis_not_in_allrecord_namer8   r   get_signaturesr   r$  r   r   r  r   rq   r  r9   r   r	   r=   _indent_docstringextendformat_func_def	_fix_iter)r   r8   r   ri   r;   rT   r3   r2   r?   r&  rQ   r    r    r!   r   :  sD   




z.InspectionStubGenerator.generate_function_stubrT   c                   s   |j dd}| jd  t|dkr5t fdd|D s5t|dd D ]\}}| r4 | ||d < q$|d d	rRt|dkrH|  n
|d dd |d< d
|S )zQFix indentation of docstring extracted from pybind11 or other binding generators.T)keependsr   r   c                 3  s$    | ]}|  p|  V  qd S rC   )rX   strip)rP   r   indentr    r!   rz   s  s   " z<InspectionStubGenerator._indent_docstring.<locals>.<genexpr>NrL   ry   rY   )	
splitlines_indentr   r   r   r1  endswithr   r{   )r   rT   linesr   r   r    r2  r!   r,  n  s   

z)InspectionStubGenerator._indent_docstringc                 C  s   |j rG|j jdurI|jdkrKd|j jjvrMd}|D ]}|jr+|jd jdkr+|j} nq|du r2dS tdd| d}| jd|||j d dS dS dS dS dS )	zqEnsure that objects which implement old-style iteration via __getitem__
        are considered iterable.
        N__getitem____iter__rL   intz&def __iter__(self) -> typing.Iterator[z]
ri   r;   )	r;   r)   r8   r   r9   r   r:   ro   r   )r   r3   r?   ri   	item_typerQ   r   r    r    r!   r/    s*   
z!InspectionStubGenerator._fix_iterraw_objstatic_propertiesrw_propertiesro_propertiesc              
   C  s  t |dd}t |dd}	|	r#t |	dd}
|
r|r|d|
 7 }n|
r#|
}t| j||d|d}| ||js9| |r;dS | |j | |}| 	|}|rV| 
| |}n	| ||}|j}| || j|}|durp| 
|}|r| d}|r{dnd	}|du r| d
}|| j | d| d| d|  dS |r|| j d t|tdg|}||j| jd dS |du r| d
}|| j | d|  dS )a  Generate property stub using introspection of 'obj'.

        Try to infer type from docstring, append resulting lines to 'output'.

        raw_obj : object before evaluation of descriptor (if any)
        obj : object after evaluation of descriptor
        rr   Nr  ry   Fr%  typing.ClassVarz  # read-onlyrY   r   : [] = ...z	@propertyr   r2  )r   r   r^   r'  r(  r)  r*  r8   r#  r   r   r   r   r:   rD   r   r   r   r5  r
   r	   rv   )r   r8   r=  r   r>  r?  r@  r;   rT   r  
alt_docstrr3   staticreadonlyr:   r2   inferred_typeclassvartrailing_commentrQ   r    r    r!   generate_property_stub  sL   





z.InspectionStubGenerator.generate_property_stubtypr   c                 C  sN   |t u rdS t|d|j}| |}|dusJ ||dkr%| d| }|S )z,Given a type, return a string representationr   rI   Nr   r   )r   r   rG   r   )r   rL  typenamer^   r    r    r!   r     s   
z)InspectionStubGenerator.get_type_fullnamec                   s   t |}|d tu r|d= |r|d jdkr|d= |dd  }g }|D ] t fdd|D s6|  q$fdd|D S )NrL   pybind11_objectr   c                 3  s    | ]}t | V  qd S rC   )
issubclass)rP   b)baser    r!   rz     s    z9InspectionStubGenerator.get_base_types.<locals>.<genexpr>c                   s   g | ]
}   |qS r    )r   r   )rP   rQ  r}   r    r!   rR     s    z:InspectionStubGenerator.get_base_types.<locals>.<listcomp>)r   mror   rG   anyr   )r   r   	all_basesbasesr    )rQ  r   r!   get_base_types  s   

z&InspectionStubGenerator.get_base_types
class_namer)   c              
   C  s  t |d}| |}| jrt|dd d}dd |D }g }g }g }	g }
g }g }| | |   t|dt |dd	|}|D ]r\}}|||}| |||sV| 	|||r|d
krad|v r_q>d}| 
|||rld|_n| 	|||rwd|_nd|_| j||||d q>| |||r| ||||	|
|| q>t|r| |r| ||| q>|||f q>|D ]+\}}|dkr|d	u rq| | |}| d}|	| j | d| d| d q|   | |}|rdd| }nd}|s|	s|
s|s|re|| j d| | d |D ]'}|r0|d r0|d  ds0| dr0|d || q|	D ]}|| q9|
D ]}|| qD|D ]}|| qO|D ]}|| qZd	S || j d| | d d	S )zGenerate stub for a single class using runtime introspection.

        The result lines will be appended to 'output'. If necessary, any
        required names will be added to 'imports'.
        r   c                 S  s   t | d S r   )method_name_sort_keyr   r    r    r!   r     s    z=InspectionStubGenerator.generate_class_stub.<locals>.<lambda>r   c                 S  s   h | ]}|d  qS )r   r    )rP   r   r    r    r!   r     s    z>InspectionStubGenerator.generate_class_stub.<locals>.<setcomp>rY   rr   Nr6   r"   r)   r   r;  __hash__rA  rB  rC  rD  z(%s)z, zclass :rL   r   z: ...)r   r   r   r   r*  r3  r   r  r  r  r  r=   r   r  rK  r   r   r   r   r   r   r   r   r5  dedentrV  r{   r1  rX   )r   rW  r)   ri   r  r   namesmethodsr   r>  r?  r@  attrsr;   r   r  r  prop_type_namerI  rU  	bases_strr   r    r    r!   r     s   


	
$

 z+InspectionStubGenerator.generate_class_stubc                 C  sX   |  || j d| s| |rdS | | | | |}|| d|  dS )zGenerate stub for a single variable using runtime introspection.

        The result lines will be appended to 'output'. If necessary, any
        required names will be added to 'imports'.
        r   NrB  )r'  r^   r)  r*  r   r   r   )r   r8   r   ri   type_strr    r    r!   r   Y  s
   "
z.InspectionStubGenerator.generate_variable_stub)rY   NFFFN)r^   r$   r`   ra   r#   r$   r   r   r[   rV   r\   rV   r]   rV   r   r   r   r   )r   r   r3   r   r   r
   )r   r   )r   r$   r   r$   )r   r   r   rB   )r   r   r   rV   r   r   r$   r   rV   )r   r   r   r   )r   r   r   r$   )r;   r   r8   r$   r   r   r   rV   )r;   r  r8   r$   r   r   r   rV   )r  r   r   rV   )r?   rx   r   r   )
r8   r$   r   r   ri   ra   r;   r  r   r   )rT   r$   r   r$   )r3   r   r?   rx   ri   ra   r   r   rC   )r8   r$   r=  r   r   r   r>  ra   r?  ra   r@  ra   r;   r  r   r   )rL  r   r   r$   )r   r   r   ra   )rW  r$   r)   r   ri   ra   r   r   )r8   r$   r   r   ri   ra   r   r   )!rG   rH   rI   rr   r"   r   r   r   r   r   rh   r   r   r   r   r  r  r  r  r  r  r   r#  r$  r   r,  r/  rK  r   rV  r   r   __classcell__r    r    r   r!   rg      sP    
*
R





N





	


	
4
 
C

arg   tuple[int, str]c                 C  s4   | dv rd| fS |  dr| drd| fS d| fS )ziSort methods in classes in a typical order.

    I.e.: constructor, normal methods, special methods.
    r5   r   __   r   )rX   r6  rM   r    r    r!   rX  f  s
   rX  r   c                 C  s
   |  dS )N__pybind11_module_local_rW   )r   r    r    r!   r   r  s   
r   r   r=   	arg_namesr   list[ArgSig]c                 C  s  d }|  dr| dr| dd } | dv rg }n| dkr$tddg}n| dkr3tddtd	dg}n| d
v r>tddg}n}| dkrMtddtddg}nn| dkrTg }ng| dkr_tddg}n\| dv rktdd	dg}nP| dv rvtddg}nE| dv r}g }n>| dkrtddtddg}n/| dkrtddtddg}n | dkrtddg}n| dkrtdddtdddtd d!dg}|d u rt| ||}nt|dg| }|d u rtd"dtd#dg}|S )$Nre  rf  )hashiternextsizeofcopydeepcopyreducegetinitargsr:  floattrunccomplexrV   absbytesdirr   reversedroundr
  entergetitemr
  rM   setitemr   )delattrr   r8   setattrr  getstatesetstatestate)eqneltlegtgeother)r8   r   )(addraddsubrsubmulrmulmodrmodfloordiv	rfloordivtruedivrtruedivdivmodrdivmodpowrpowxorrxororrorandrandlshiftrlshiftrshiftrrshiftcontainsdelitemiaddiand	ifloordivilshiftimodimulioripowirshiftisubitruedivixor)negposinvertr  instanceownerset	reduce_exprotocolexitr   ztype[BaseException] | NonezBaseException | None	tracebackztypes.TracebackType | Noner   r   )rX   r6  r	   r   )r8   r=   rh  r9   r    r    r!   r   v  sP   *


r   )rT   r$   r8   r$   r   rV   )rY   )r^   r$   r_   r$   r`   ra   r#   r$   r[   rV   r\   rV   r]   rV   r   r   )r8   r$   r   rd  rb  )r   N)r8   r$   r=   r$   rh  r   r   ri  ).rr   
__future__r   r%   r   r   r   os.pathrc   r   r   r   r   r   r   mypy.fastparser   mypy.moduleinspectr   mypy.stubdocr	   r
   r   r   r   r   r   r   r   r   mypy.stubutilr   r   r   r   r   r   r   rK   rU   rn   ro   rg   rX  r   r   r    r    r    r!   <module>   sB   0 
?
$)     

