§
    xÅj®E  ã                   ó¢  — U d Z ddl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	 ddl
mZmZmZ ddlmZmZ ddlZddlmZmZmZmZ dZej        dd…         d	k    Zd
ededefd„Zd
ededefd„Z edd¦  «        Zde_          edd¦  «        Zde_          edd¦  «        Zde_          edd¦  «        Zde_          edd¦  «        Zde_          edd¦  «        Zd e_          ed!d"¦  «        Z d#e _          ed$d%¦  «        Z!d&e!_          ed'd(¦  «        Z"d)e"_          ed*d+¦  «        Z#d,e#_          ed-d.¦  «        Z$d/e$_          ed0d1¦  «        Z%d2e%_         d3ede&fd4„Z' ed5d6¦  «        Z(d7e(_          ed8d9¦  «        Z)d:e)_          ed;d<¦  «        Z*d=e*_          ed>d?¦  «        Z+d@e+_          edAdB¦  «        Z,dCe,_          edDdE¦  «        Z-dFe-_          edGdH¦  «        Z.dIe._          edJdK¦  «        Z/dLe/_          edMdN¦  «        Z0dOe0_          edPdQ¦  «        Z1dRe1_          edSdT¦  «        Z2dUe2_          edVdW¦  «        Z3dXe3_          edYdZ¦  «        Z4d[e4_          ed\d]¦  «        Z5d^e5_          ed_d`¦  «        Z6dae6_          edbdc¦  «        Z7er	d3edddfde„Z8n edbdf¦  «        Z8dge8_          edhdi¦  «        Z9dje9_         ej        dkk    rej        ej        fZ:d3eddlfdm„Z;nej        Z<d3eddlfdn„Z;doe;_         i ej=        ej>        j=        “ej?        ej>        j?        “ej@        ej>        j@        “ejA        ej>        jA        “ejB        ej>        jB        “ejC        ej>        jC        “ejD        ej>        jD        “ejE        ej>        jE        “ejF        ej>        jF        “ejG        ej>        jG        “ejH        ej>        jH        “ejI        ej>        jI        “ejJ        ej>        jK        “ejL        ej>        jL        “ejM        ej>        jM        “ejN        ej>        jN        “ejO        ej>        jO        “i ejP        ej>        jP        “ejQ        eR“ejS        eT“ejU        ejV        “ejK        eW“ejX        eY“ejZ        ej>        jZ        “ej[        ej>        j[        “ej\        ej>        j\        “ej]        ej>        j]        “ej^        e_“ej`        eja        “ejb        ejb        “ejc        ejc        “ejd        ejd        “eje        ej>        je        “ejf        ej>        jf        “¥ejg        eheji        eji        ejj        ejj        ejk        ejl        ejm        ejn        i¥Zoee_eehe         f                  epdp<   	 dq„ eo q                    ¦   «         D ¦   «         Zree_esehe         f                  epdr<   	  eTeo q                    ¦   «         ¦  «        D ]\  ZtZu eveetjw        d¦  «        xZx�eueoex<   ŒdS )szÏLow-level introspection utilities for [`typing`][] members.

The provided functions in this module check against both the [`typing`][] and [`typing_extensions`][]
variants, if they exists and are different.
é    N)Údedent)ÚFunctionTypeÚGenericAliasÚNoneType)ÚAnyÚFinal)ÚLiteralStringÚTypeAliasTypeÚTypeIsÚ
deprecated)"ÚDEPRECATED_ALIASESÚDEPRECATED_ALIASES_IDSr   Úis_annotatedÚis_anyÚis_classvarÚis_concatenateÚis_deprecatedÚis_finalÚis_forwardrefÚ
is_genericÚ
is_literalÚis_literalstringÚis_namedtupleÚis_neverÚ
is_newtypeÚis_nodefaultÚis_noextraitemsÚis_noreturnÚis_notrequiredÚis_paramspecÚis_paramspecargsÚis_paramspeckwargsÚis_readonlyÚis_requiredÚis_selfÚis_typealiasÚis_typealiastypeÚis_typeguardÚ	is_typeisÚ
is_typevarÚis_typevartupleÚis_unionÚ	is_unpacké   )é   é
   ÚmemberÚfunction_nameÚreturnc                 óØ  — t          t          | ¦  «        }t          t          | ¦  «        }dt          i}|rE|rCt	          t          | ¦  «        }t	          t          | ¦  «        }||u r||d<   d}nM||d<   ||d<   d}n@|r|st	          t          | ¦  «        |d<   d}n!|s|rt	          t          | ¦  «        |d<   d}nd}t          d|› d	|› d
�¦  «        }i }	t          |||	¦  «         |	|         S )as  Create a function checking that the function argument is the (unparameterized) typing `member`.

    The function will make sure to check against both the `typing` and `typing_extensions`
    variants as depending on the Python version, the `typing_extensions` variant might be different.
    For instance, on Python 3.9:

    ```pycon
    >>> from typing import Literal as t_Literal
    >>> from typing_extensions import Literal as te_Literal, get_origin

    >>> t_Literal is te_Literal
    False
    >>> get_origin(t_Literal[1])
    typing.Literal
    >>> get_origin(te_Literal[1])
    typing_extensions.Literal
    ```
    r   Ú_objzobj is _objÚ_t_objÚ_te_objzobj is _t_obj or obj is _te_objÚFalseú	
    def z&(obj: Any, /) -> bool:
        return ú
    ©ÚhasattrÚtypingÚtyping_extensionsr   Úgetattrr   Úexec©
r1   r2   Ú	in_typingÚin_typing_extensionsÚglobals_Út_objÚte_objÚ
check_codeÚ	func_codeÚlocals_s
             úQC:\Projects\Historical\venv\Lib\site-packages\typing_inspection/typing_objects.pyÚ _compile_identity_check_functionrK   =   sF  € õ& � Ñ'Ô'€IÝ"Õ#4°fÑ=Ô=Ðà %¥s˜|€Hàð Ð)ð õ � Ñ'Ô'ˆÝÕ*¨FÑ3Ô3ˆØ�Fˆ?ˆ?Ø$ˆH�VÑØ&ˆJˆJà!&ˆH�XÑØ"(ˆH�YÑØ:ˆJˆJØ	ð Ð/ð Ý"¥6¨6Ñ2Ô2ˆ�ÑØ"ˆ
ˆ
Øð Ð/ð Ý"Õ#4°fÑ=Ô=ˆ�ÑØ"ˆ
ˆ
àˆ
åð Ø	ðð àðð ð ñ 	ô 	€Ið
 !€GÝˆ�H˜gÑ&Ô&Ð&Ø�=Ô!Ð!ó    c           	      óØ  — t          t          | ¦  «        }t          t          | ¦  «        }dt          i}|rB|r@t	          t          | ¦  «        }t	          t          | ¦  «        }||u r||d<   d}nJ||f|d<   d}n@|r|st	          t          | ¦  «        |d<   d}n!|s|rt	          t          | ¦  «        |d<   d}nd}t          d|› d| › d	|› d
�¦  «        }i }	t          |||	¦  «         |	|         S )a  Create a function checking that the function is an instance of the typing `member`.

    The function will make sure to check against both the `typing` and `typing_extensions`
    variants as depending on the Python version, the `typing_extensions` variant might be different.
    r   r5   zisinstance(obj, _obj)Ú_objszisinstance(obj, _objs)r8   r9   z(obj: Any, /) -> 'TypeIs[z]':
        return r:   r;   rA   s
             rJ   Ú"_compile_isinstance_check_functionrO   t   sM  € õ � Ñ'Ô'€IÝ"Õ#4°fÑ=Ô=Ðà %¥s˜|€Hàð Ð)ð õ � Ñ'Ô'ˆÝÕ*¨FÑ3Ô3ˆØ�Fˆ?ˆ?Ø$ˆH�VÑØ0ˆJˆJà!&¨ ˆH�WÑØ1ˆJˆJØ	ð Ð/ð Ý"¥6¨6Ñ2Ô2ˆ�ÑØ,ˆ
ˆ
Øð Ð/ð Ý"Õ#4°fÑ=Ô=ˆ�ÑØ,ˆ
ˆ
àˆ
åð Ø	ðð Ø17ðð àðð ð ñ 	ô 	€Ið
 !€GÝˆ�H˜gÑ&Ô&Ð&Ø�=Ô!Ð!rL   Ú	Annotatedr   z±
Return whether the argument is the [`Annotated`][typing.Annotated] [special form][].

```pycon
>>> is_annotated(Annotated)
True
>>> is_annotated(Annotated[int, ...])
False
```
r   r   zm
Return whether the argument is the [`Any`][typing.Any] [special form][].

```pycon
>>> is_any(Any)
True
```
ÚClassVarr   z¬
Return whether the argument is the [`ClassVar`][typing.ClassVar] [type qualifier][].

```pycon
>>> is_classvar(ClassVar)
True
>>> is_classvar(ClassVar[int])
>>> False
```
ÚConcatenater   z»
Return whether the argument is the [`Concatenate`][typing.Concatenate] [special form][].

```pycon
>>> is_concatenate(Concatenate)
True
>>> is_concatenate(Concatenate[int, P])
False
```
r   r   z–
Return whether the argument is the [`Final`][typing.Final] [type qualifier][].

```pycon
>>> is_final(Final)
True
>>> is_final(Final[int])
False
```
Ú
ForwardRefr   zˆ
Return whether the argument is an instance of [`ForwardRef`][typing.ForwardRef].

```pycon
>>> is_forwardref(ForwardRef('T'))
True
```
ÚGenericr   zž
Return whether the argument is the [`Generic`][typing.Generic] [special form][].

```pycon
>>> is_generic(Generic)
True
>>> is_generic(Generic[T])
False
```
ÚLiteralr   z 
Return whether the argument is the [`Literal`][typing.Literal] [special form][].

```pycon
>>> is_literal(Literal)
True
>>> is_literal(Literal["a"])
False
```
Ú	ParamSpecr    zŽ
Return whether the argument is an instance of [`ParamSpec`][typing.ParamSpec].

```pycon
>>> P = ParamSpec('P')
>>> is_paramspec(P)
True
```
ÚTypeVarr*   z†
Return whether the argument is an instance of [`TypeVar`][typing.TypeVar].

```pycon
>>> T = TypeVar('T')
>>> is_typevar(T)
True
```
ÚTypeVarTupler+   z�
Return whether the argument is an instance of [`TypeVarTuple`][typing.TypeVarTuple].

```pycon
>>> Ts = TypeVarTuple('Ts')
>>> is_typevartuple(Ts)
True
```
ÚUnionr,   a¦  
Return whether the argument is the [`Union`][typing.Union] [special form][].

This function can also be used to check for the [`Optional`][typing.Optional] [special form][],
as at runtime, `Optional[int]` is equivalent to `Union[int, None]`.

```pycon
>>> is_union(Union)
True
>>> is_union(Union[int, str])
False
```

!!! warning
    This does not check for unions using the [new syntax][types-union] (e.g. `int | str`).
Úobjc                óv   — t          | t          ¦  «        o$t          | t          ¦  «        ot	          | d¦  «        S )aÃ  Return whether the argument is a named tuple type.

    This includes [`NamedTuple`][typing.NamedTuple] subclasses and classes created from the
    [`collections.namedtuple`][] factory function.

    ```pycon
    >>> class User(NamedTuple):
    ...     name: str
    ...
    >>> is_namedtuple(User)
    True
    >>> City = collections.namedtuple('City', [])
    >>> is_namedtuple(City)
    True
    >>> is_namedtuple(NamedTuple)
    False
    ```
    Ú_fields)Ú
isinstanceÚtypeÚ
issubclassÚtupler<   ©rZ   s    rJ   r   r   9  s2   € õ& �c�4Ñ Ô ÐW¥Z°µUÑ%;Ô%;ÐWÅÈÈYÑ@WÔ@WÐWrL   r	   r   z•
Return whether the argument is the [`LiteralString`][typing.LiteralString] [special form][].

```pycon
>>> is_literalstring(LiteralString)
True
```
ÚNeverr   zu
Return whether the argument is the [`Never`][typing.Never] [special form][].

```pycon
>>> is_never(Never)
True
```
ÚNewTyper   z�
Return whether the argument is a [`NewType`][typing.NewType].

```pycon
>>> UserId = NewType("UserId", int)
>>> is_newtype(UserId)
True
```
Ú	NoDefaultr   z„
Return whether the argument is the [`NoDefault`][typing.NoDefault] sentinel object.

```pycon
>>> is_nodefault(NoDefault)
True
```
ÚNoExtraItemsr   zy
Return whether the argument is the `NoExtraItems` sentinel object.

```pycon
>>> is_noextraitems(NoExtraItems)
True
```
ÚNoReturnr   zž
Return whether the argument is the [`NoReturn`][typing.NoReturn] [special form][].

```pycon
>>> is_noreturn(NoReturn)
True
>>> is_noreturn(Never)
False
```
ÚNotRequiredr   z�
Return whether the argument is the [`NotRequired`][typing.NotRequired] [special form][].

```pycon
>>> is_notrequired(NotRequired)
True
```
ÚParamSpecArgsr!   zŸ
Return whether the argument is an instance of [`ParamSpecArgs`][typing.ParamSpecArgs].

```pycon
>>> P = ParamSpec('P')
>>> is_paramspecargs(P.args)
True
```
ÚParamSpecKwargsr"   z§
Return whether the argument is an instance of [`ParamSpecKwargs`][typing.ParamSpecKwargs].

```pycon
>>> P = ParamSpec('P')
>>> is_paramspeckwargs(P.kwargs)
True
```
ÚReadOnlyr#   z�
Return whether the argument is the [`ReadOnly`][typing.ReadOnly] [special form][].

```pycon
>>> is_readonly(ReadOnly)
True
```
ÚRequiredr$   z�
Return whether the argument is the [`Required`][typing.Required] [special form][].

```pycon
>>> is_required(Required)
True
```
ÚSelfr%   zq
Return whether the argument is the [`Self`][typing.Self] [special form][].

```pycon
>>> is_self(Self)
True
```
Ú	TypeAliasr&   z…
Return whether the argument is the [`TypeAlias`][typing.TypeAlias] [special form][].

```pycon
>>> is_typealias(TypeAlias)
True
```
Ú	TypeGuardr(   z…
Return whether the argument is the [`TypeGuard`][typing.TypeGuard] [special form][].

```pycon
>>> is_typeguard(TypeGuard)
True
```
r   r)   zy
Return whether the argument is the [`TypeIs`][typing.TypeIs] [special form][].

```pycon
>>> is_typeis(TypeIs)
True
```
r
   Ú_is_typealiastype_innerzTypeIs[TypeAliasType]c                óL   — t          | ¦  «        t          uot          | ¦  «        S ©N)r^   r   ro   ra   s    rJ   r'   r'   ø  s!   € Ý�C‰yŒy¥Ð,ÐMÕ1HÈÑ1MÔ1MÐMrL   r'   a'  
Return whether the argument is a [`TypeAliasType`][typing.TypeAliasType] instance.

```pycon
>>> type MyInt = int
>>> is_typealiastype(MyInt)
True
>>> MyStr = TypeAliasType("MyStr", str)
>>> is_typealiastype(MyStr):
True
>>> type MyList[T] = list[T]
>>> is_typealiastype(MyList[int])
False
```
ÚUnpackr-   z™
Return whether the argument is the [`Unpack`][typing.Unpack] [special form][].

```pycon
>>> is_unpack(Unpack)
True
>>> is_unpack(Unpack[Ts])
False
```
)r/   é   zTypeIs[deprecated]c                ó,   — t          | t          ¦  «        S rq   )r]   Ú_deprecated_typesra   s    rJ   r   r     s   € Ý˜#Õ0Ñ1Ô1Ð1rL   c                ó,   — t          | t          ¦  «        S rq   )r]   Ú_deprecated_typera   s    rJ   r   r   #  s   € Ý˜#Õ/Ñ0Ô0Ð0rL   a+  
Return whether the argument is a [`deprecated`][warnings.deprecated] instance.

This also includes the [`typing_extensions` backport][typing_extensions.deprecated].

```pycon
>>> is_deprecated(warnings.deprecated('message'))
True
>>> is_deprecated(typing_extensions.deprecated('message'))
True
```
r   c                 ó4   — i | ]\  }}t          |¦  «        |“ŒS © )Úid)Ú.0ÚkÚvs      rJ   ú
<dictcomp>r~   e  s$   € Ð6gÐ6gÐ6gÁDÀAÀqµr¸!±u´u¸aÐ6gÐ6gÐ6grL   r   )yÚ__doc__Úcollections.abcÚcollectionsÚ
contextlibÚreÚsysr=   ÚwarningsÚtextwrapr   Útypesr   r   r   r   r   r>   r	   r
   r   r   Ú__all__Úversion_infoÚ	_IS_PY310rK   rO   r   r   r   r   r   r   r   r   r    r*   r+   r,   Úboolr   r   r   r   r   r   r   r   r!   r"   r#   r$   r%   r&   r(   r)   ro   r'   r-   ru   r   rw   ÚHashableÚabcÚ	AwaitableÚ	CoroutineÚAsyncIterableÚAsyncIteratorÚIterableÚIteratorÚ
ReversibleÚSizedÚ	ContainerÚ
CollectionÚCallableÚAbstractSetÚSetÚ
MutableSetÚMappingÚMutableMappingÚSequenceÚMutableSequenceÚTupler`   ÚListÚlistÚDequeÚdequeÚsetÚ	FrozenSetÚ	frozensetÚMappingViewÚKeysViewÚ	ItemsViewÚ
ValuesViewÚDictÚdictÚDefaultDictÚdefaultdictÚOrderedDictÚCounterÚChainMapÚ	GeneratorÚAsyncGeneratorÚTyper^   ÚPatternÚMatchÚContextManagerÚAbstractContextManagerÚAsyncContextManagerÚAbstractAsyncContextManagerr   Ú__annotations__Úitemsr   ÚintÚaliasÚtargetr?   Ú__name__Úte_aliasry   rL   rJ   ú<module>rÃ      sG	  ððð ð ð Ð Ð Ð Ø Ð Ð Ð Ø 	€	€	€	Ø 
€
€
€
Ø €€€Ø €€€Ø Ð Ð Ð Ð Ð Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø Ð Ð Ð Ð Ð Ð Ð à Ð Ð Ð Ø NÐ NÐ NÐ NÐ NÐ NÐ NÐ NÐ NÐ NÐ NÐ Nð#€ðJ Ô˜R˜a˜RÔ  GÒ+€	ð4"¨]ð 4"È=ð 4"Ð]ið 4"ð 4"ð 4"ð 4"ðn&"¨}ð &"È]ð &"Ð_kð &"ð &"ð &"ð &"ðV 0Ð/°¸^ÑLÔL€ð	€Ô ð 
*Ð	)¨%°Ñ	:Ô	:€ð€„ð /Ð.¨z¸=ÑIÔI€ð	€Ô ð 2Ð1°-ÐAQÑRÔR€ð	€Ô ð ,Ð+¨G°ZÑ@Ô@€ð	€Ô ð 3Ð2°<ÀÑQÔQ€ð€Ô ð .Ð-¨i¸ÑFÔF€
ð	€
Ô ð .Ð-¨i¸ÑFÔF€
ð	€
Ô ð 2Ð1°+¸~ÑNÔN€ð€Ô ð 0Ð/°	¸<ÑHÔH€
ð€
Ô ð 5Ð4°^ÐEVÑWÔW€ð€Ô ð ,Ð+¨G°ZÑ@Ô@€ð€Ô ð$X�sð X $ð Xð Xð Xð Xð4 4Ð3°OÐEWÑXÔXÐ ðÐ Ô ð ,Ð+¨G°ZÑ@Ô@€ð€Ô ð 0Ð/°	¸<ÑHÔH€
ð€
Ô ð 0Ð/°¸^ÑLÔL€ð€Ô ð 3Ð2°>ÐCTÑUÔU€ð€Ô ð /Ð.¨z¸=ÑIÔI€ð	€Ô ð 2Ð1°-ÐAQÑRÔR€ð€Ô ð 6Ð5°oÐGYÑZÔZÐ ðÐ Ô ð 8Ð7Ð8IÐK_Ñ`Ô`Ð ðÐ Ô ð /Ð.¨z¸=ÑIÔI€ð€Ô ð /Ð.¨z¸=ÑIÔI€ð€Ô ð +Ð
*¨6°9Ñ
=Ô
=€ð€„ð 0Ð/°¸^ÑLÔL€ð€Ô ð 0Ð/°¸^ÑLÔL€ð€Ô ð -Ð,¨X°{ÑCÔC€	ð€	Ô ð =Ð<¸_ÐNgÑhÔhÐ ð ð _ð
N˜cð NÐ)@ð Nð Nð Nð Nð Nð :Ð9¸/ÐK]Ñ^Ô^ÐðÐ Ô ð  -Ð,¨X°{ÑCÔC€	ð	€	Ô ð Ô�wÒÐØ!Ô,Ð.?Ô.JÐKÐð2˜3ð 2Ð&:ð 2ð 2ð 2ð 2ð 2ð )Ô3Ðð1˜3ð 1Ð&:ð 1ð 1ð 1ð 1ð€Ô ð+3Ø
„O�[”_Ô-ð+3à
Ô�k”oÔ/ð+3ð Ô�k”oÔ/ð+3ð Ô˜+œ/Ô7ð	+3ð
 Ô˜+œ/Ô7ð+3ð „O�[”_Ô-ð+3ð „O�[”_Ô-ð+3ð Ô�{”Ô1ð+3ð „L�+”/Ô'ð+3ð Ô�k”oÔ/ð+3ð Ô�{”Ô1ð+3ð „O�[”_Ô-ð+3ð Ô˜œÔ+ð+3ð Ô�{”Ô1ð+3ð  „N�K”OÔ+ð!+3ð" Ô˜;œ?Ô9ð#+3ð$ „O�[”_Ô-ð%+3ð +3ð& Ô˜KœOÔ;ð'+3ð( „L�%ð)+3ð* „K�ð++3ð, „L�+Ô#ð-+3ð. „J�ð/+3ð0 Ô�ið1+3ð2 Ô˜œÔ3ð3+3ð4 „O�[”_Ô-ð5+3ð6 Ô�k”oÔ/ð7+3ð8 Ô�{”Ô1ð9+3ð: „K�ð;+3ð< Ô˜Ô/ð=+3ð> Ô˜Ô/ð?+3ð@ „N�KÔ'ðA+3ðB „O�[Ô)ðC+3ðD Ô�k”oÔ/ðE+3ðF Ô˜;œ?Ô9ðG+3ð +3ðH „K�à
„N�B”JØ
„L�"”(Ø
Ô˜:Ô<Ø
Ô 
Ô FðS+3ð +3Ð �E˜$˜s D¨¤I˜~Ô.Ô/ð +ð +ñ +ðX Að 7hÐ6gÐL^×LdÒLdÑLfÔLfÐ6gÑ6gÔ6gÐ ˜˜d 3¨¨S¬	 >Ô2Ô3Ð gÐ gÑ gð Wð �TÐ,×2Ò2Ñ4Ô4Ñ5Ô5ð .ð .�M€Eˆ6Ø�GÐ-¨u¬~¸tÑDÔDÐDˆÐQØ'-Ð˜8Ñ$øð.ð .rL   