o
    Ñó·iv  ã                   @  sÄ   U d Z ddlmZ ddlZddlmZmZmZmZ ddl	m
Z
mZ edƒZeg ef Zd!dd„Zddl	mZmZ ded< esQedd„ eedeegƒi ƒeƒD ƒƒZd"dd„Zd#dd„Zd$dd „ZdS )%zV
Workaround for U{the lack of TypeForm
<https://github.com/python/mypy/issues/9773>}.
é    )ÚannotationsN)ÚTYPE_CHECKINGÚCallableÚProtocolÚTypeVar)Ú	signatureÚ	SignatureÚTÚxúProtocolAtRuntime[T]ÚreturnÚstrc                 C  s   | j S ©N)Ú__name__)r
   © r   ú[C:\Users\psant\Downloads\PAF backend\school\venv\Lib\site-packages\automat/_runtimeproto.pyÚruntime_name   s   r   )Ú
getmembersÚ
isfunctionúfrozenset[str]ÚemptyProtocolMethodsc                 c  ó   � | ]\}}|V  qd S r   r   ©Ú.0ÚnameZeachr   r   r   Ú	<genexpr>   s
   € ÿ
ÿr   ZExampleÚprotocolÚobjectc                 C  s   t dd„ t| tƒD ƒƒt S )zÔ
    Attempt to ignore implementation details, and get all the methods that the
    protocol actually defines.

    that includes locally defined methods and also those defined in inherited
    superclasses.
    c                 s  r   r   r   r   r   r   r   r   *   s   € z1actuallyDefinedProtocolMethods.<locals>.<genexpr>N)Ú	frozensetr   r   r   )r   r   r   r   ÚactuallyDefinedProtocolMethods!   s   	ÿÿr   ÚmethodúCallable[..., object]ÚitÚannÚNonec                 C  s0   t ||ƒ}t|tƒrt||t|| jƒƒ d S d S r   )ÚgetattrÚ
isinstancer   ÚsetattrÚevalÚ__globals__)r    r"   r#   Ú
annotationr   r   r   Ú_fixAnnotation/   s   

ÿr+   r   c                 C  s4   t | ƒ}|j ¡ D ]}t| |dƒ q	t| |dƒ |S )z5
    Get a signature with evaluated annotations.
    Ú_annotationÚ_return_annotationN)r   Ú
parametersÚvaluesr+   )r    ÚresultÚparamr   r   r   Ú_liveSignature5   s
   r2   )r
   r   r   r   )r   r   r   r   )r    r!   r"   r   r#   r   r   r$   )r    r!   r   r   )Ú__doc__Ú
__future__r   ÚsysÚtypingr   r   r   r   Úinspectr   r   r	   ZProtocolAtRuntimer   r   r   Ú__annotations__r   ÚtypeÚtupler   r   r+   r2   r   r   r   r   Ú<module>   s"    
þ

