AlkantarClanX12

Your IP : 18.227.49.73


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/typing.cpython-310.pyc

o

6��f�i�@s�dZddlmZmZddlZddlZddlZddlZddlZddl	Z
ddlZddlZddlm
Z
mZmZmZgd�Zd�dd�dd	�Zd�dd�dd�Zd
d�Zdd�Zd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�ZgZd�dd�dd�Ze�fd d!�ZGd"d#�d#�Z Gd$d%�d%�Z!Gd&d'�d'e d
d(�Z"Gd)d*�d*e"d
d(�Z#e"d+d,��Z$e"d-d.��Z%e"d/d0��Z&e"d1d2��Z'e"d3d4��Z(e"d5d6��Z)e#ed
d�d7d8���Z*e"d9d:��Z+e"d;d<��Z,e"d=d>��Z-Gd?d@�d@e d
d(�Z.GdAdB�dB�Z/GdCdD�dDe e!e/d
d(�Z0GdEdF�dFe e!d
d(�Z1GdGdH�dHe e!d
d(�Z2GdIdJ�dJe e!e/d
d(�Z3dKdL�Z4GdMdN�dNe d
d(�Z5GdOdP�dPe5d
d(�Z6GdQdR�dRe5d
d(�Z7GdSdT�dTe6d
d(�Z8GdUdV�dVe7d
d(�Z9GdWdX�dXe7d
d(�Z:GdYdZ�dZe6d
d(�Z;d[d\�Z<Gd]d^�d^e6d
d(�Z=Gd_d`�d`e6d
d(�Z>Gdadb�db�Z?Gdcdd�dd�Z@Gdedf�df�ZAgdg�ZBgdh�ZCeBeCdigZDdjdk�ZEdldm�ZFdndo�ZGd�drds�ZHd�dudv�ZIgdw�dxdygdz�ZJGd{d|�d|e�ZKGd}d~�d~e?eKd�ZLGd�d��d�e6d
d(�ZMGd�d��d��ZNd�d��ZOd�d��ZPd�d��ZQejRejSejTejUe
eefZVd�d�d��ZWd�d��ZXd�d��ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]d�d��Z^d�d��Z_d�d��Z`e0d��Zae0d��Zbe0d��Zce0d�d
d��Zde0d�d
d��Zee0d�d
d��Zfe0d�d
d��Zge0d�d
ehd��Zie0d�ejek�Zle7Zmemejjnd�Znemejjodp�Zoemejjpdt�Zpemejjqdp�Zqemejjrdp�Zremejjsdp�Zsemejjtdp�Ztemejjudp�Zuemejjvd�Zvemejjwdp�Zwemejjxdp�Zxe9ejjyd��Zyd�ey_emejjzdpd�d��Z{emejj|dp�Z|emejj}d��Z}emejj~d��Z~emejjdp�Zemejj�dp�Z�emejj�d�Z�e:e�d�dd�d��Z�d�e�_eme�dpdd�d��Z�emej�dpd�d��Z�eme�dpdd�d��Zzemedpdd�d��Z�emejj�dp�Z�emejj�dp�Z�emejj�d��Z�emejj�dp�Z�emej�dpd�d��Z�emej�dpd�d��Z�eme�d�dd�d��Z�emej�d�d�d��Z�emej�d��Z�emej�dp�Z�emej�d��Z�emejj�dt�Z�emejj�d��Z�emehdpdd�d��Z�d�e�_eOGd�d��d�eL��Z�eOGd�d��d�eL��Z�eOGd�d��d�eL��Z�eOGd�dÄd�eL��Z�eOGd�dńd�eL��Z�eOGd�dDŽd�eLed��Z�eOGd�dɄd�eLed��Z�d�d�d̄Z�ehdͣ�Z�ehdΣ�Z�Gd�dЄd�eh�Z�d�d�d҄Z�eh��e�d�d�i�Z�d�dԄZ�e�e�_�Gd�dքd�eh�Z�d�d
dלd�dلZ�eh��e�d�d�i�Z�d�dۄe�_�Gd�d݄d݃Z�ekZ�dZ�Gd�d߄d�e?el�Z�Gd�d�d�e�ej�Z�Gd�d�d�e�ek�Z�Gd�d�d�Z�e�d�e�_�e�ej�e�j�<eme
j�dp�Z�eme
j�dp�Z�Gd�d�d�Z	e�d�e	_�e	ej�e	j�<dS)�aU
The typing module: Support for gradual typing as defined by PEP 484.

At large scale, the structure of the module is following:
* Imports and exports, all public names should be explicitly added to __all__.
* Internal helper functions: these should never be used in code outside this module.
* _SpecialForm and its instances (special forms):
  Any, NoReturn, ClassVar, Union, Optional, Concatenate
* Classes whose instances can be type arguments in addition to types:
  ForwardRef, TypeVar and ParamSpec
* The core of internal generics API: _GenericAlias and _VariadicGenericAlias, the latter is
  currently only used by Tuple and Callable. All subscripted types like X[int], Union[int, str],
  etc., are instances of either of these classes.
* The public counterpart of the generics API consists of two classes: Generic and Protocol.
* Public helper functions: get_type_hints, overload, cast, no_type_check,
  no_type_check_decorator.
* Generic aliases for collections.abc ABCs and few additional protocols.
* Special types: NewType, NamedTuple, TypedDict.
* Wrapper submodules for re and io related types.
�)�abstractmethod�ABCMetaN)�WrapperDescriptorType�MethodWrapperType�MethodDescriptorType�GenericAlias)T�	Annotated�Any�Callable�ClassVar�Concatenate�Final�
ForwardRef�Generic�Literal�Optional�	ParamSpec�Protocol�Tuple�Type�TypeVar�Union�AbstractSet�
ByteString�	Container�ContextManager�Hashable�	ItemsView�Iterable�Iterator�KeysView�Mapping�MappingView�MutableMapping�MutableSequence�
MutableSet�Sequence�Sized�
ValuesView�	Awaitable�
AsyncIterator�
AsyncIterable�	Coroutine�
Collection�AsyncGenerator�AsyncContextManager�
Reversible�SupportsAbs�
SupportsBytes�SupportsComplex�
SupportsFloat�
SupportsIndex�SupportsInt�
SupportsRound�ChainMap�Counter�Deque�Dict�DefaultDict�List�OrderedDict�Set�	FrozenSet�
NamedTuple�	TypedDict�	Generator�BinaryIO�IO�Match�Pattern�TextIO�AnyStr�cast�final�get_args�
get_origin�get_type_hints�is_typeddict�NewType�
no_type_check�no_type_check_decorator�NoReturn�overload�
ParamSpecArgs�ParamSpecKwargs�runtime_checkable�Text�
TYPE_CHECKING�	TypeAlias�	TypeGuardF��allow_special_formscCs,|durtd�St|t�rt|||d�S|S)z=For converting None to type(None), and strings to ForwardRef.N)�module�is_class)�type�
isinstance�strr)�argr^r]�rd�-/opt/alt/python310/lib64/python3.10/typing.py�
_type_convert�s

rfTc	Cs�ttf}|s|tf7}|r|tf7}t|||d�}t|t�r*|j|vr*t|�d���|t	t
ttfvr4|St|t�s?|ttfvrGtd|�d���t|t
tttjtttf�rV|St|�set|�d|d�d���|S)a�Check that the argument is a type, and return it (internal helper).

    As a special case, accept None and return type(None) instead. Also wrap strings
    into ForwardRef instances. Consider several corner cases, for example plain
    special forms like Union are not valid, while Union[int, str] is OK, etc.
    The msg argument is a human-readable error message, e.g::

        "Union[arg, ...]: arg should be a type."

    We append the repr() of the actual value (truncated to 100 chars).
    )r^r]z is not valid as type argumentzPlain z Got z.100�.)rrrr
rfra�
_GenericAlias�
__origin__�	TypeErrorr	rSrZ�_SpecialFormr`rr�types�	UnionTyperrUrV�callable)rc�msg�is_argumentr^r]Zinvalid_generic_formsrdrdre�_type_check�s(



�rqcCs|dupt|ttttf�S)N.)ra�tuple�listr�_ConcatenateGenericAlias)rcrdrdre�_is_param_expr�s
�rucCsft|tj�r
t|�St|t�r |jdkr|jS|j�d|j��S|dur&dSt|tj�r/|jSt|�S)a;Return the repr() of an object, special-casing types (internal helper).

    If obj is a type, we return a shorter version than the default
    type.__repr__, based on the module and qualified name, which is
    typically enough to uniquely identify a type.  For everything
    else, we fall back on repr(obj).
    �builtinsrg.z...)	rarlr�reprr`�
__module__�__qualname__�FunctionType�__name__)�objrdrdre�
_type_repr�s

r}csj|durt}g�|D]&}t||�r|�vr��|�t|tttjf�r0���fdd�|jD��q
t	��S)z�Collect all type variable contained
    in types in order of first appearance (lexicographic order). For example::

        _collect_type_vars((T, List[S, T])) == (T, S)
    Ncsg|]}|�vr|�qSrdrd��.0�t��tvarsrdre�
<listcomp>��z&_collect_type_vars.<locals>.<listcomp>)
rra�appendrhrrlrm�extend�__parameters__rr)Ztypes_�
typevar_typesr�rdr�re�_collect_type_vars�s
�r�c	CsR|s	t|�d���t|�}||kr'td||krdnd�d|�d|�d|����dS)	z�Check correct count for parameters of a generic cls (internal helper).
    This gives a nice error message in case of count mismatch.
    z is not a generic classzToo �many�fewz arguments for z	; actual z, expected N)rj�len)�cls�
parametersZelenZalenrdrdre�_check_generic�s���r�cCs�t|j�dkr|rt|d�st|jdt�sJ�|fSt||t|j��g}t||j�D]\}}t|t�r?t|t�r?t|�}|�	|�q-t|�S)z`Prepares the parameters for a Generic containing ParamSpec
    variables (internal helper).
    �r)
r�r�rurarr��ziprsrrr�)r��paramsZ_params�pZtvarrdrdre�_prepare_paramspec_params�s�
�r�cCsVt|�}t|�t|�kr)g}|D]}||vr |�|�|�|�q|}|r)J|��|S�N)�setr�r��remove)r�Z
all_paramsZ
new_paramsr�rdrdre�_deduplicate�s

�r�cCsxg}|D]1}t|ttjf�r|�|j�qt|t�r0t|�dkr0|dtur0|�|dd��q|�	|�qtt
|��S)zyAn internal helper for Union creation and substitution: flatten Unions
    among parameters, then remove duplicates.
    rr�N)ra�_UnionGenericAliasrlrmr��__args__rrr�rr�r��r�r�r�rdrdre�_remove_dups_flattens"r�cCs8g}|D]}t|t�r|�|j�q|�|�qt|�S)zJAn internal helper for Literal creation: flatten Literals among parameters)ra�_LiteralGenericAliasr�r�r�rrr�rdrdre�_flatten_literal_paramss
r���typedcs �fdd�}|dur||�S|S)zInternal wrapper caching __getitem__ of generic types with a fallback to
    original function for non-hashable arguments.
    cs8tj�d����t��j�t�����fdd��}|S)Nr�cs2z�|i|��WStyYnw�|i|��Sr��rj��args�kwds��cached�funcrdre�inner2s�z+_tp_cache.<locals>.decorator.<locals>.inner)�	functools�	lru_cache�	_cleanupsr��cache_clear�wraps)r�r�r�r�re�	decorator.s
z_tp_cache.<locals>.decoratorNrd)r�r�r�rdr�re�	_tp_cache*s
r�cs�t|t�r|�����St|tttjf�rGt���fdd�|jD��}||jkr*|St|t�r5t|j	|�St|tj�rBt
�tj
|�S|�|�S|S)z�Evaluate all forward references in the given type t.
    For use of globalns and localns see the docstring for get_type_hints().
    recursive_guard is used to prevent infinite recursion with a recursive
    ForwardRef.
    c3s�|]
}t|����VqdSr�)�
_eval_type�r�a��globalns�localns�recursive_guardrdre�	<genexpr>I��z_eval_type.<locals>.<genexpr>)rar�	_evaluaterhrrlrmrrr�rir��reduce�operator�or_�	copy_with)r�r�r�r�Zev_argsrdr�rer�@s



r�c@seZdZdZdZdd�ZdS)�_FinalzMixin to prohibit subclassing)�__weakref__cOsd|vrtd��dS)N�_rootz&Cannot subclass special typing classesr���selfr�r�rdrdre�__init_subclass__Zs�z_Final.__init_subclass__N)r{rxry�__doc__�	__slots__r�rdrdrdrer�Usr�c@s$eZdZdZdZdd�Zdd�ZdS)�
_Immutablez3Mixin to indicate that object should not be copied.rdcC�|Sr�rd�r�rdrdre�__copy__b�z_Immutable.__copy__cCr�r�rd)r�Zmemordrdre�__deepcopy__er�z_Immutable.__deepcopy__N)r{rxryr�r�r�r�rdrdrdrer�^s
r�c@sleZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
edd��ZdS)rk)�_namer��_getitemcCs||_|j|_|j|_dSr�)r�r{r�r�)r��getitemrdrdre�__init__nsz_SpecialForm.__init__cCs|dvr|jSt|��)N>r{ry)r��AttributeError)r��itemrdrdre�__getattr__ssz_SpecialForm.__getattr__cC�td|����)N�Cannot subclass r�)r��basesrdrdre�__mro_entries__y�z_SpecialForm.__mro_entries__cC�
d|jS�N�typing.�r�r�rdrdre�__repr__|�
z_SpecialForm.__repr__cC�|jSr�r�r�rdrdre�
__reduce__�z_SpecialForm.__reduce__cOr�)NzCannot instantiate r�r�rdrdre�__call__�r�z_SpecialForm.__call__cC�t||fSr��r�r��otherrdrdre�__or__��z_SpecialForm.__or__cC�t||fSr�r�r�rdrdre�__ror__�r�z_SpecialForm.__ror__cC�t|�d���)Nz! cannot be used with isinstance()r��r�r|rdrdre�__instancecheck__�r�z_SpecialForm.__instancecheck__cCr�)Nz! cannot be used with issubclass()r��r�r�rdrdre�__subclasscheck__�r�z_SpecialForm.__subclasscheck__cCs|�||�Sr�)r��r�r�rdrdre�__getitem__�sz_SpecialForm.__getitem__N)r{rxryr�r�r�r�r�r�r�r�r�r�r�r�r�rdrdrdrerkksrk)r�c@�eZdZdd�ZdS)�_LiteralSpecialFormcCs"t|t�s|f}|j|g|�R�Sr�)rarrr�r�rdrdrer��s
z_LiteralSpecialForm.__getitem__N)r{rxryr�rdrdrdrer��sr�cCr�)a`Special type indicating an unconstrained type.

    - Any is compatible with every type.
    - Any assumed to have all methods.
    - All values assumed to be instances of Any.

    Note that all the above statements are true from the point of view of
    static type checkers. At runtime, Any should not be used with instance
    or class checks.
    � is not subscriptabler�r�rdrdrer	��r	cCr�)aSpecial type indicating functions that never return.
    Example::

      from typing import NoReturn

      def stop() -> NoReturn:
          raise Exception('no way')

    This type is invalid in other positions, e.g., ``List[NoReturn]``
    will fail in static type checkers.
    r�r�r�rdrdrerS�s
rScC�t||�d��}t||f�S)a3Special type construct to mark class variables.

    An annotation wrapped in ClassVar indicates that a given
    attribute is intended to be used as a class variable and
    should not be set on instances of that class. Usage::

      class Starship:
          stats: ClassVar[Dict[str, int]] = {} # class variable
          damage: int = 10                     # instance variable

    ClassVar accepts only types and cannot be further subscribed.

    Note that ClassVar is not a class itself, and should not
    be used with isinstance() or issubclass().
    � accepts only single type.�rqrh�r�r�r�rdrdrer�srcCr�)a�Special typing construct to indicate final names to type checkers.

    A final name cannot be re-assigned or overridden in a subclass.
    For example:

      MAX_SIZE: Final = 9000
      MAX_SIZE += 1  # Error reported by type checker

      class Connection:
          TIMEOUT: Final[int] = 10

      class FastConnector(Connection):
          TIMEOUT = 1  # Error reported by type checker

    There is no runtime checking of these properties.
    r�r�r�rdrdrer
�sr
cs�|dkrtd��t|t�s|f}d�t�fdd�|D��}t|�}t|�dkr+|dSt|�dkr>td	�|vr>t||d
d�St||�S)a'Union type; Union[X, Y] means either X or Y.

    To define a union, use e.g. Union[int, str].  Details:
    - The arguments must be types and there must be at least one.
    - None as an argument is a special case and is replaced by
      type(None).
    - Unions of unions are flattened, e.g.::

        Union[Union[int, str], float] == Union[int, str, float]

    - Unions of a single argument vanish, e.g.::

        Union[int] == int  # The constructor actually returns int

    - Redundant arguments are skipped, e.g.::

        Union[int, str, int] == Union[int, str]

    - When comparing unions, the argument order is ignored, e.g.::

        Union[int, str] == Union[str, int]

    - You cannot subclass or instantiate a union.
    - You can use Optional[X] as a shorthand for Union[X, None].
    rdz Cannot take a Union of no types.z)Union[arg, ...]: each arg must be a type.c3��|]}t|��VqdSr��rq�rr��rordrer���zUnion.<locals>.<genexpr>r�r�Nr��name)rjrarrr�r�r`r�r�rdr�rer�s

rcCs t||�d��}t|td�fS)zEOptional type.

    Optional[X] is equivalent to Union[X, None].
    z requires a single type.N)rqrr`)r�r�rcrdrdrersrcGsHt|�}ztdd�ttt|���D��}Wn	tyYnwt||�S)a�Special typing form to define literal types (a.k.a. value types).

    This form can be used to indicate to type checkers that the corresponding
    variable or function parameter has a value equivalent to the provided
    literal (or one of several literals):

      def validate_simple(data: Any) -> Literal[True]:  # always returns True
          ...

      MODE = Literal['r', 'rb', 'w', 'wb']
      def open_helper(file: str, mode: MODE) -> str:
          ...

      open_helper('/some/path', 'r')  # Passes type check
      open_helper('/other/path', 'typo')  # Error in type checker

    Literal[...] cannot be subclassed. At runtime, an arbitrary value
    is allowed as type argument to Literal[...], but type checkers may
    impose restrictions.
    css�|]\}}|VqdSr�rd)rr��_rdrdrer�0��zLiteral.<locals>.<genexpr>)r�rrr�rs�_value_and_type_iterrjr�r�rdrdrers"�
rcCr�)aSpecial marker indicating that an assignment should
    be recognized as a proper type alias definition by type
    checkers.

    For example::

        Predicate: TypeAlias = Callable[..., bool]

    It's invalid when used anywhere except as in the example above.
    r�r�r�rdrdrerZ7r�rZcsv|dkrtd��t|t�s|f}t|dt�std��d�g�fdd�|dd�D��|d�R}t||ttfd	d
�S)aUsed in conjunction with ``ParamSpec`` and ``Callable`` to represent a
    higher order function which adds, removes or transforms parameters of a
    callable.

    For example::

       Callable[Concatenate[int, P], int]

    See PEP 612 for detailed information.
    rdz&Cannot take a Concatenate of no types.����AThe last parameter to Concatenate should be a ParamSpec variable.z/Concatenate[arg, ...]: each arg must be a type.c3r�r�r�r�r�rdrer�Zr�zConcatenate.<locals>.<genexpr>NT��_typevar_types�_paramspec_tvars)rjrarrrrtrr�rdr�rerFs
(�rcCr�)a�Special typing form used to annotate the return type of a user-defined
    type guard function.  ``TypeGuard`` only accepts a single type argument.
    At runtime, functions marked this way should return a boolean.

    ``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static
    type checkers to determine a more precise type of an expression within a
    program's code flow.  Usually type narrowing is done by analyzing
    conditional code flow and applying the narrowing to a block of code.  The
    conditional expression here is sometimes referred to as a "type guard".

    Sometimes it would be convenient to use a user-defined boolean function
    as a type guard.  Such a function should use ``TypeGuard[...]`` as its
    return type to alert static type checkers to this intention.

    Using  ``-> TypeGuard`` tells the static type checker that for a given
    function:

    1. The return value is a boolean.
    2. If the return value is ``True``, the type of its argument
       is the type inside ``TypeGuard``.

       For example::

          def is_str(val: Union[str, float]):
              # "isinstance" type guard
              if isinstance(val, str):
                  # Type of ``val`` is narrowed to ``str``
                  ...
              else:
                  # Else, type of ``val`` is narrowed to ``float``.
                  ...

    Strict type narrowing is not enforced -- ``TypeB`` need not be a narrower
    form of ``TypeA`` (it can even be a wider form) and this may lead to
    type-unsafe results.  The main reason is to allow for things like
    narrowing ``List[object]`` to ``List[str]`` even though the latter is not
    a subtype of the former, since ``List`` is invariant.  The responsibility of
    writing type-safe type guards is left to the user.

    ``TypeGuard`` also works with type variables.  For more information, see
    PEP 647 (User-Defined Type Guards).
    r�r�r�rdrdrer[`s,r[c@sDeZdZdZdZddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Z	dS)rz-Internal wrapper to hold a forward reference.)�__forward_arg__�__forward_code__�__forward_evaluated__�__forward_value__�__forward_is_argument__�__forward_is_class__�__forward_module__TNF)r_cCstt|t�std|����zt|dd�}Wnty"td|����w||_||_d|_d|_||_	||_
||_dS)Nz*Forward reference must be a string -- got z<string>�evalz/Forward reference must be an expression -- got F)rarbrj�compile�SyntaxErrorr	r
rrr
rr)r�rcrpr^r_�coderdrdrer��s
�
zForwardRef.__init__cCs�|j|vr|S|jr||urW|dur|duri}}n
|dur"|}n|dur(|}|jdur9ttj�|jd�d|�}tt|j	||�d|j
|jd�}t|||||jhB�|_
d|_|j
S)N�__dict__z*Forward references must evaluate to types.)rpr]T)r	rr�getattr�sys�modules�getrqrr
r
rr�r)r�r�r�r�Ztype_rdrdrer��s0


���zForwardRef._evaluatecCsJt|t�stS|jr|jr|j|jko|j|jkS|j|jko$|j|jkSr�)rar�NotImplementedrr	rrr�rdrdre�__eq__�s

�
�zForwardRef.__eq__cC�t|j|jf�Sr�)�hashr	rr�rdrdre�__hash__��zForwardRef.__hash__cCsd|j�d�S)NzForwardRef(�))r	r�rdrdrer��r�zForwardRef.__repr__�TN)
r{rxryr�r�r�r�rrr�rdrdrdrer�s	rc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_TypeVarLikez5Mixin for TypeVar-like types (TypeVar and ParamSpec).cCsB|r|rtd��t|�|_t|�|_|rt|d�|_dSd|_dS)zfUsed to setup TypeVars and ParamSpec's bound, covariant and
        contravariant attributes.
        z"Bivariant types are not supported.zBound must be a type.N)�
ValueError�bool�
__covariant__�__contravariant__rq�	__bound__)r��bound�	covariant�
contravariantrdrdrer��s


z_TypeVarLike.__init__cCr�r�r��r��rightrdrdrer��r�z_TypeVarLike.__or__cCr�r�r��r��leftrdrdrer��r�z_TypeVarLike.__ror__cCs&|jrd}n|jrd}nd}||jS)N�+�-�~)r$r%r{)r��prefixrdrdrer��s
z_TypeVarLike.__repr__cCr�r�)r{r�rdrdrer��r�z_TypeVarLike.__reduce__N)	r{rxryr�r�r�r�r�r�rdrdrdrer!�s
	r!cs.eZdZdZdZdddd��fdd�
Z�ZS)ra�Type variable.

    Usage::

      T = TypeVar('T')  # Can be anything
      A = TypeVar('A', str, bytes)  # Must be str or bytes

    Type variables exist primarily for the benefit of static type
    checkers.  They serve as the parameters for generic types as well
    as for generic function definitions.  See class Generic for more
    information on generic types.  Generic functions work as follows:

      def repeat(x: T, n: int) -> List[T]:
          '''Return a list containing n references to x.'''
          return [x]*n

      def longest(x: A, y: A) -> A:
          '''Return the longest of two strings.'''
          return x if len(x) >= len(y) else y

    The latter example's signature is essentially the overloading
    of (str, str) -> str and (bytes, bytes) -> bytes.  Also note
    that if the arguments are instances of some subclass of str,
    the return type is still plain str.

    At runtime, isinstance(x, T) and issubclass(C, T) will raise TypeError.

    Type variables defined with covariant=True or contravariant=True
    can be used to declare covariant or contravariant generic types.
    See PEP 484 for more details. By default generic types are invariant
    in all type variables.

    Type variables can be introspected. e.g.:

      T.__name__ == 'T'
      T.__constraints__ == ()
      T.__covariant__ == False
      T.__contravariant__ = False
      A.__constraints__ == (str, bytes)

    Note that only type variables defined in global scope can be pickled.
    )r{r&�__constraints__r$r%rNF�r'r(r)c	s�||_t��|||�|r|durtd��|r!t|�dkr!td��d�t�fdd�|D��|_zt�d�j	�
dd�}Wn
ttfyHd}Ynw|d	krR||_
dSdS)
Nz-Constraints cannot be combined with bound=...r�z"A single constraint is not allowedz:TypeVar(name, constraint, ...): constraints must be types.c3r�r�r�r~r�rdrer�*r�z#TypeVar.__init__.<locals>.<genexpr>r{�__main__�typing)r{�superr�rjr�rrr2r�	_getframe�	f_globalsrr�r"rx)r�rr'r(r)Zconstraints�def_mod��	__class__r�rer�!s �
�zTypeVar.__init__)r{rxryr�r�r��
__classcell__rdrdr:rer�s+�rc@�(eZdZdZdd�Zdd�Zdd�ZdS)	rUa<The args for a ParamSpec object.

    Given a ParamSpec object P, P.args is an instance of ParamSpecArgs.

    ParamSpecArgs objects have a reference back to their ParamSpec:

       P.args.__origin__ is P

    This type is meant for runtime introspection and has no special meaning to
    static type checkers.
    cC�
||_dSr��ri�r��originrdrdrer�?r�zParamSpecArgs.__init__cC�|jj�d�S)Nz.args�rir{r�rdrdrer�Br�zParamSpecArgs.__repr__cC�t|t�stS|j|jkSr�)rarUrrir�rdrdrerE�
zParamSpecArgs.__eq__N�r{rxryr�r�r�rrdrdrdrerU3�
rUc@r=)	rVaFThe kwargs for a ParamSpec object.

    Given a ParamSpec object P, P.kwargs is an instance of ParamSpecKwargs.

    ParamSpecKwargs objects have a reference back to their ParamSpec:

       P.kwargs.__origin__ is P

    This type is meant for runtime introspection and has no special meaning to
    static type checkers.
    cCr>r�r?r@rdrdrer�Wr�zParamSpecKwargs.__init__cCrB)Nz.kwargsrCr�rdrdrer�Zr�zParamSpecKwargs.__repr__cCrDr�)rarVrrir�rdrdrer]rEzParamSpecKwargs.__eq__NrFrdrdrdrerVKrGrVcsFeZdZdZdZedd��Zedd��Zdddd	��fd
d�
Z�Z	S)raqParameter specification variable.

    Usage::

       P = ParamSpec('P')

    Parameter specification variables exist primarily for the benefit of static
    type checkers.  They are used to forward the parameter types of one
    callable to another callable, a pattern commonly found in higher order
    functions and decorators.  They are only valid when used in ``Concatenate``,
    or as the first argument to ``Callable``, or as parameters for user-defined
    Generics.  See class Generic for more information on generic types.  An
    example for annotating a decorator::

       T = TypeVar('T')
       P = ParamSpec('P')

       def add_logging(f: Callable[P, T]) -> Callable[P, T]:
           '''A type-safe decorator to add logging to a function.'''
           def inner(*args: P.args, **kwargs: P.kwargs) -> T:
               logging.info(f'{f.__name__} was called')
               return f(*args, **kwargs)
           return inner

       @add_logging
       def add_two(x: float, y: float) -> float:
           '''Add two numbers together.'''
           return x + y

    Parameter specification variables defined with covariant=True or
    contravariant=True can be used to declare covariant or contravariant
    generic types.  These keyword arguments are valid, but their actual semantics
    are yet to be decided.  See PEP 612 for details.

    Parameter specification variables can be introspected. e.g.:

       P.__name__ == 'P'
       P.__bound__ == None
       P.__covariant__ == False
       P.__contravariant__ == False

    Note that only parameter specification variables defined in global scope can
    be pickled.
    )r{r&r$r%rcC�t|�Sr�)rUr�rdrdrer���zParamSpec.argscCrHr�)rVr�rdrdre�kwargs�rIzParamSpec.kwargsNFr3c	s`||_t��|||�zt�d�j�dd�}Wn
ttfy$d}Ynw|dkr.||_	dSdS)Nr�r{r4r5)
r{r6r�rr7r8rr�r"rx)r�rr'r(r)r9r:rdrer��s�
�zParamSpec.__init__)
r{rxryr�r��propertyr�rJr�r<rdrdr:rercs-

rcCs|�d�o	|�d�S)N�__)�
startswith�endswith)�attrrdrdre�
_is_dunder�srPcsdeZdZdZddd�dd�Zdd�Zd	d
�Zdd�Z�fd
d�Zdd�Z	dd�Z
�fdd�Z�ZS)�_BaseGenericAliasa�The central part of internal API.

    This represents a generic version of type 'origin' with type arguments 'params'.
    There are two kind of these aliases: user defined and special. The special ones
    are wrappers around builtin collections and ABCs in collections.abc. These must
    have 'name' always set. If 'inst' is False, then the alias can't be instantiated,
    this is used by e.g. typing.List and typing.Dict.
    TN��instrcCs||_||_||_d|_dSr�)�_instr�rir�)r�rArSrrdrdrer��s
z_BaseGenericAlias.__init__cOsT|jstd|j�d|jj�d���|j|i|��}z||_W|Sty)Y|Sw)NzType z cannot be instantiated; use z
() instead)rTrjr�rir{�__orig_class__r�)r�r�rJ�resultrdrdrer��s
���z_BaseGenericAlias.__call__cCsjg}|j|vr
|�|j�|�|�}||dd�D]}t|t�s&t|t�r+t|�Sq|�t�t|�S)Nr�)rir��indexrarQ�
issubclassrrr)r�r��res�i�brdrdrer��s

�
z!_BaseGenericAlias.__mro_entries__cCs<|dvr|jp
|jjSd|jvrt|�st|j|�St|��)N>r{ryri)r�rir{rrPrr��r�rOrdrdrer��s
z_BaseGenericAlias.__getattr__cs4t|�s|dvrt��||�dSt|j||�dS)N>�_nparamsrrrTr�)rPr6�__setattr__�setattrri)r�rO�valr:rdrer^�sz_BaseGenericAlias.__setattr__cC�|�t|��Sr��r�r`r�rdrdrer��r�z#_BaseGenericAlias.__instancecheck__cC�td��)NzBSubscripted generics cannot be used with class and instance checksr�r�rdrdrer���z#_BaseGenericAlias.__subclasscheck__cs&ttt���dd�t|j�D���S)NcSsg|]}t|�s|�qSrd)rP�rrOrdrdrer��r�z-_BaseGenericAlias.__dir__.<locals>.<listcomp>)rsr�r6�__dir__�dirrir�r:rdrerf�s�z_BaseGenericAlias.__dir__)
r{rxryr�r�r�r�r�r^r�r�rfr<rdrdr:rerQ�s
rQcsxeZdZddedd��fdd�
Zdd�Zd	d
�Zdd�Zd
d�Ze	dd��Z
dd�Zdd�Zdd�Z
�fdd�Z�ZS)rhTNF)rSrrrcsdt�j|||d�t|t�s|f}tdd�|D��|_t||d�|_||_||_|s0|j	|_	dSdS)NrRcss,�|]}|tur
dn|turdn|VqdS).rdN)�_TypingEllipsis�_TypingEmptyr�rdrdrer��s��
�z)_GenericAlias.__init__.<locals>.<genexpr>)r�)
r6r�rarrr�r�r�rrrx)r�rAr�rSrrrr:rdrer��s

��z_GenericAlias.__init__cC�&t|t�stS|j|jko|j|jkSr�)rarhrrir�r�rdrdrer�


�z_GenericAlias.__eq__cCrr�)rrir�r�rdrdrer
rz_GenericAlias.__hash__cCr�r�r�r*rdrdrer�r�z_GenericAlias.__or__cCr�r�r�r,rdrdrer�r�z_GenericAlias.__ror__csL|jttfvrtd|����t|t�s|f}tdd�|D��}|jr2tdd�|jD��r2t	||�}n	t
||t|j��tt
|j|���g}|jD]V}t||j�rjt|t�re�|}t|�sdtd|����n"�|}nt|tttjf�r�|j}|r�t�fdd�|D��}||}|jtjjkr�t|t�r�|�|�qH|�|�qH|�t|��S)Nz%Cannot subscript already-subscripted cs��|]}t|�VqdSr��rfr�rdrdrer�rz,_GenericAlias.__getitem__.<locals>.<genexpr>cs��|]}t|t�VqdSr��rarr~rdrdrer�r�zFExpected a list of types, an ellipsis, ParamSpec, or Concatenate. Got c3s�|]}�|VqdSr�rd)r�x��substrdrer�2r)rirrrjrarrr�anyr�r�r�r��dictr�r�rrrurhrrlrm�collections�abcr
r�r�r�)r�r��new_argsrc�	subparams�subargsrdrqrer�s>
�

��
z_GenericAlias.__getitem__cCs |j|j||j|j|j|jd�S)N�rrSrr)r;rir�rTrr�r�r�rdrdrer�;s�z_GenericAlias.copy_withcCsB|jr	d|j}nt|j�}d�dd�|jD��}|�d|�d�S)Nr��, cS�g|]}t|��qSrd�r}r�rdrdrer�E�z*_GenericAlias.__repr__.<locals>.<listcomp>�[�])r�r}ri�joinr�)r�rr�rdrdrer�@s

z_GenericAlias.__repr__cCsb|jr
t�|j}n|j}t|j�}t|�dkr*t|dt�r'|tur*|ds*|\}tj	||ffS�Nr�r)
r��globalsrirrr�r�rarr�r�)r�rAr�rdrdrer�Hs
z_GenericAlias.__reduce__cs�t|jt�r
td|����|jrt��|�S|jtur=t|vr!dS|�	|�}||dd�D]}t|t
�r<||ur<dSq.|jfS)Nr�rdr�)rarirkrjr�r6r�rrrWrQ)r�r�rZr[r:rdrer�Ss

�z_GenericAlias.__mro_entries__)r{rxryrr�rrr�r�r�r�r�r�r�r�r<rdrdr:rerh�s�
$rhcsdeZdZddd��fdd�
Zedd��Zdd	�Zd
d�Z�fdd
�Zdd�Z	dd�Z
dd�Z�ZS)�_SpecialGenericAliasTNrRcs`|dur|j}t�j|||d�||_|jdkr"d|j�d�|_dSd|j�d|j�d�|_dS)NrRrvzA generic version of rg)r{r6r�r]rxryr�)r�rAZnparamsrSrr:rdrer�hs
z_SpecialGenericAlias.__init__csBt|t�s|f}d�t�fdd�|D��}t|||j�|�|�S)Nz*Parameters to generic types must be types.c3r�r�r�r�r�rdrer�wr�z3_SpecialGenericAlias.__getitem__.<locals>.<genexpr>)rarrr�r]r�r{rdr�rer�rs

z _SpecialGenericAlias.__getitem__cCst|j||j|jd�S)N)rrS)rhrir�rTr{rdrdrer�{s�z_SpecialGenericAlias.copy_withcCr�r�r�r�rdrdrer�r�z_SpecialGenericAlias.__repr__cs:t|t�rt|j|j�St|t�st||j�St��|�Sr�)rar�rXrirhr6r�r�r:rdrer��s


z&_SpecialGenericAlias.__subclasscheck__cCr�r�r�r�rdrdrer��r�z_SpecialGenericAlias.__reduce__cCr�r�r�r*rdrdrer��r�z_SpecialGenericAlias.__or__cCr�r�r�r,rdrdrer��r�z_SpecialGenericAlias.__ror__)
r{rxryr�r�r�r�r�r�r�r�r�r<rdrdr:rer�gs

r�cs$eZdZ�fdd�Zdd�Z�ZS)�_CallableGenericAliascsh|jdksJ�|j}t|�dkrt|d�rt���Sdd�dd�|dd�D���d	t|d��d
�S)Nr
r�rztyping.Callable[[r|cSr}rdr~r�rdrdrer��rz2_CallableGenericAlias.__repr__.<locals>.<listcomp>rz], r�)r�r�r�rur6r�r�r}�r�r�r:rdrer��s
�
�z_CallableGenericAlias.__repr__cCsD|j}t|�dkrt|d�st|dd��|df}tjt|ffS)Nr�rr)r�r�rursr�r�r
r�rdrdrer��sz _CallableGenericAlias.__reduce__)r{rxryr�r�r<rdrdr:rer��s	r�c@s(eZdZdd�Zdd�Zedd��ZdS)�
_CallableTypecCst|j||j|jttfdd�S)NTrz)r�rir�rTrrr{rdrdrer��s
�z_CallableType.copy_withcCsPt|t�rt|�dkrtd��|\}}t|t�rt|�|f}n||f}|�|�S)Nr�z6Callable must be used as Callable[[arg, ...], result].)rarrr�rjrs�__getitem_inner__)r�r�r�rVrdrdrer��s

z_CallableType.__getitem__cCsb|\}}d}t||�}|tur|�t|f�St|t�s|f}tdd�|D��}||f}|�|�S)Nz.Callable[args, result]: result must be a type.csrlr�rm)rrcrdrdrer��rz2_CallableType.__getitem_inner__.<locals>.<genexpr>)rq�Ellipsisr�rhrarr)r�r�r�rVrordrdrer��s



z_CallableType.__getitem_inner__N)r{rxryr�r�r�r�rdrdrdrer��s
r�c@seZdZedd��ZdS)�
_TupleTypecs�|dkr
|�tf�St|t�s|f}t|�dkr.|ddur.d�t|d��}|�|tf�Sd�t�fdd	�|D��}|�|�S)
Nrdr�r�.z Tuple[t, ...]: t must be a type.rz*Tuple[t0, t1, ...]: each t must be a type.c3r�r�r�r�r�rdrer��r�z)_TupleType.__getitem__.<locals>.<genexpr>)r�rirarrr�rqrh)r�r�r�rdr�rer��s

z_TupleType.__getitem__N)r{rxryr�r�rdrdrdrer��sr�csPeZdZdd�Zdd�Zdd�Z�fdd�Zd	d
�Zdd�Z�fd
d�Z	�Z
S)r�cCst|Sr�r�r{rdrdrer��rdz_UnionGenericAlias.copy_withcCs(t|ttjf�s
tSt|j�t|j�kSr�)rar�rlrmrr�r�r�rdrdrer�sz_UnionGenericAlias.__eq__cCstt|j��Sr�)r�	frozensetr�r�rdrdrer�r�z_UnionGenericAlias.__hash__csd|j}t|�dkr-|dtd�urdt|d��d�S|dtd�ur-dt|d��d�St���S)Nr�rztyping.Optional[r�r�)r�r�r`r}r6r�r�r:rdrer��s
z_UnionGenericAlias.__repr__cCrar�rbr�rdrdrer��r�z$_UnionGenericAlias.__instancecheck__cCs |jD]
}t||�r
dSqdS)NT)r�rX)r�r�rcrdrdrer��s


��z$_UnionGenericAlias.__subclasscheck__cst���\}\}}|t|ffSr�)r6r�r)r�r�rAr�r:rdrer��sz_UnionGenericAlias.__reduce__)r{rxryr�rrr�r�r�r�r<rdrdr:rer��s	r�cCsdd�|D�S)Ncss�|]	}|t|�fVqdSr�)r`r�rdrdrer��s�z'_value_and_type_iter.<locals>.<genexpr>rd)r�rdrdrer�r�rc@seZdZdd�Zdd�ZdS)r�cCs*t|t�stStt|j��tt|j��kSr�)rar�rr�rr�r�rdrdrer�s
z_LiteralGenericAlias.__eq__cCsttt|j���Sr�)rr�rr�r�rdrdrer�z_LiteralGenericAlias.__hash__N)r{rxryrrrdrdrdrer��sr�c�eZdZ�fdd�Z�ZS)rtcszt|dttf�rg|dd��|d�RSt|dt�r,g|dd��|dj�R}nt|dt�s7td��t��|�S)Nrr)	rarsrrrtr�rrjr6r�r{r:rdrer�	sz"_ConcatenateGenericAlias.copy_with)r{rxryr�r<rdrdr:rertsrtcs4eZdZdZdZdZedd��Z�fdd�Z�Z	S)raCAbstract base class for generic types.

    A generic type is typically declared by inheriting from
    this class parameterized with one or more type variables.
    For example, a generic mapping type might be defined as::

      class Mapping(Generic[KT, VT]):
          def __getitem__(self, key: KT) -> VT:
              ...
          # Etc.

    This class can then be used as follows::

      def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
          try:
              return mapping[key]
          except KeyError:
              return default
    rdFcCs�t|t�s|f}|s|turtd|j�d���tdd�|D��}|ttfvrLtdd�|D��s8td|j�d���t	t
|��t	|�krKtd|j�d���ntd	d�|jD��r\t
||�}n	t||t	|j��t||ttfd
d�S)NzParameter list to z[...] cannot be emptycsrlr�rmr�rdrdrer�2rz,Generic.__class_getitem__.<locals>.<genexpr>css�|]
}t|ttf�VqdSr�)rarrr�rdrdrer�5r�zParameters to zF[...] must all be type variables or parameter specification variables.z[...] must all be uniquecsrnr�ror~rdrdrer�>r�Tr)rarrrrjryrr�allr{r�r�rsr�r�r�rhrr)r�r�rdrdre�__class_getitem__+s0
�����zGeneric.__class_getitem__c
st�j|i|��g}d|jvrt|jv}n
t|jvo|jdk}|r&td��d|jvr�t|jt	t
f�}d}|jD]}t|t�rO|j
turO|durLtd��|j}q8|dur�t|�}t|��|�ks�d��fdd�|D��}d�dd�|D��}	td	|�d
|	�d���|}t|�|_dS)N�__orig_bases__rz!Cannot inherit from plain Genericz0Cannot inherit from Generic[...] multiple types.r|c3s �|]}|�vrt|�VqdSr��rbr~�Zgvarsetrdrer�b��z,Generic.__init_subclass__.<locals>.<genexpr>csrlr�r�)r�grdrdrer�crzSome type variables (z) are not listed in Generic[r�)r6r�rrr��	__bases__r{rjr�rrrarhrir�r�r�rr)
r�r�rJr��errorZgvars�baseZtvarsetZs_varsZs_argsr:r�rer�Fs<




��

�zGeneric.__init_subclass__)
r{rxryr�r��_is_protocolr�r�r�r<rdrdr:rers
rc@�eZdZdZdS)riz�Internal placeholder for () or []. Used by TupleMeta and CallableMeta
    to allow empty list/tuple in specific places, without allowing them
    to sneak in where prohibited.
    N�r{rxryr�rdrdrdrerij�ric@r�)rhz(Internal placeholder for ... (ellipsis).Nr�rdrdrdrerhqr�rh)r�r�rUr��_is_runtime_protocol)�__abstractmethods__�__annotations__rr�r�rx�__new__r��__subclasshook__r�r��_MutableMapping__markercCsrt�}|jdd�D],}|jdvrq
t|di�}t|j���t|���D]}|�d�s5|tvr5|�	|�q%q
|S)z�Collect protocol members from a protocol class objects.

    This includes names actually defined in the class dictionary, as well
    as names that appear in annotations. Special names (above) are skipped.
    Nr)rrr�Z_abc_)
r��__mro__r{rrsr�keysrM�EXCLUDED_ATTRIBUTES�add)r�Zattrsr��annotationsrOrdrdre�_get_protocol_attrs�s

��r�cst�fdd�t��D��S)Nc3s �|]}tt�|d��VqdSr�)rnrre�r�rdrer��r�z,_is_callable_members_only.<locals>.<genexpr>)r�r�r�rdr�re�_is_callable_members_only�sr�cOstt|�}|jrtd��|jturdS|jD]}|j�dt�}|tur'||_nqtj|_|j|g|�Ri|��dS)Nz Protocols cannot be instantiatedr�)	r`r�rjr��_no_init_or_replace_initr�rr�object)r�r�rJr�r�Zinitrdrdrer��s

�r�r�r4c	Cs4z
t�|d�j�d|�WSttfyYdSw)Nr�r{)rr7r8rr�r")�depth�defaultrdrdre�_caller�s
�r��c	Cs0zt�|�jddvWSttfyYdSw)z�Allow instance and class checks for special stdlib modules.

    The abc and functools modules indiscriminately call isinstance() and
    issubclass() on the whole MRO of a user class, which may contain protocols.
    r{)rvr�T)rr7r8r�r"�r�rdrdre�_allow_reckless_class_checks�s
�r�)
r
r)rrr+rr'rr-r0�AbstractContextManager�AbstractAsyncContextManager)zcollections.abc�
contextlibcr�)�
_ProtocolMetacs�t�dd�rt�dd�stdd�std��t�dd�rt��r't�j��r'dS�jr:t��fdd	�t��D��r:dSt	��
��S)
Nr�Fr�r�r��LInstance and class checks can only be used with @runtime_checkable protocolsTc3s:�|]}t�|�ott�|d��pt�|�duVqdSr�)�hasattrrnrre�r��instancerdrer��s�
�
�z2_ProtocolMeta.__instancecheck__.<locals>.<genexpr>)rr�rjr�rXr;r�r�r�r6r�r�r:r�rer��s&
�
���
��z_ProtocolMeta.__instancecheck__)r{rxryr�r<rdrdr:rer��sr�cs,eZdZdZdZdZdZ�fdd�Z�ZS)raZBase class for protocol classes.

    Protocol classes are defined as::

        class Proto(Protocol):
            def meth(self) -> int:
                ...

    Such classes are primarily used with static type checkers that recognize
    structural subtyping (static duck-typing), for example::

        class C:
            def meth(self) -> int:
                return 0

        def func(x: Proto) -> int:
            return x.meth()

        func(C())  # Passes static type check

    See PEP 544 for details. Protocol classes decorated with
    @typing.runtime_checkable act as simple-minded runtime protocols that check
    only the presence of given attributes, ignoring their type signatures.
    Protocol classes can be generic, they are defined as::

        class GenProto(Protocol[T]):
            def meth(self) -> T:
                ...
    rdTFcs�t�j|i|���j�dd�stdd��jD���_�fdd�}d�jvr)|�_�js.dS�jD]#}|tt	fvsT|j
tvrF|jt|j
vsTt
|t	�rN|jsTtd|��q1t�_dS)	Nr�Fcss�|]}|tuVqdSr�)r)rr[rdrdrer�rz-Protocol.__init_subclass__.<locals>.<genexpr>cs��j�dd�s	tSt�dd�st�rtStd��t��s%t�r!tStd��t|t�s.td��t	��D];}|j
D]1}||jvrM|j|durKtSn t|di�}t|tjj
�rh||vrht|t�rh|jrhnq7tSq2dS)	Nr�Fr�r�z<Protocols with non-method members don't support issubclass()z"issubclass() arg 1 must be a classr�T)rrrrr�rjr�rar`r�r�rurvr!rXrr�)r�rOr�r�r�rdre�_proto_hooks<


����z/Protocol.__init_subclass__.<locals>._proto_hookr�z7Protocols can only inherit from other protocols, got %r)r6r�rrrsr�r�r�r�rrx�_PROTO_ALLOWLISTr{rXrjr�r�)r�r�rJr�r�r:r�rer�
s*
&

����
zProtocol.__init_subclass__)	r{rxryr�r�r�r�r�r<rdrdr:rer�sr)�	metaclasscsTeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	�fdd�Z
�ZS)�_AnnotatedAliasa7Runtime representation of an annotated type.

    At its core 'Annotated[t, dec1, dec2, ...]' is an alias for the type 't'
    with extra annotations. The alias behaves like a normal typing alias,
    instantiating is the same as instantiating the underlying type, binding
    it to types is also the same.
    cs2t|t�r
|j|}|j}t��||�||_dSr�)rar��__metadata__rir6r�)r�rA�metadatar:rdrer�Us



z_AnnotatedAlias.__init__cCs$t|�dksJ�|d}t||j�Sr�)r�r�r�)r�r�Znew_typerdrdrer�\sz_AnnotatedAlias.copy_withcCs$d�t|j�d�dd�|jD���S)Nztyping.Annotated[{}, {}]r|csrlr�)rwr�rdrdrer�drz+_AnnotatedAlias.__repr__.<locals>.<genexpr>)�formatr}rir�r�r�rdrdrer�as�z_AnnotatedAlias.__repr__cCstjt|jf|jffSr�)r�r�rrir�r�rdrdrer�gs�z_AnnotatedAlias.__reduce__cCrjr�)rar�rrir�r�rdrdrerlrkz_AnnotatedAlias.__eq__cCrr�)rrir�r�rdrdrerrrz_AnnotatedAlias.__hash__cs|dvrdSt��|�S)N>r{ryr)r6r�r\r:rdrer�usz_AnnotatedAlias.__getattr__)r{rxryr�r�r�r�r�rrr�r<rdrdr:rer�Msr�c@s0eZdZdZdZdd�Zedd��Zdd�Zd	S)
ra�Add context specific metadata to a type.

    Example: Annotated[int, runtime_check.Unsigned] indicates to the
    hypothetical runtime_check module that this type is an unsigned int.
    Every other consumer of this type can ignore this metadata and treat
    this type as int.

    The first argument to Annotated must be a valid type.

    Details:

    - It's an error to call `Annotated` with less than two arguments.
    - Nested Annotated are flattened::

        Annotated[Annotated[T, Ann1, Ann2], Ann3] == Annotated[T, Ann1, Ann2, Ann3]

    - Instantiating an annotated type is equivalent to instantiating the
    underlying type::

        Annotated[C, Ann1](5) == C(5)

    - Annotated can be used as a generic type alias::

        Optimized = Annotated[T, runtime.Optimize()]
        Optimized[int] == Annotated[int, runtime.Optimize()]

        OptimizedList = Annotated[List[T], runtime.Optimize()]
        OptimizedList[int] == Annotated[List[int], runtime.Optimize()]
    rdcOrc)Nz&Type Annotated cannot be instantiated.r��r�r�rJrdrdrer��rdzAnnotated.__new__cCsNt|t�rt|�dkrtd��d}t|d|dd�}t|dd��}t||�S)Nr�zUAnnotated[...] should be used with at least two arguments (a type and an annotation).z$Annotated[t, ...]: t must be a type.rTr\r�)rarrr�rjrqr�)r�r�rorAr�rdrdrer��s
zAnnotated.__class_getitem__cOstd�|j���)NzCannot subclass {}.Annotated)rjr�rxr�rdrdrer��s
�zAnnotated.__init_subclass__N)	r{rxryr�r�r�r�r�r�rdrdrdrer{s

rcCs&t|t�r|jstd|��d|_|S)a9Mark a protocol class as a runtime protocol.

    Such protocol can be used with isinstance() and issubclass().
    Raise TypeError if applied to a non-protocol class.
    This allows a simple-minded structural check very similar to
    one trick ponies in collections.abc such as Iterable.
    For example::

        @runtime_checkable
        class Closable(Protocol):
            def close(self): ...

        assert isinstance(open('/some/file'), Closable)

    Warning: this will check only the presence of the required methods,
    not their type signatures!
    zB@runtime_checkable can be only applied to protocol classes, got %rT)rXrr�rjr�r�rdrdrerW�s�rWcC�|S)z�Cast a value to a type.

    This returns the value unchanged.  To the type checker this
    signals that the return value has the designated type, but at
    runtime we intentionally don't check anything (we want this
    to be as fast as possible).
    rd)�typr`rdrdrerJ�srJc
Cs�z|j}WntyiYSw|j}|j}|d|�}|jp!d}|j}|r+t|�ni}|t|�}t||d�|�D]\}}	||vsFJ�|	||<q<|S)z:Internal helper to extract the default arguments, by name.Nrd)	�__code__r��co_argcount�co_varnames�__defaults__�__kwdefaults__rtr�r�)
r�rZ	pos_countZ	arg_names�defaultsZ
kwdefaultsrYZ
pos_offsetr�valuerdrdre�
_get_defaults�s 
�

r�c
Cs@t|dd�riSt|t�r�i}t|j�D]d}|dur'ttj�|jd�di�}n|}|j	�di�}t|t
j�r8i}|durBtt
|��n|}|durQ|durQ||}}|��D]"\}	}
|
duratd�}
t|
t�rmt|
ddd�}
t|
||�}
|
||	<qUq|r}|Sdd	�|��D�S|dur�t|t
j�r�|j	}n|}t|d
�r�|j}t|d
�s�t|di�}|dur�|}n|dur�|}t|dd�}|dur�t|t�r�iStd�|���t|�}t|�}|��D]7\}	}
|
dur�td�}
t|
t�r�t|
t|t
j�dd�}
t|
||�}
|	|v�r
||	du�r
t|
}
|
||	<q�|�r|Sd
d	�|��D�S)aHReturn type hints for an object.

    This is often the same as obj.__annotations__, but it handles
    forward references encoded as string literals, adds Optional[t] if a
    default value equal to None is set and recursively replaces all
    'Annotated[T, ...]' with 'T' (unless 'include_extras=True').

    The argument may be a module, class, method, or function. The annotations
    are returned as a dictionary. For classes, annotations include also
    inherited members.

    TypeError is raised if the argument is not of a type that can contain
    annotations, and an empty dictionary is returned if no annotations are
    present.

    BEWARE -- the behavior of globalns and localns is counterintuitive
    (unless you are familiar with how eval() and exec() work).  The
    search order is locals first, then globals.

    - If no dict arguments are passed, an attempt is made to use the
      globals from obj (or the respective module's globals for classes),
      and these are also used as the locals.  If the object does not appear
      to have globals, an empty dictionary is used.  For classes, the search
      order is globals first then locals.

    - If one dict argument is passed, it is used for both globals and
      locals.

    - If two dict arguments are passed, they specify globals and
      locals, respectively.
    �__no_type_check__Nrr�FT)rpr_cS�i|]	\}}|t|��qSrd��_strip_annotations�r�kr�rdrdre�
<dictcomp>+�z"get_type_hints.<locals>.<dictcomp>�__wrapped__�__globals__z1{!r} is not a module, class, method, or function.cSr�rdr�r�rdrdrer�Sr�)rrar`�reversedr�rrrrxrrl�GetSetDescriptorTypert�vars�itemsrbrr��
ModuleTyper�r��_allowed_typesrjr�r�r)
r|r�r�Zinclude_extrasZhintsr�Zbase_globals�annZbase_localsrr�Znsobjr�rdrdrerN�sv!



�

��
�
�
rNcCs�t|t�r
t|j�St|t�r%tdd�|jD��}||jkr |S|�|�St|t�rAtdd�|jD��}||jkr;|St|j|�St|t	j
�r_tdd�|jD��}||jkrX|St�t
j|�S|S)z.Strips the annotations from a given type.
    csrlr�r�r�rdrdrer�\rz%_strip_annotations.<locals>.<genexpr>csrlr�r�r�rdrdrer�arcsrlr�r�r�rdrdrer�fr)rar�r�rirhrrr�r�rrlrmr�r�r�r�)r�Z
stripped_argsrdrdrer�Vs$







r�cCsHt|t�rtSt|ttttf�r|jS|turtSt|t	j
�r"t	j
SdS)a
Get the unsubscripted version of a type.

    This supports generic types, Callable, Tuple, Union, Literal, Final, ClassVar
    and Annotated. Return None for unsupported types. Examples::

        get_origin(Literal[42]) is Literal
        get_origin(int) is None
        get_origin(ClassVar[int]) is ClassVar
        get_origin(Generic) is Generic
        get_origin(Generic[T]) is Generic
        get_origin(Union[T, int]) is Union
        get_origin(List[Tuple[T, T]][int]) == list
        get_origin(P.args) is P
    N)rar�rrQrrUrVrirrlrm��tprdrdrerMns
�rMcCs�t|t�r|jf|jSt|ttf�r7|j}|jtjj	ur5t
|�dkr)t|d�s5t|dd��|df}|St|t
j�r@|jSdS)a�Get type arguments with all substitutions performed.

    For unions, basic simplifications used by Union constructor are performed.
    Examples::
        get_args(Dict[str, int]) == (str, int)
        get_args(int) == ()
        get_args(Union[int, Union[T, int], str][int]) == (int, str)
        get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
        get_args(Callable[[], T][int]) == ([], int)
    r�rNrrd)rar�rir�rhrr�rurvr
r�rursrlrm)r�rYrdrdrerL�s
rLcCs
t|t�S)z�Check if an annotation is a TypedDict class

    For example::
        class Film(TypedDict):
            title: str
            year: int

        is_typeddict(Film)  # => True
        is_typeddict(Union[list, str])  # => False
    )ra�_TypedDictMetar�rdrdrerO�s
rOcCs�t|t�r:|j��}|j��D]\}}||j|fvr |�|�q|��D]}t|tj	�r0d|_
t|t�r9t|�q%zd|_
W|StyJY|Sw)aIDecorator to indicate that annotations are not type hints.

    The argument must be a class or function; if it is a class, it
    applies recursively to all methods and classes defined in that class
    (but not to methods defined in its superclasses or subclasses).

    This mutates the function(s) or class(es) in place.
    T)
rar`r�copyr�r��pop�valuesrlrzr�rQrj)rcZ	arg_attrsrOr`r|rdrdrerQ�s&
	

�
���rQcst����fdd��}|S)z�Decorator to give another decorator the @no_type_check effect.

    This wraps the decorator with something that wraps the decorated
    function in @no_type_check.
    cs�|i|��}t|�}|Sr�)rQ)r�r�r��r�rdre�wrapped_decorator�sz2no_type_check_decorator.<locals>.wrapped_decorator)r�r�)r�r�rdr�rerR�srRcOrc)z*Helper for @overload to raise when called.z�You should not call an overloaded function. A series of @overload-decorated functions outside a stub module should always be followed by an implementation that is not @overload-ed.)�NotImplementedErrorr�rdrdre�_overload_dummy�s�r�cCstS)a
Decorator for overloaded functions/methods.

    In a stub file, place two or more stub definitions for the same
    function in a row, each decorated with @overload.  For example:

      @overload
      def utf8(value: None) -> None: ...
      @overload
      def utf8(value: bytes) -> bytes: ...
      @overload
      def utf8(value: str) -> bytes: ...

    In a non-stub file (i.e. a regular .py file), do the same but
    follow it with an implementation.  The implementation should *not*
    be decorated with @overload.  For example:

      @overload
      def utf8(value: None) -> None: ...
      @overload
      def utf8(value: bytes) -> bytes: ...
      @overload
      def utf8(value: str) -> bytes: ...
      def utf8(value):
          # implementation goes here
    )r�)r�rdrdrerT�srTcCr�)aVA decorator to indicate final methods and final classes.

    Use this decorator to indicate to type checkers that the decorated
    method cannot be overridden, and decorated class cannot be subclassed.
    For example:

      class Base:
          @final
          def done(self) -> None:
              ...
      class Sub(Base):
          def done(self) -> None:  # Error reported by type checker
                ...

      @final
      class Leaf:
          ...
      class Other(Leaf):  # Error reported by type checker
          ...

    There is no runtime checking of these properties.
    rd)�frdrdrerK�srK�T�KT�VT�T_co)r(�V_co�VT_co�T_contra)r)�CT_co)r(r'rIr�a�Callable type; Callable[[int], str] is a function of (int) -> str.

    The subscription syntax must always be used with exactly two
    values: the argument list and the return type.  The argument list
    must be a list of types or ellipsis; the return type must be a single type.

    There is no syntax to indicate optional or keyword arguments,
    such function types are rarely used as callback types.
    rr�rrrRa@Tuple type; Tuple[X, Y] is the cross-product type of X and Y.

    Example: Tuple[T1, T2] is a tuple of two elements corresponding
    to type variables T1 and T2.  Tuple[int, float, str] is a tuple
    of an int, a float and a string.

    To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
    r=r:r?r@rr/r;r<ra�A special construct usable to annotate class objects.

    For example, suppose we have the following classes::

      class User: ...  # Abstract base for User classes
      class BasicUser(User): ...
      class ProUser(User): ...
      class TeamUser(User): ...

    And a function that takes a class argument that's a subclass of
    User and returns an instance of the corresponding class::

      U = TypeVar('U', bound=User)
      def new_user(user_class: Type[U]) -> U:
          user = user_class()
          # (Here we could write the user object to a database)
          return user

      joe = new_user(BasicUser)

    At this point the type checker knows that joe has type BasicUser.
    c@�&eZdZdZdZedefdd��ZdS)r6z(An ABC with one abstract method __int__.rd�returncC�dSr�rdr�rdrdre�__int__��zSupportsInt.__int__N)r{rxryr�r�r�intr�rdrdrdrer6��
r6c@r�)r4z*An ABC with one abstract method __float__.rdr�cCr�r�rdr�rdrdre�	__float__�r�zSupportsFloat.__float__N)r{rxryr�r�r�floatr�rdrdrdrer4�r�r4c@r�)r3z,An ABC with one abstract method __complex__.rdr�cCr�r�rdr�rdrdre�__complex__�r�zSupportsComplex.__complex__N)r{rxryr�r�r�complexr�rdrdrdrer3�r�r3c@r�)r2z*An ABC with one abstract method __bytes__.rdr�cCr�r�rdr�rdrdre�	__bytes__�r�zSupportsBytes.__bytes__N)r{rxryr�r�r�bytesr�rdrdrdrer2�r�r2c@r�)r5z*An ABC with one abstract method __index__.rdr�cCr�r�rdr�rdrdre�	__index__�r�zSupportsIndex.__index__N)r{rxryr�r�rr�r�rdrdrdrer5�r�r5c@r�)r1zMAn ABC with one abstract method __abs__ that is covariant in its return type.rdr�cCr�r�rdr�rdrdre�__abs__�r�zSupportsAbs.__abs__N)r{rxryr�r�rr�r�rdrdrdrer1�r�r1c@s,eZdZdZdZed	dedefdd��ZdS)
r7zOAn ABC with one abstract method __round__ that is covariant in its return type.rdr�ndigitsr�cCr�r�rd)r�rrdrdre�	__round__�r�zSupportsRound.__round__N�r)	r{rxryr�r�rr�r�rrdrdrdrer7�s
r7rdcCs@dd�|D�}dd�|D�}tj||||d�}||_|j_|S)NcSsg|]\}}|�qSrdrd�r�nr�rdrdrer��rz!_make_nmtuple.<locals>.<listcomp>cSs$i|]\}}|t|d|�d���qS)zfield z annotation must be a typer�rrdrdrer��s�z!_make_nmtuple.<locals>.<dictcomp>�r�r^)ru�
namedtupler�r�)rrlr^r��fields�nm_tplrdrdre�
_make_nmtuple�s��r	>
�_replace�_asdictr��_make�_field_defaultsZ_source�_fieldsr�r��__getnewargs__>r{r�rxc@r�)�NamedTupleMetac	
s�|dtusJ���di�}g}|D]&}|�vr|�|�q|r8td|�dt|�dkr-dnd�dd	�|�����qt||���fd
d�|D��dd
�}�D]}|tvrZt	d|��|t
vrk||jvrkt||�|�qN|S)Nrr�zNon-default namedtuple field z cannot follow default fieldr��s�� r|csg|]}�|�qSrdrd)rr��nsrdrer��rz*NamedTupleMeta.__new__.<locals>.<listcomp>rxrz&Cannot overwrite NamedTuple attribute )
�_NamedTuplerr�rjr�r�r	r��_prohibitedr��_specialrr_)	r��typenamer�rrlZ
default_namesZ
field_namer�keyrdrrer��s0
���
��zNamedTupleMeta.__new__N)r{rxryr�rdrdrdrer�src	Ks`|dur	|��}n|rtd��zt�d�j�dd�}Wn
ttfy(d}Ynwt|||d�S)a�Typed version of namedtuple.

    Usage in Python versions >= 3.6::

        class Employee(NamedTuple):
            name: str
            id: int

    This is equivalent to::

        Employee = collections.namedtuple('Employee', ['name', 'id'])

    The resulting class has an extra __annotations__ attribute, giving a
    dict that maps field names to types.  (The field names are also in
    the _fields attribute, which is part of the namedtuple API.)
    Alternative equivalent keyword syntax is also accepted::

        Employee = NamedTuple('Employee', name=str, id=int)

    In Python versions <= 3.5 use::

        Employee = NamedTuple('Employee', [('name', str), ('id', int)])
    NzIEither list of fields or keywords can be provided to NamedTuple, not bothr�r{r4�r^)	r�rjrr7r8rr�r"r	)rrrJr^rdrdrerA�s
�rAcCs*t|�dkr
td��|dtusJ�tfS)Nr�z5Multiple inheritance with NamedTuple is not supportedr)r�rjrAr�r�rdrdre�_namedtuple_mro_entries	src@s&eZdZddd�ZeZdd�ZeZdS)r�Tcs|D]}t|�turtd��qt�t|tf|��i}|�di�}t|���}d���fdd�|��D�}t�}	t�}
|D] }|�	|j
�di��|	�	|j
�dd��|
�	|j
�dd��q<|�	|�|rj|	�	|�n|
�	|�|�_t|	��_
t|
��_t�d	�s�|�_�S)
a5Create new typed dict class object.

        This method is called when TypedDict is subclassed,
        or when TypedDict is instantiated. This way
        TypedDict supports all three syntax forms described in its docstring.
        Subclasses and instances of TypedDict return actual dictionaries.
        zHcannot inherit from both a TypedDict type and a non-TypedDict base classr�z?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a typecs"i|]
\}}|t|��jd��qS)r)rqrx)rrr��roZtp_dictrdrer�4	s��z*_TypedDictMeta.__new__.<locals>.<dictcomp>�__required_keys__rd�__optional_keys__�	__total__)r`r�rjr�rtrr�r�r��updaterr�r�rr r�r!)r�rr�r�totalr�r�Zown_annotationsZown_annotation_keysZ
required_keysZ
optional_keysrdrrer�"	s8��




z_TypedDictMeta.__new__cCrc)Nz4TypedDict does not support instance and class checksr�)r�r�rdrdrer�O	rIz _TypedDictMeta.__subclasscheck__N)T)r{rxryr�rtr�r�r�rdrdrdrer�!	s

+r��r#c	Ksj|dur|}n|r
td��dt|�i}zt�d�j�dd�|d<Wnttfy,Ynwt|d||d	�S)
aSA simple typed namespace. At runtime it is equivalent to a plain dict.

    TypedDict creates a dictionary type that expects all of its
    instances to have a certain set of keys, where each key is
    associated with a value of a consistent type. This expectation
    is not checked at runtime but is only enforced by type checkers.
    Usage::

        class Point2D(TypedDict):
            x: int
            y: int
            label: str

        a: Point2D = {'x': 1, 'y': 2, 'label': 'good'}  # OK
        b: Point2D = {'z': 3, 'label': 'bad'}           # Fails type check

        assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')

    The type info can be accessed via the Point2D.__annotations__ dict, and
    the Point2D.__required_keys__ and Point2D.__optional_keys__ frozensets.
    TypedDict supports two additional equivalent forms::

        Point2D = TypedDict('Point2D', x=int, y=int, label=str)
        Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})

    By default, all keys must be present in a TypedDict. It is possible
    to override this by specifying totality.
    Usage::

        class point2D(TypedDict, total=False):
            x: int
            y: int

    This means that a point2D TypedDict can have any of the keys omitted.A type
    checker is only expected to support a literal False or True as the value of
    the total argument. True is the default, and makes all items defined in the
    class body be required.

    The class syntax is only supported in Python 3.6+, while two other
    syntax forms work for Python 2.7 and 3.2+
    Nz@TypedDict takes either a dict or keyword arguments, but not bothr�r�r{r4rxrdr$)	rjrtrr7r8rr�r"r�)rrr#rJrrdrdrerBV	s*�rBcCstfSr�)�
_TypedDictrrdrdre�<lambda>�	sr&c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)rPa%NewType creates simple unique types with almost zero
    runtime overhead. NewType(name, tp) is considered a subtype of tp
    by static type checkers. At runtime, NewType(name, tp) returns
    a dummy callable that simply returns its argument. Usage::

        UserId = NewType('UserId', int)

        def name_by_id(user_id: UserId) -> str:
            ...

        UserId('user')          # Fails type check

        name_by_id(42)          # Fails type check
        name_by_id(UserId(42))  # OK

        num = UserId(5) + 1     # type: int
    cCsD||_d|vr|�d�d}||_||_t�}|dkr ||_dSdS)Nrgrr5)ry�
rpartitionr{Z
__supertype__r�rx)r�rr�r9rdrdrer��	s
�zNewType.__init__cCs|j�d|j��S)Nrg)rxryr�rdrdrer��	r�zNewType.__repr__cCr�r�rd)r�rprdrdrer��	r�zNewType.__call__cCr�r�)ryr�rdrdrer��	r�zNewType.__reduce__cCr�r�r�r�rdrdrer��	r�zNewType.__or__cCr�r�r�r�rdrdrer��	r�zNewType.__ror__N)
r{rxryr�r�r�r�r�r�r�rdrdrdrerP�	s
rPc@s�eZdZdZdZeedefdd���Zeedefdd���Z	ed8d	d
��Z
eedefdd���Zede
fd
d��Zed8dd��Zedefdd��Zed9de
defdd��Zedefdd��Zed9de
defdd��Zed9de
deefdd��Zed:d e
d!e
de
fd"d#��Zedefd$d%��Zede
fd&d'��Zed;d(e
de
fd)d*��Zedefd+d,��Zed-ede
fd.d/��Zed0eeddfd1d2��Zed<d4d5��Zed8d6d7��ZdS)=rEa�Generic base class for TextIO and BinaryIO.

    This is an abstract, generic version of the return of open().

    NOTE: This does not distinguish between the different possible
    classes (text vs. binary, read vs. write vs. read/write,
    append-only, unbuffered).  The TextIO and BinaryIO subclasses
    below capture the distinctions between text vs. binary, which is
    pervasive in the interface; however we currently do not offer a
    way to track the other distinctions in the type system.
    rdr�cCr�r�rdr�rdrdre�mode�	�zIO.modecCr�r�rdr�rdrdrer�	r)zIO.nameNcCr�r�rdr�rdrdre�close�	r�zIO.closecCr�r�rdr�rdrdre�closed�	r)z	IO.closedcCr�r�rdr�rdrdre�fileno�	r�z	IO.filenocCr�r�rdr�rdrdre�flush�	r�zIO.flushcCr�r�rdr�rdrdre�isatty�	r�z	IO.isattyrrcCr�r�rd)r�rrdrdre�read�	r�zIO.readcCr�r�rdr�rdrdre�readable�	r�zIO.readable�limitcCr�r�rd)r�r1rdrdre�readline�	r�zIO.readline�hintcCr�r�rd)r�r3rdrdre�	readlines
r�zIO.readlinesr�offset�whencecCr�r�rd)r�r5r6rdrdre�seek
r�zIO.seekcCr�r�rdr�rdrdre�seekable

r�zIO.seekablecCr�r�rdr�rdrdre�tell
r�zIO.tell�sizecCr�r�rd)r�r:rdrdre�truncate
r�zIO.truncatecCr�r�rdr�rdrdre�writable
r�zIO.writablercCr�r�rd�r�rrdrdre�write
r�zIO.write�linescCr�r�rd)r�r?rdrdre�
writelines
r�z
IO.writelines�
IO[AnyStr]cCr�r�rdr�rdrdre�	__enter__"
r�zIO.__enter__cCr�r�rd)r�r`r��	tracebackrdrdre�__exit__&
r�zIO.__exit__)r�N)rrr�)r�rA) r{rxryr�r�rKrrbr(rr*r#r+r�r,r-r.rIr/r0r2r=r4r7r8r9r;r<r>r@rBrDrdrdrdrerE�	s\rEc@s@eZdZdZdZedeeefde	fdd��Z
ed
dd��Zd	S)rDz5Typed version of the return of open() in binary mode.rdrr�cCr�r�rdr=rdrdrer>0
r�zBinaryIO.writecCr�r�rdr�rdrdrerB4
r�zBinaryIO.__enter__N)r�rD)r{rxryr�r�rrr��	bytearrayr�r>rBrdrdrdrerD+
srDc@s�eZdZdZdZeedefdd���Zeede	fdd���Z
eedee	fdd	���Zeede
fd
d���Zeedefdd
���Zeddd��ZdS)rHz3Typed version of the return of open() in text mode.rdr�cCr�r�rdr�rdrdre�buffer>
r)z
TextIO.buffercCr�r�rdr�rdrdre�encodingC
r)zTextIO.encodingcCr�r�rdr�rdrdre�errorsH
r)z
TextIO.errorscCr�r�rdr�rdrdre�line_bufferingM
r)zTextIO.line_bufferingcCr�r�rdr�rdrdre�newlinesR
r)zTextIO.newlinescCr�r�rdr�rdrdrerBW
r�zTextIO.__enter__N)r�rH)r{rxryr�r�rKrrDrFrbrGrrHr#rIr	rJrBrdrdrdrerH9
s(rHc@s$eZdZdZgd�ZeZeZeZdS)�ioz)Wrapper namespace for IO generic classes.)rErHrDN)r{rxryr��__all__rErHrDrdrdrdrerK\
srKz.ioc@s eZdZdZddgZeZeZdS)�rez&Wrapper namespace for re type aliases.rGrFN)r{rxryr�rLrGrFrdrdrdrerMk
s
rMz.rer�r )r�r4)r�)NNF)rd)�r�rvrrruZcollections.abcr�r�r�rMZ	stdlib_rerrlrrrrrLrfrqrur}r�r�r�r�r�r�r�r�r�r�r�r�rkr�r	rSrr
rrrrZrr[rr!rrUrVrrPrQrhr�r�r�r�r�rr�rtrrirhZ_TYPING_INTERNALSZ_SPECIAL_NAMESr�r�r�r�r�r�r�r�rr�rrWrJr�rz�BuiltinFunctionType�
MethodTyper�r�rNr�rMrLrOrQrRr�rTrKr�r�r�r�r�r�r�r`r�r�rbrIZ_aliasrr)r,r+r*rrr0r'rr-r
r?rr%r!r#r&r$rrrrrsr=�dequer:r�r@r"r rr(r�rr�r/rtr;�defaultdictr<r>r9r8rCr.rr6r4r3r2r5r1r7r	rrrrAr�rrr�r�rBr%rPrXrYrErDrHrKr{rrGrFrdrdrdre�<module>s�g	"
	
+




'
!


/@"ADMp+#"V


�	b.5�
i	�
�	�						
	
#59
.c#