
    Vhv                        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Zddl	mZmZ d	ed
<   es% ed  e ed eeg      i       e      D              ZddZddZddZy)zV
Workaround for U{the lack of TypeForm
<https://github.com/python/mypy/issues/9773>}.
    )annotationsN)TYPE_CHECKINGCallableProtocolTypeVar)	signature	SignatureTc                    | j                   S N)__name__)xs    E/home/dcms/DCMS/lib/python3.12/site-packages/automat/_runtimeproto.pyruntime_namer      s    ::    )
getmembers
isfunctionfrozenset[str]emptyProtocolMethodsc              #  &   K   | ]	  \  }}|  y wr    .0nameeachs      r   	<genexpr>r      s      %D$ 	%   Examplec                P    t        d t        | t              D              t        z
  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              3  &   K   | ]	  \  }}|  y wr   r   r   s      r   r   z1actuallyDefinedProtocolMethods.<locals>.<genexpr>*   s     J:4$Jr   )	frozensetr   r   r   )protocols    r   actuallyDefinedProtocolMethodsr#   !   s&     	JHj)IJJ
	r   c                    t        ||      }t        |t              r"t        ||t	        || j
                               y y r   )getattr
isinstancestrsetattreval__globals__)methoditann
annotations       r   _fixAnnotationr/   /   s6    S!J*c"Cj&*<*<=> #r   c                    t        |       }|j                  j                         D ]  }t        | |d        t        | |d       |S )z5
    Get a signature with evaluated annotations.
    _annotation_return_annotation)r   
parametersvaluesr/   )r+   resultparams      r   _liveSignaturer7   5   sJ    
 vF""))+ 5vum4566#78Mr   )r   zProtocolAtRuntime[T]returnr'   )r"   objectr8   r   )r+   Callable[..., object]r,   r9   r-   r'   r8   None)r+   r:   r8   r	   )__doc__
__future__r   systypingr   r   r   r   inspectr   r	   r
   ProtocolAtRuntimer   r   r   __annotations__r!   typetupler   r#   r/   r7   r   r   r   <module>rE      s   
 # 
 = = (CLRUO  +$ $$ %$T)UH:5F%KZX% ?	r   