
    c
                         d dl Z ddlmZ  G d de          Zd Z G d de          Z G d	 d
 e j        e                    ZdS )    N   )typenamec                        e Zd Zd Zd Zd ZdS )VariadicSignatureTypec                 t     t          |          r|j        n|f}| u pt           fd|D                       S )Nc              3   B   K   | ]}t          |j                  V  d S N)
issubclassvariadic_type).0otherselfs     9lib/python3.11/site-packages/multipledispatch/variadic.py	<genexpr>z:VariadicSignatureType.__subclasscheck__.<locals>.<genexpr>   sA       '
 '
6;Jud011'
 '
 '
 '
 '
 '
    )
isvariadicr   all)r   subclass
other_types   `  r   __subclasscheck__z'VariadicSignatureType.__subclasscheck__   si    0:80D0D 'h,,$; 	4 
3 '
 '
 '
 '
?I'
 '
 '
 $
 $
 	
r   c                 t    t          |          o)t          | j                  t          |j                  k    S )a  
        Return True if other has the same variadic type

        Parameters
        ----------
        other : object (type)
            The object (type) to check

        Returns
        -------
        bool
            Whether or not `other` is equal to `self`
        )r   setr   )r   r   s     r   __eq__zVariadicSignatureType.__eq__   s9     5!! DD&''3u/B+C+CC	Er   c                 b    t          t          |           t          | j                  f          S r	   )hashtype	frozensetr   )r   s    r   __hash__zVariadicSignatureType.__hash__    s&    T$ZZ4+=!>!>?@@@r   N)__name__
__module____qualname__r   r   r    r   r   r   r      sI        
 
 
E E E"A A A A Ar   r   c                 ,    t          | t                    S )a)  Check whether the type `obj` is variadic.

    Parameters
    ----------
    obj : type
        The type to check

    Returns
    -------
    bool
        Whether or not `obj` is variadic

    Examples
    --------
    >>> isvariadic(int)
    False
    >>> isvariadic(Variadic[int])
    True
    )
isinstancer   )objs    r   r   r   $   s    ( c0111r   c                       e Zd ZdZd ZdS )VariadicSignatureMetazA metaclass that overrides ``__getitem__`` on the class. This is used to
    generate a new type for Variadic signatures. See the Variadic class for
    examples of how this behaves.
    c                    t          |t          t          f          st          |          st          d          t          |t                    s|f}t	          dt          |          z  dt          |d                    S )NzVVariadic types must be type or tuple of types (Variadic[int] or Variadic[(int, float)]zVariadic[%s]r"   )r   	__slots__)r$   r   tuple
ValueErrorr   r   dict)r   r   s     r   __getitem__z!VariadicSignatureMeta.__getitem__@   s    =4-88 	JD<O<O 	J I J J J -// 	+)NM$Xm444};;;
 
 	
r   N)r   r    r!   __doc__r-   r"   r   r   r'   r'   ;   s-         
 
 
 
 
r   r'   c                       e Zd ZdZdS )VariadicaY  A class whose getitem method can be used to generate a new type
    representing a specific variadic signature.

    Examples
    --------
    >>> Variadic[int]  # any number of int arguments
    <class 'multipledispatch.variadic.Variadic[int]'>
    >>> Variadic[(int, str)]  # any number of one of int or str arguments
    <class 'multipledispatch.variadic.Variadic[(int, str)]'>
    >>> issubclass(int, Variadic[int])
    True
    >>> issubclass(int, Variadic[(int, str)])
    True
    >>> issubclass(str, Variadic[(int, str)])
    True
    >>> issubclass(float, Variadic[(int, str)])
    False
    N)r   r    r!   r.   r"   r   r   r0   r0   N   s           r   r0   )	sixutilsr   r   r   r   r'   with_metaclassr0   r"   r   r   <module>r4      s    



      A A A A AD A A A<2 2 2.
 
 
 
 
D 
 
 
&    !s!"788     r   