o
    }j6hB                     @   s2  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 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dZd
ededefddZejd	krnddl
mZ ne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d0d1Z%d2e%_ ed3d4Z&d5e&_ d6ede'fd7d8Z(ed9d:Z)d;e)_ ed<d=Z*d>e*_ ejd	kred?d@Z+n	d6ede'fdAd@Z+dBe+_ edCdDZ,dEe,_ edFdGZ-dHe-_ edIdJZ.dKe._ edLdMZ/dNe/_ edOdPZ0dQe0_ edRdSZ1dTe1_ edUdVZ2dWe2_ edXdYZ3dZe3_ ed[d\Z4d]e4_ ed^d_Z5d`e5_ edadbZ6dce6_ edddeZ7erld6eddffdgdhZ8nedddhZ8die8_ edjdkZ9dle9_ ejdmkrd6eddnfdodpZ:n	d6eddnfdqdpZ:dre:_ i ej;ej<j;ej=ej<j=ej>ej<j>ej?ej<j?ej@ej<j@ejAej<jAejBej<jBejCej<jCejDej<jDejEej<jEejFej<jFejGej<jGejHej<jIejJej<jJejKej<jKejLej<jLejMej<jMi ejNej<jNejOePejQeRejSejTejIeUejVeWejXej<jXejYej<jYejZej<jZej[ej<j[ej\e]ej^ej_ej`ej`ejaejaejbejbejcej<jcejdej<jdejeeejfejfejgejgejhejiejjejkiZlee]eee f  emds< 	 eReln D ]\ZoZpeqeeojrd Zsdurepeles< qdS )tzLow-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)AnyFinal)LiteralStringTypeAliasTypeTypeIs
deprecated) DEPRECATED_ALIASESNoneType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_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                 C   s   t t| }t t| }|r'|r'tt| tt| u rd|  }nd|  d|  }n|r1|s1d|  }n|s;|r;d|  }nd}td| d| d}i }tttd}t||| || S )	a}  Create a function checking that the function argument is the (unparameterized) typing :paramref:`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
    ```
    zobj is typing.z or obj is typing_extensions.zobj is typing_extensions.False	
    def z&(obj: Any, /) -> bool:
        return 
    r   typingtyping_extensionshasattrr5   r6   getattrr   r   execr.   r/   	in_typingin_typing_extensions
check_code	func_codelocals_globals_ rB   o/var/www/html/chefvision.cloud.itp360.com/venv/lib/python3.10/site-packages/typing_inspection/typing_objects.py _compile_identity_check_function;   s(   


rD   c                 C   s   t t| }t t| }|r)|r)tt| tt| u rd|  d}n"d|  d|  d}n|r4|s4d|  d}n|s?|r?d|  d}nd}td| d	|  d
| d}i }tttd}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.
    zisinstance(obj, typing.)zisinstance(obj, (typing.z, typing_extensions.z))z"isinstance(obj, typing_extensions.r1   r2   z(obj: Any, /) -> 'TypeIs[z]':
        return r3   r4   r7   r;   rB   rB   rC   "_compile_isinstance_check_functionh   s,   


rF   )r   	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                C   s   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tupler8   rQ   rB   rB   rC   r   )  s   r   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   c                C   s
   t | dS )N__supertype__)r8   rW   rB   rB   rC   r   [  s   
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
```
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                C   s   t | tuo	t| S N)rT   r   re   rW   rB   rB   rC   r$     s   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                C   s   t | tjtjfS rf   )rS   warningsr
   r6   rW   rB   rB   rC   r   	  s   r   c                C   s   t | tjS rf   )rS   r6   r
   rW   rB   rB   rC   r     s   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   )t__doc__collections.abccollections
contextlibresysr5   ri   textwrapr   typesr   r   r   r   r6   r   r   r	   r
   __all__version_info	_IS_PY310rD   rF   r   rT   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&   re   r$   r*   r   Hashableabc	Awaitable	CoroutineAsyncIterableAsyncIteratorIterableIterator
ReversibleSized	Container
CollectionCallableAbstractSetSet
MutableSetMappingMutableMappingSequenceMutableSequenceTuplerV   ListlistDequedequeset	FrozenSet	frozensetMappingViewKeysView	ItemsView
ValuesViewDictdictDefaultDictdefaultdictOrderedDictCounterChainMap	GeneratorAsyncGeneratorTypePatternMatchContextManagerAbstractContextManagerAsyncContextManagerAbstractAsyncContextManagerr   __annotations__itemsaliastargetr9   _namete_aliasrB   rB   rB   rC   <module>   sL   #-
 


	













	
	


	

	




	
	

	
	
	










	













 !
"
#$,