
    dafA                    ~   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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Zd dlmZmZmZ d dlmZ d dlmZmZ d dlmZmZmZmZ d dlmZmZmZ d d	lm Z m!Z!m"Z"m#Z# d d
lm$Z$m%Z%m&Z& d dlm'Z'm(Z(m)Z) d dlm*Z*m+Z+m,Z,m-Z- d dlm.Z. d dlm/Z/m0Z0m1Z1m2Z2m3Z3 d dlm4Z4m5Z5m6Z6 d dlm7Z7 d dlm8Z8m9Z9 d dlm:Z: d dlm;Z; d dlm<Z< d dlm=Z= d dlm>Z>m?Z? d dlm@Z@ d dlmAZAmBZBmCZCmDZD d dlmEZEmFZFmGZG d dlmHZHmIZI d dlmJZJmKZK d dlmLZLmMZM d dlmNZN d dlmOZOmPZPmQZQmRZR d dlmSZS d dlTZTd dlUZUd dlZd dlVZVd dlWZWd d lXmYZYmZZZ d d!l[m\Z\m]Z]m^Z^ d"Z_d#Z`d$Za G d% d&e      Zbd' Zc G d( d)      Zd G d* d+ed      Ze G d, d-ed      Zf G d. d/eeef      Zg G d0 d1eb      Zh G d2 d3      Zi G d4 d5eieb      Zj G d6 d7eieb      Zk G d8 d9eb      Zl G d: d;eb      Zm G d< d=eb      Zn G d> d?eb      Zod@epeq   dAereqepeq   f   dBepeseq      fdCZt G dD dEeb      Zu G dF dGeb      Zv G dH dIeb      Zw G dJ dKeb      Zx G dL dMeb      Zy G dN dOeb      Zz G dP dQeb      Z{ G dR dS      Z| G dT dUe|eb      Z} G dV dWe|eb      Z~ G dX dYeb      Z e dZeqe      Z e d[      Z G d\ d]e/eef         Z G d^ d_eeef         Z G d` dae3      Ze6 G db dcee3             Z G dd de      Z G df dge3      Z G dh die3      Ze6 G dj dkeee3             Ze6 G dl dme3             Z G dn doe      Z G dp dq      Z G dr dseA      Ze6 G dt due3             Z G dv dweb      Z G dx dyeb      Z G dz d{eb      Z G d| d}eb      Z G d~ deb      Z G d deb      Z G d deb      Z G d deb      Zd dl[mZ e> G d d             Ze> G d d             Z G d deb      Z e       d        Z G d d      Z G d deb      Zd dl[mZmZmZmZmZ  e d      Z G d dejJ                  e         Z G d dejN                  e         Z G d d      Z G d d      Z G d de      Z G d de      Z G d de/e$         Z G d d      Z G d d      Z G d deA      Z G d deA      Z G d deA      Z G d deA      Z eDddeqfg      Z G d deD      Z G d de/e$   eD      Z G d de^jn                  d      Z G d de^jr                  e$   d      Z G d dee      Z G d deDd      Z G d deD      Z G d deDd      Z G d deDd      Z G dĄ de      Z G dƄ deD      Z G dȄ de      Z G dʄ deD      Z G d̄ deD      Z G d΄ deD      Z G dЄ de]jT                        Zdej                  e   fdӄZ	  e e             j                  d       e7Z G dՄ d֫      Z G dׄ deb      Z G dل de      Z G dۄ deb      Z G d݄ deb      Z G d߄ deb      Z G d de      Z G d deb      Z G d deb      Z G d deb      Z G d deb      Z G d deb      Z G d deb      Z G d deb      Z G d deb      Z G d deb      Z G d deb      Z G d deb      Z G d deb      Z ej                  d      Z ej@                  deee      Z G d deb      Z G d d eb      Z G d deb      Z G d deb      Z G d deb      Zd Zedk(  r e        yy# e$ r Ze̐j                  d    dk(  sJ Y dZ[̐jdZ[ww xY w(	      N)defaultdict)	lru_cachewrapsreduce)TestCasemainskip)patch)copydeepcopy)AnyNoReturnNeverassert_never)overloadget_overloadsclear_overloads)TypeVarTypeVarTupleUnpackAnyStr)TKTVT)UnionOptionalLiteral)TupleListDictMutableMapping)Callable)GenericClassVarFinalfinalProtocol)assert_typecastruntime_checkable)get_type_hints)
get_originget_args)override)is_typeddict)reveal_type)dataclass_transform)no_type_checkno_type_check_decoratorType)
NamedTupleNotRequiredRequired	TypedDictIOTextIOBinaryIO)PatternMatch)	Annotated
ForwardRef)SelfLiteralString)	TypeAlias)	ParamSpecConcatenateParamSpecArgsParamSpecKwargs)	TypeGuard)captured_stderrcpython_only)ann_module695mod_generics_cache_typed_dict_helperz&Cannot subclass special typing classesz/type 'typing.%s' is not an acceptable base typez!Cannot subclass an instance of %sc                   "    e Zd ZddZddZd Zy)BaseTestCaseNc                 `    t        ||      s"|d|}||d|z  z  }| j                  |      y )Nz is not a subclass of  : %s
issubclassfailureExceptionselfclsclass_or_tuplemsgmessages        +/root/Python-3.12.4/Lib/test/test_typing.pyassertIsSubclasszBaseTestCase.assertIsSubclass<   s?    #~.69>JG7S=(''00	 /    c                 `    t        ||      r"|d|}||d|z  z  }| j                  |      y )Nz is a subclass of rR   rS   rV   s        r\   assertNotIsSubclassz BaseTestCase.assertNotIsSubclassC   s?    c>*25~FG7S=(''00	 +r^   c                 <    t         j                  D ]	  } |         y N)typing	_cleanupsrW   fs     r\   clear_cacheszBaseTestCase.clear_cachesJ   s    !! 	AC	r^   rb   )__name__
__module____qualname__r]   r`   rg    r^   r\   rP   rP   :   s    11r^   rP   c                 .     t                fd       }|S )z:Runs `test_func` with various values for `proto` argument.c                     t        t        j                  dz         D ]'  }| j                  |      5   | |       d d d        ) y # 1 sw Y   4xY w)N   )pickle_protoproto)rangepickleHIGHEST_PROTOCOLsubTest)rW   rq   	test_funcs     r\   wrapperz%all_pickle_protocols.<locals>.wrapperR   sT    622Q67 	-E51 -$e,- -	-- -s   A		A	r   )rv   rw   s   ` r\   all_pickle_protocolsry   O   s#     9- -
 Nr^   c                       e Zd Zy)EmployeeNrh   ri   rj   rk   r^   r\   r{   r{   [       r^   r{   c                       e Zd Zy)ManagerNr|   rk   r^   r\   r   r   _   r}   r^   r   c                       e Zd Zy)FounderNr|   rk   r^   r\   r   r   c   r}   r^   r   c                       e Zd Zy)ManagingFounderNr|   rk   r^   r\   r   r   g   r}   r^   r   c                   <    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
y	)
AnyTestsc                 x    | j                  t              5  t        dt               d d d        y # 1 sw Y   y xY wN*   )assertRaises	TypeError
isinstancer   rW   s    r\   test_any_instance_type_errorz%AnyTests.test_any_instance_type_errorm   s/    y) 	 r3	  	  	    09c                     | j                  t        t              d        G d dt              }| j                  t        |      dt         d       y )Nz
typing.Anyc                       e Zd Zy)AnyTests.test_repr.<locals>.SubNr|   rk   r^   r\   Subr   t       r^   r   <class 'z".AnyTests.test_repr.<locals>.Sub'>)assertEqualreprr   rh   rW   r   s     r\   	test_reprzAnyTests.test_reprq   s@    cL1#Ixj BC	
r^   c                     | j                  t              5  t        dt               d d d        | j                  t              5  t        t            d d d        y # 1 sw Y   5xY w# 1 sw Y   y xY wr   )r   r   rT   r   intr   s    r\   test_errorszAnyTests.test_errorsz   s^    y) 	 r3	 y) 	H	 		  	 	 	s   AA'A$'A0c                     G d dt               }| j                  t        |t                      | j                   |       |        G d d      }| j	                  t        |t                      | j                   |       |        G d d||      }| j                  t        |t                       |       }| j                  ||       | j                  ||       | j                  ||       y )Nc                       e Zd Zy)(AnyTests.test_can_subclass.<locals>.MockNr|   rk   r^   r\   Mockr      r   r^   r   c                       e Zd Zy)-AnyTests.test_can_subclass.<locals>.SomethingNr|   rk   r^   r\   	Somethingr      r   r^   r   c                       e Zd Zy)1AnyTests.test_can_subclass.<locals>.MockSomethingNr|   rk   r^   r\   MockSomethingr      r   r^   r   )r   
assertTruerT   assertIsInstanceassertFalseassertNotIsInstance)rW   r   r   r   mss        r\   test_can_subclasszAnyTests.test_can_subclass   s    3
4-.dfd+Is34  d32It2
=#67_b-0b),b$'r^   c                 6     G d dt               } |dd       y )Nc                       e Zd Zd Zy)>AnyTests.test_subclassing_with_custom_constructor.<locals>.Subc                      y rb   rk   rW   argskwargss      r\   __init__zGAnyTests.test_subclassing_with_custom_constructor.<locals>.Sub.__init__   s    r^   Nrh   ri   rj   r   rk   r^   r\   r   r      s    5r^   r   r    )s)r   r   s     r\   (test_subclassing_with_custom_constructorz1AnyTests.test_subclassing_with_custom_constructor   s    	6# 	6 	Ar^   c                      G d d      } G d dt         |      } |dd      }| j                  |j                  d       | j                  |j                  d       y )Nc                       e Zd Zd Zy)HAnyTests.test_multiple_inheritance_with_custom_constructors.<locals>.Fooc                     || _         y rb   xrW   r   s     r\   r   zQAnyTests.test_multiple_inheritance_with_custom_constructors.<locals>.Foo.__init__   	    r^   Nr   rk   r^   r\   Foor          r^   r   c                        e Zd Z fdZ xZS )HAnyTests.test_multiple_inheritance_with_custom_constructors.<locals>.Barc                 2    || _         t        | 	  |       y rb   )ysuperr   )rW   r   r   	__class__s      r\   r   zQAnyTests.test_multiple_inheritance_with_custom_constructors.<locals>.Bar.__init__   s     #r^   rh   ri   rj   r   __classcell__r   s   @r\   Barr      s    $ $r^   r   rn      )r   r   r   r   )rW   r   r   bs       r\   2test_multiple_inheritance_with_custom_constructorsz;AnyTests.test_multiple_inheritance_with_custom_constructors   sO    	 		$#s 	$
 1Ia a r^   c                     | j                  t              5  t                d d d        | j                  t              5   t        t                      d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wrb   )r   r   r   typer   s    r\   test_cannot_instantiatez AnyTests.test_cannot_instantiate   s]    y) 	E	y) 	DIK	 		 		 	   AA(A%(A1c                     t         j                  t            t         j                  t            t         j                  t            y rb   )rc   r?   r   r>   r;   r   s    r\   test_any_works_with_aliasz"AnyTests.test_any_works_with_alias   s%    Ss		#r^   N)rh   ri   rj   r   r   r   r   r   r   r   r   rk   r^   r\   r   r   k   s*     
( !r^   r   c                   H    e Zd ZU ee   ed<   d Zd Zd Zd Z	d Z
d Zd Zy	)
BottomTypeTestsMixinbottom_typec                     | j                  | j                  | j                         | j                  | j                  | j                         | j                  | j                  d        y rb   )r   r   assertIsassertNotEqualr   s    r\   test_equalityz"BottomTypeTestsMixin.test_equality   sN    ))4+;+;<d&&(8(89D,,d3r^   c                 N    | j                  t        | j                        d        y rb   )r   r,   r   r   s    r\   test_get_originz$BottomTypeTestsMixin.test_get_origin   s    j!1!12D9r^   c                     | j                  t              5  t        d| j                         d d d        y # 1 sw Y   y xY wr   )r   r   r   r   r   s    r\   test_instance_type_errorz-BottomTypeTestsMixin.test_instance_type_error   s5    y) 	-r4++,	- 	- 	-s   6?c                    | j                  t              5  t        t        | j                         d d d        | j                  t              5  t        t
        | j                         d d d        y # 1 sw Y   BxY w# 1 sw Y   y xY wrb   )r   r   rT   r{   r   r   r   s    r\   test_subclass_type_errorz-BottomTypeTestsMixin.test_subclass_type_error   sm    y) 	3x!1!12	3y) 	3x!1!12	3 	3	3 	3	3 	3s   A2A>2A;>Bc                 ~    | j                  t              5  | j                  t            d d d        y # 1 sw Y   y xY wrb   )r   r   r   r   r   s    r\   test_not_genericz%BottomTypeTestsMixin.test_not_generic   s3    y) 	"S!	" 	" 	"   3<c           	      p   | j                  t        dt        j                  t	        | j
                              z         5   G d d| j
                        }d d d        | j                  t        t              5   G d dt        | j
                              }d d d        y # 1 sw Y   KxY w# 1 sw Y   y xY w)NCannot subclass c                       e Zd Zy)4BottomTypeTestsMixin.test_cannot_subclass.<locals>.ANr|   rk   r^   r\   Ar          r^   r   c                       e Zd Zy)4BottomTypeTestsMixin.test_cannot_subclass.<locals>.BNr|   rk   r^   r\   Br      r   r^   r   )assertRaisesRegexr   reescapestrr   CANNOT_SUBCLASS_TYPEr   rW   r   r   s      r\   test_cannot_subclassz)BottomTypeTestsMixin.test_cannot_subclass   s    ##I"RYYs43C3C/D%EEG 	D$$ 	 ##I/CD 	D))* 	 			 		 	s    B 8B, B),B5c                     | j                  t              5  | j                          d d d        | j                  t              5   t        | j                                d d d        y # 1 sw Y   BxY w# 1 sw Y   y xY wrb   )r   r   r   r   r   s    r\   r   z,BottomTypeTestsMixin.test_cannot_instantiate   sl    y) 		y) 	%"D!!"$	% 	%	 		% 	%s   A(A4(A14A=N)rh   ri   rj   r$   r   __annotations__r   r   r   r   r   r   r   rk   r^   r\   r   r      s/    #4
:-3"%r^   r   c                   "    e Zd ZeZd Zd Zd Zy)NoReturnTestsc                 B    | j                  t        t              d       y )Ntyping.NoReturn)r   r   r   r   s    r\   r   zNoReturnTests.test_repr   s    h):;r^   c                     dt         dt         fd}dd}t         t         d}||fD ]8  }| j                  |      5  | j                  t        |      |       d d d        : y # 1 sw Y   ExY w)Nargreturnc                      y rb   rk   r   s    r\   somez/NoReturnTests.test_get_type_hints.<locals>.some   s    Sr^   c                      y rb   rk   r   s    r\   some_strz3NoReturnTests.test_get_type_hints.<locals>.some_str       Cr^   r   r   target)r   r   r   r   )r   ru   r   gthrW   r   r  expectedr  s        r\   test_get_type_hintsz!NoReturnTests.test_get_type_hints   sl    0h080?#x8X& 	8FV, 8  Vh78 8	88 8   A""A+	c                 l    | j                  t        t               | j                  t        t               y rb   )r   r   r   r   s    r\   test_not_equalityzNoReturnTests.test_not_equality   s"    He,E8,r^   N)rh   ri   rj   r   r   r   r
  r  rk   r^   r\   r   r      s    K<8-r^   r   c                       e Zd ZeZd Zd Zy)
NeverTestsc                 B    | j                  t        t              d       y )Ntyping.Never)r   r   r   r   s    r\   r   zNeverTests.test_repr   s    en5r^   c                     dt         dt         fd}dd}t         t         d}||fD ]8  }| j                  |      5  | j                  t        |      |       d d d        : y # 1 sw Y   ExY w)Nr   r   c                      y rb   rk   r   s    r\   r   z,NeverTests.test_get_type_hints.<locals>.some   s    sr^   c                      y rb   rk   r   s    r\   r  z0NeverTests.test_get_type_hints.<locals>.some_str       cr^   r  r  )r   r   r   r  )r   ru   r   r  r  s        r\   r
  zNeverTests.test_get_type_hints   sl    *e**9 E2X& 	8FV, 8  Vh78 8	88 8r  N)rh   ri   rj   r   r   r   r
  rk   r^   r\   r  r     s    K68r^   r  c                       e Zd Zd Zy)AssertNeverTestsc                    | j                  t              5  t        d        d d d        d}| j                  t        |      5  t        |       d d d        ddz  }| j                  t              5 }t        |       d d d        | j	                  t        j                  j                  d         t        j                  dz         y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   exY w)Nz
some valueai'  r   r   )
r   AssertionErrorr   r   
assertLesslen	exceptionr   rc   _ASSERT_NEVER_REPR_MAX_LENGTH)rW   value
huge_valuecms       r\   test_exceptionzAssertNeverTests.test_exception   s    ~. 		 ##NE: 	 	  5[
~. 	%"$	%!!!$%0014	
	 		  	 
	% 	%s#   CC0C CC C)N)rh   ri   rj   r"  rk   r^   r\   r  r     s    
r^   r  c                   <    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
y	)
	SelfTestsc                     | j                  t        t               | j                  t        t               | j                  t        d        y rb   )r   rB   r   r   r   s    r\   r   zSelfTests.test_equality  s0    t$dD!D$'r^   c                 6    G d d      } G d d      } G d d      }|||fD ]H  }| j                  |      5  | j                  t        |j                        dt        i       d d d        J | j                  t        t              d        y # 1 sw Y   txY w)	Nc                       e Zd ZdefdZy)"SelfTests.test_basics.<locals>.Foor   c                      y rb   rk   r   s    r\   barz&SelfTests.test_basics.<locals>.Foo.bar      3r^   N)rh   ri   rj   rB   r*  rk   r^   r\   r   r(    s
    &T&r^   r   c                       e Zd ZddZy)%SelfTests.test_basics.<locals>.FooStrc                      y rb   rk   r   s    r\   r*  z)SelfTests.test_basics.<locals>.FooStr.bar      Sr^   N)r   rB   rh   ri   rj   r*  rk   r^   r\   FooStrr-    s    (r^   r1  c                       e Zd ZddZy)+SelfTests.test_basics.<locals>.FooStrTypingc                      y rb   rk   r   s    r\   r*  z/SelfTests.test_basics.<locals>.FooStrTyping.bar      Cr^   N)r   typing.Selfr0  rk   r^   r\   FooStrTypingr3    s    /r^   r7  r  r   )ru   r   r  r*  rB   r   r,   rW   r   r1  r7  r  s        r\   test_basicszSelfTests.test_basics  s    	' 	'	) 	)	0 	0 FL1 	DFV, D  VZZ8T2BCD D	D 	j&-D D   ,BB	c                 B    | j                  t        t              d       y )Nr6  )r   r   rB   r   s    r\   r   zSelfTests.test_repr$  s    d]3r^   c                 r    | j                  t              5  t        t            d d d        y # 1 sw Y   y xY wrb   )r   r   rB   r   r   s    r\   test_cannot_subscriptzSelfTests.test_cannot_subscript'  s,    y) 	I	 	 	   -6c                    | j                  t        t              5   G d dt        t                    }d d d        | j                  t        d      5   G d dt              }d d d        y # 1 sw Y   8xY w# 1 sw Y   y xY w)Nc                       e Zd Zy))SelfTests.test_cannot_subclass.<locals>.CNr|   rk   r^   r\   CrA  -  r   r^   rB  zCannot subclass typing\.Selfc                       e Zd Zy))SelfTests.test_cannot_subclass.<locals>.DNr|   rk   r^   r\   DrD  1  r   r^   rE  )r   r   r   r   rB   rW   rB  rE  s      r\   r   zSelfTests.test_cannot_subclass+  ss    ##I/CD 	DJ 	 ##I/1 	D 	 		 		 	   A+A7+A47B c                     | j                  t              5  t                d d d        | j                  t              5   t        t                      d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wrb   )r   r   rB   r   r   s    r\   test_cannot_initzSelfTests.test_cannot_init4  s]    y) 	F	y) 	DJL	 		 		 	r   c                     | j                  t              5  t        dt               d d d        | j                  t              5  t	        t
        t               d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wNrn   )r   r   r   rB   rT   r   r   s    r\   test_no_isinstancezSelfTests.test_no_isinstance:  sa    y) 	 q$	 y) 	"sD!	" 	"	  	 	" 	"   A"A."A+.A7c                 (   t         t        t        f   }t        t           }t        t           }| j	                  t        |      t        t        f       | j	                  t        |      t        f       | j	                  t        |      t        f       y rb   )r   rB   r   r$   r   r-   rW   alias_1alias_2alias_3s       r\   
test_aliaszSelfTests.test_alias@  si    d
#t*4.'*T4L9'*TG4'*TG4r^   Nrh   ri   rj   r   r9  r   r=  r   rI  rL  rS  rk   r^   r\   r$  r$    s*    (
.4"5r^   r$  c                   <    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
y	)
LiteralStringTestsc                     | j                  t        t               | j                  t        t               | j                  t        d        y rb   )r   rC   r   r   r   s    r\   r   z LiteralStringTests.test_equalityK  s0    6m]3M40r^   c                 6    G d d      } G d d      } G d d      }|||fD ]H  }| j                  |      5  | j                  t        |j                        dt        i       d d d        J | j                  t        t              d        y # 1 sw Y   txY w)	Nc                       e Zd ZdefdZy)+LiteralStringTests.test_basics.<locals>.Foor   c                      y rb   rk   r   s    r\   r*  z/LiteralStringTests.test_basics.<locals>.Foo.barR  r5  r^   N)rh   ri   rj   rC   r*  rk   r^   r\   r   rZ  Q  s
    /]/r^   r   c                       e Zd ZddZy).LiteralStringTests.test_basics.<locals>.FooStrc                      y rb   rk   r   s    r\   r*  z2LiteralStringTests.test_basics.<locals>.FooStr.barT      cr^   N)r   rC   r0  rk   r^   r\   r1  r]  S  s    1r^   r1  c                       e Zd ZddZy)4LiteralStringTests.test_basics.<locals>.FooStrTypingc                      y rb   rk   r   s    r\   r*  z8LiteralStringTests.test_basics.<locals>.FooStrTyping.barV      Sr^   N)r   typing.LiteralStringr0  rk   r^   r\   r7  ra  U  s    8r^   r7  r  r   )ru   r   r  r*  rC   r   r,   r8  s        r\   r9  zLiteralStringTests.test_basicsP  s    	0 	0	2 	2	9 	9 FL1 	MFV, M  VZZ8]2KLM M	M 	j/6M Mr:  c                 B    | j                  t        t              d       y )Nrd  )r   r   rC   r   s    r\   r   zLiteralStringTests.test_repr]  s    m,.DEr^   c                 r    | j                  t              5  t        t            d d d        y # 1 sw Y   y xY wrb   )r   r   rC   r   r   s    r\   r=  z(LiteralStringTests.test_cannot_subscript`  s-    y) 	#	 	 	r>  c                    | j                  t        t              5   G d dt        t                    }d d d        | j                  t        d      5   G d dt              }d d d        y # 1 sw Y   8xY w# 1 sw Y   y xY w)Nc                       e Zd Zy)2LiteralStringTests.test_cannot_subclass.<locals>.CNr|   rk   r^   r\   rB  ri  f  r   r^   rB  z%Cannot subclass typing\.LiteralStringc                       e Zd Zy)2LiteralStringTests.test_cannot_subclass.<locals>.DNr|   rk   r^   r\   rE  rk  j  r   r^   rE  )r   r   r   r   rC   rF  s      r\   r   z'LiteralStringTests.test_cannot_subclassd  st    ##I/CD 	D' 	 ##I8: 	M 	 		 		 	rG  c                     | j                  t              5  t                d d d        | j                  t              5   t        t                      d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wrb   )r   r   rC   r   r   s    r\   rI  z#LiteralStringTests.test_cannot_initm  s_    y) 	O	y) 	"D!	" 	"	 		" 	"r   c                     | j                  t              5  t        dt               d d d        | j                  t              5  t	        t
        t               d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wrK  )r   r   r   rC   rT   r   r   s    r\   rL  z%LiteralStringTests.test_no_isinstances  sa    y) 	)q-(	)y) 	+sM*	+ 	+	) 	)	+ 	+rM  c                 (   t         t        t        f   }t        t           }t        t           }| j	                  t        |      t        t        f       | j	                  t        |      t        f       | j	                  t        |      t        f       y rb   )r   rC   r   r$   r   r-   rO  s       r\   rS  zLiteralStringTests.test_aliasy  so    }45}%=)'*]M,JK'*],<='*],<=r^   NrT  rk   r^   r\   rV  rV  J  s+    1
7F"+>r^   rV  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)TypeVarTestsc                    t        d      }| j                  ||       | j                  |t                | j                  |j                  d       | j                  |j                  d       | j                  |j                  d        | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  t               y )Nr   rk   F)r   r   r   rh   __constraints__r   	__bound____covariant____contravariant____infer_variance__ri   rW   r   s     r\   test_basic_plainzTypeVarTests.test_basic_plain  s    CLAa)S)**B/akk4(aoou-a))51a**E2x0r^   c                    i }t        d||       |d   }| j                  |t               | j                  |j                  d       | j                  |j
                  d       | j                  |j                  t               | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d        y )Nz9from typing import TypeVar; T = TypeVar("T", bound=float)r   rk   F)execr   r   r   rh   rr  r   rs  floatrt  ru  rv  ri   )rW   nsr   s      r\   test_basic_with_execz!TypeVarTests.test_basic_with_exec  s    H"bQsGa)S)**B/akk5)aoou-a))51a**E2allD)r^   c                    t        dt              }| j                  |j                  d       | j                  |j                  d       | j                  |j                  t               t        dt        t              }| j                  |j                  d       | j                  |j                  t        t        f       | j                  |j                  d        t        dd      }| j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       t        d	d
      }| j                  |j                  d	       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       t        dd      }| j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       y )NT_boundboundrk   T_constraintsT_coT	covariantFT_contracontravariantT_infer)infer_variance)r   r   r   rh   rr  r   rs  r   rt  ru  rv  )rW   r  r  r  r  r  s         r\   test_attributeszTypeVarTests.test_attributes  s   )3/))9500"5g''-c://A66c
Cm--t4v./d(($/d,,e4d--u5:T:**J7h,,e4h00$7h1159)D9))95g++U3g//7g00$7r^   c                     t        d      }| j                  t              5  t        d|       d d d        y # 1 sw Y   y xY w)Nr   r   )r   r   r   r   rw  s     r\    test_typevar_instance_type_errorz-TypeVarTests.test_typevar_instance_type_error  s8    CLy) 	r1	 	 	s	   7A c                    t        d      }| j                  t              5  t        t        |       d d d        | j                  t              5  t        |t               d d d        y # 1 sw Y   8xY w# 1 sw Y   y xY wNr   )r   r   r   rT   r   rw  s     r\    test_typevar_subclass_type_errorz-TypeVarTests.test_typevar_subclass_type_error  sj    CLy) 	sA	y) 	q#	 		 		 	s   A)A5)A25A>c                 |    | j                  t              5  t        dt              }| d d d        y # 1 sw Y   y xY w)NX)r   r   r   r   rW   r  s     r\   test_constrained_errorz#TypeVarTests.test_constrained_error  s4    y) 	S!A	 	 	s   2;c                    t        d      }t        d      }| j                  ||       | j                  t        |   |       | j                  t        |   t        ||f          | j                  t        ||f   |       | j                  t        |t        f   t        |          | j                  t        |t        f   t        t                  | j                  t        |t        f   j
                  |t        f       | j                  t        |t        f   j                  |f       | j                  t        |t        f   j                  t               y )Nr  Y)	r   r   r   r   r   __args____parameters__r   
__origin__)rW   r  r  s      r\   test_union_uniquezTypeVarTests.test_union_unique  s   CLCLAq!q1%E!HeAqDk2q!ta(E!S&M584E!S&M5:6q#v//!S:q#v55t<eAsFm..6r^   c                 6   t        d      }| j                  |dz  t        |df          | j                  d|z  t        d|f          | j                  t        |dz        |t	        d      f       | j                  t        d|z        t	        d      |f       y Nr  r   )r   r   r   r-   rA   r  s     r\   test_orzTypeVarTests.test_or  s    CL 	S%3-0q%Q-0!c'*Q
3,@A#'*Z_a,@Ar^   c                 z    t        dt        t              }| j                  t        |t        f   t        |          y Nr   )r   r   bytesr   r   rW   r   s     r\   test_union_constrainedz#TypeVarTests.test_union_constrained  s,    Ce$E!S&M584r^   c                    | j                  t        t              d       | j                  t        t              d       | j                  t        t              d       | j                  t        t
              d       t        dd      }| j                  t        |      d       t        d	d
      }| j                  t        |      d       y )Nz~Tz~KTz~VTz~AnyStrr  Tr  z+T_cor  r  z	-T_contra)r   r   r   r   r   r   r   )rW   r  r  s      r\   r   zTypeVarTests.test_repr  s    a$'b5)b5)fy1v.dW-:T:h5r^   c                     | j                  t        d      t        d             | j                  t        dt        t              t        dt        t                     y r  )r   r   r   r   r   s    r\   test_no_redefinitionz!TypeVarTests.test_no_redefinition  s<    GCL'#,7GCc2GCc4JKr^   c                    | j                  t        t        dz        5   G d dt              }d d d        t        d      }| j                  t        t        dz        5   G d d|      }d d d        y # 1 sw Y   FxY w# 1 sw Y   y xY w)Nr   c                       e Zd Zy),TypeVarTests.test_cannot_subclass.<locals>.VNr|   rk   r^   r\   Vr    r   r^   r  r   c                       e Zd Zy),TypeVarTests.test_cannot_subclass.<locals>.WNr|   rk   r^   r\   Wr    r   r^   r  )r   r   NOT_A_BASE_TYPEr   CANNOT_SUBCLASS_INSTANCE)rW   r  r   r  s       r\   r   z!TypeVarTests.test_cannot_subclass  sw    ##I/JK 	#"G"	#CL##I(946 	A	 		# 	#	 	s   A3A?3A<?Bc                 x    | j                  t              5   t        d              d d d        y # 1 sw Y   y xY wr  )r   r   r   r   s    r\   test_cannot_instantiate_varsz)TypeVarTests.test_cannot_instantiate_vars  s0    y) 	GCLN	 	 	r   c                 t   | j                  t              5  t        dt               d d d        | j                  t              5  t        dt        t
        t               d d d        | j                  t        d      5  t        dd       d d d        y # 1 sw Y   oxY w# 1 sw Y   BxY w# 1 sw Y   y xY w)Nr  r  z%Bound must be a type\. Got \(1, 2\)\.rn   r   )r   r   r   r   r   r{  r{   r   r   s    r\   test_bound_errorszTypeVarTests.test_bound_errors   s    y) 	&Cu%	&y) 	5Ce84	5##I$LN 	'Cv&	' 	'		& 	&	5 	5	' 	's#   BB"?B.B"B+.B7c                      d}t        |i        y )Nz&import typing
T = typing.TypeVar('T')
rz  rW   codes     r\   test_missing__name__z!TypeVarTests.test_missing__name__	  s    , 	T2r^   c                 t    | j                  t              5  t        ddd       d d d        y # 1 sw Y   y xY w)Nr   T)r  r  r   
ValueErrorr   r   s    r\   test_no_bivariantzTypeVarTests.test_no_bivariant  s1    z* 	=C4t<	= 	= 	=s   .7c                     | j                  t              5  t        ddd       d d d        | j                  t              5  t        ddd       d d d        y # 1 sw Y   6xY w# 1 sw Y   y xY w)Nr   T)r  r  )r  r  r  r   s    r\   &test_cannot_combine_explicit_and_inferz3TypeVarTests.test_cannot_combine_explicit_and_infer  sj    z* 	>C4=	>z* 	BCtDA	B 	B	> 	>	B 	Bs   AA&A#&A/c                    t        d      }|j                  }| j                   |t              t               | j	                   |t
        t                 t
        t                  | j	                   |t        t                 t        t                  | j	                   |t              t               | j                   |t              t               | j                   |d       t        d              | j                   ||      |       | j	                   |t        t        z        t        t        z         | j	                   |t        t        t        f         t        t        t        f          y r  )r   __typing_subst__r   r   r   listr   r   r   r   r   )rW   r   substs      r\   test_var_substitutionz"TypeVarTests.test_var_substitution  s    CL""eCj#&tCy)495tCy)495td+eCj#&eDk4:.eAh"s3wS1uS#X/sCxAr^   c                 d   t        d      }dt        t        ft        t        t        |   t
        t
        |   t        t        t           t        t        t           f}|D ]  }| j                  |      5  | j                  t              5   |j                  |       d d d        | j                  t              5  t        |   |    d d d        | j                  t              5  t        |   |    d d d        d d d         y # 1 sw Y   hxY w# 1 sw Y   JxY w# 1 sw Y   ,xY w# 1 sw Y   xY w)Nr   rk   r   )r   r   r   r   r#   r'   r%   r$   ru   r   r   r  r   r  )rW   r   bad_argsr   s       r\   test_bad_var_substitutionz&TypeVarTests.test_bad_var_substitution'  s   CLc
EWQZ8A;5:x#

  	!C#& !&&y1 ,&A&&s+,&&y1 !GCL!&&y1 !GCL!! !	!, ,! !! !! !sT   2D&DD&8DD&"D/D&DD&DD&D#D&&D/	c                     t         t        t        fD ]V  }| j                  |      5  t	        j
                         }t        d      D ]  } |t        |            ||<    ~d d d        X y # 1 sw Y   cxY w)NrX   
   )rE   r   r   ru   weakrefWeakValueDictionaryrr   r   )rW   rX   valsr   s       r\   test_many_weakrefszTypeVarTests.test_many_weakrefs7  su    |W5 	C#& 224r *A!#a&kDG* 	 s   :A,,A5	c                     t        d      }| j                  |j                  d       | j                  |j                  d       | j	                  |j
                  d        y )Nr   )namerk   )r   r   rh   rr  r   rs  rw  s     r\   test_constructorzTypeVarTests.test_constructorA  sH    S)**B/akk4(r^   N)rh   ri   rj   rx  r}  r  r  r  r  r  r  r  r   r  r   r  r  r  r  r  r  r  r  r  rk   r^   r\   rp  rp    so    1*8:

7B56L'=BB! )r^   rp  	templatesreplacementsr   c                    g }|j                         D ]2  \  }}g }|D ]  }|j                  ||f        |j                  |       4 g }t        j                  | D ]R  }g }	| D ]/  }
|D ]  \  }}|
j	                  ||      }
 |	j                  |
       1 |j                  t        |	             T g }|D ]  }||vs|j                  |        |S )a  Renders templates with possible combinations of replacements.

    Example 1: Suppose that:
      templates = ["dog_breed are awesome", "dog_breed are cool"]
      replacements = ["dog_breed": ["Huskies", "Beagles"]]
    Then we would return:
      [
          ("Huskies are awesome", "Huskies are cool"),
          ("Beagles are awesome", "Beagles are cool")
      ]

    Example 2: Suppose that:
      templates = ["Huskies are word1 but also word2"]
      replacements = {"word1": ["playful", "cute"],
                      "word2": ["feisty", "tiring"]}
    Then we would return:
      [
          ("Huskies are playful but also feisty"),
          ("Huskies are playful but also tiring"),
          ("Huskies are cute but also feisty"),
          ("Huskies are cute but also tiring")
      ]

    Note that if any of the replacements do not occur in any template:
      templates = ["Huskies are word1", "Beagles!"]
      replacements = {"word1": ["playful", "cute"],
                      "word2": ["feisty", "tiring"]}
    Then we do not generate duplicates, returning:
      [
          ("Huskies are playful", "Beagles!"),
          ("Huskies are cute", "Beagles!")
      ]
    )itemsappend	itertoolsproductreplacetuple)r  r  replacement_combosoriginalpossible_replacementsoriginal_replacement_tuplesreplacementrendered_templatesreplacement_combotemplates_with_replacementstemplate rendered_templates_no_duplicatesr   s                r\   template_replacer  H  s!   N +7+=+=+? ?''&(#0 	HK'..+/FG	H!!"=>	? &..0BC F ')#! 	9H): C%+#++HkBC'..x8	9 	!!%(C"DEF (*$ 744,33A67
 ,+r^   c                       e Zd Zd Zd Zy)TemplateReplacementTestsc                 \    t        ddgddgddgd      }g d	}| j                  ||       y )
NCats are word1zDogs are word2smallcutebigfluffyword1word2r  r  ))Cats are smallDogs are big)r  Dogs are fluffy)Cats are cuter  )r  r  r  r   rW   actualr	  s      r\   :test_two_templates_two_replacements_yields_correct_renderszSTemplateReplacementTests.test_two_templates_two_replacements_yields_correct_renders  sC    !+-=>%v.#X.

 	*r^   c                 \    t        ddgddgddgd      }d	d
g}| j                  ||       y )Nr  Dogs!r  r  r  r  r  r  )r  r  )r  r  r  r  s      r\   2test_no_duplicates_if_replacement_not_in_templateszKTemplateReplacementTests.test_no_duplicates_if_replacement_not_in_templates  sJ    !+W5%v.#X.
 (&
 	*r^   N)rh   ri   rj   r  r  rk   r^   r\   r  r    s    + +r^   r  c                   (    e Zd ZdZd Zd Zd Zd Zy)GenericAliasSubstitutionTestsaK  Tests for type variable substitution in generic aliases.

    For variadic cases, these tests should be regarded as the source of truth,
    since we hadn't realised the full complexity of variadic substitution
    at the time of finalizing PEP 646. For full discussion, see
    https://github.com/python/cpython/issues/91162.
    c           	         t        d      }t        d      }t        d      } G d dt        |         }g d}ddg}g d	}|D ]  \  }}	}
t        ||	|
g||d
      }|D ]|  \  }}}| j	                  |||      5  |dk(  r-| j                  t              5  t        ||z          d d d        n'| j                  t        ||z         t        |             d d d        ~  y # 1 sw Y   xY w# 1 sw Y   xY w)Nr   TsTs2c                       e Zd Zy);GenericAliasSubstitutionTests.test_one_parameter.<locals>.CNr|   rk   r^   r\   rB  r    r   r^   rB  )rB  r  r   r  r   ))
generic[T][()]r   )r  [int]generic[int])r  
[int, str]r   )r  [tuple_type[int, ...]]generic[tuple_type[int, ...]])r  [*tuple_type[int]]r  )r  z[*tuple_type[()]]r   )r  [*tuple_type[int, str]]r   )r  [*tuple_type[int, ...]]r   )r  [*Ts]r   )r  [T, *Ts]r   )r  [*Ts, T]r   )zC[T, *tuple_type[int, ...]]r  r   )zlist[T, *tuple_type[int, ...]]r  z list[int, *tuple_type[int, ...]])zList[T, *tuple_type[int, ...]]r  r   )zgeneric[*Ts, *Ts2]r  r   generic
tuple_typer  aliasr   r	  r   	r   r   r#   r  ru   r   r   evalr   )rW   r   r  r   rB  genericstuple_typestestsalias_templateargs_templateexpected_templater  	alias_strargs_strexpected_strs                  r\   test_one_parameterz0GenericAliasSubstitutionTests.test_one_parameter  s!   CL$5!!
!((
. AF 	<NM+<!1-}>OP-5[!Q" 6H 	1	8\\\	<\X #{2!..y9 7 X!567 7 (( X!56 . 		7 7 s$   9C,C 	#0C, C)%C,,C5c           	         t        d      }t        d      }t        d      } G d dt        ||f         }g d}ddg}g d	}|D ]  \  }}	}
t        ||	|
g||d
      }|D ]|  \  }}}| j	                  |||      5  |dk(  r-| j                  t              5  t        ||z          d d d        n'| j                  t        ||z         t        |             d d d        ~  y # 1 sw Y   xY w# 1 sw Y   xY w)NT1T2r  c                       e Zd Zy)<GenericAliasSubstitutionTests.test_two_parameters.<locals>.CNr|   rk   r^   r\   rB  r%    r   r^   rB  )rB  dictr    r  r   ))generic[T1, T2]r  r   )r'  r  r   )r'  r  generic[int, str])r'  [int, str, bool]r   )r'  r
  r   )r'  r  r(  )r'  z[*tuple_type[int, str, bool]]r   )r'  z[int, *tuple_type[str]]r(  )r'  z[*tuple_type[int], str]r(  )r'  z$[*tuple_type[int], *tuple_type[str]]r(  )r'  z([*tuple_type[int, str], *tuple_type[()]]r(  )r'  z([*tuple_type[()], *tuple_type[int, str]]r(  )r'  z#[*tuple_type[int], *tuple_type[()]]r   )r'  z#[*tuple_type[()], *tuple_type[int]]r   )r'  z+[*tuple_type[int, str], *tuple_type[float]]r   )r'  z+[*tuple_type[int], *tuple_type[str, float]]r   )r'  z1[*tuple_type[int, str], *tuple_type[float, bool]]r   )r'  r  r   )r'  ,[tuple_type[int, ...], tuple_type[str, ...]]3generic[tuple_type[int, ...], tuple_type[str, ...]])r'  r  r   )r'  z[int, *tuple_type[str, ...]]r   )r'  [*tuple_type[int, ...], str]r   )r'  .[*tuple_type[int, ...], *tuple_type[str, ...]]r   )r'  r  r   )r'  r  r   )r'  r  r   )z"generic[T1, *tuple_type[int, ...]][str]#generic[str, *tuple_type[int, ...]]r  r  r  r   r  rW   r"  r#  r  rB  r  r  r  r  r  r  r  r  r  r  s                  r\   test_two_parametersz1GenericAliasSubstitutionTests.test_two_parameters  s%   T]T]$&B&((%
N AF 	<NM+<!1-}>OP-5[!Q" 6H 	1	8\\\	<\X #{2!..y9 7 X!567 7 (( X!56 . 		7 7 $   ;C.C"	%0C."C+'C..C7c           	         t        d      }t        d      }t        d      } G d dt        |||f         }dg}ddg}dd	g}|D ]  \  }}	}
t        ||	|
g||d
      }|D ]|  \  }}}| j                  |||      5  |dk(  r-| j	                  t
              5  t        ||z          d d d        n'| j                  t        ||z         t        |             d d d        ~  y # 1 sw Y   xY w# 1 sw Y   xY w)Nr"  r#  T3c                       e Zd Zy)>GenericAliasSubstitutionTests.test_three_parameters.<locals>.CNr|   rk   r^   r\   rB  r6  .  r   r^   rB  r  r   )generic[T1, bool, T2]r  generic[int, bool, str])r7  r  r8  r  r  r  r   )r   r#   r  ru   r   r   r  r   )rW   r"  r#  r4  rB  r  r  r  r  r  r  r  r  r  r  s                  r\   test_three_parametersz3GenericAliasSubstitutionTests.test_three_parameters)  s4   T]T]T]*B
#*5( G G
 AF 	<NM+<!1)=:KL)1M" 6H 	1	8\\\	<\X #{2!..y9 7 X!567 7 (( X!56 . 		7 7 r2  c           	         t        d      }t        d      }t        d      } G d dt        g |         }g d}ddg}g d	}|D ]  \  }}	}
t        ||	|
g||d
      }|D ]|  \  }}}| j	                  |||      5  |dk(  r-| j                  t              5  t        ||z          d d d        n'| j                  t        ||z         t        |             d d d        ~  y # 1 sw Y   xY w# 1 sw Y   xY w)Nr"  r#  r  c                       e Zd Zy)AGenericAliasSubstitutionTests.test_variadic_parameters.<locals>.CNr|   rk   r^   r\   rB  r<  N  r   r^   rB  )rB  r  r   r  r   )@)generic[*Ts]r  zgeneric[()])r=  r  r  )r=  r  r(  )r=  r
  r  )r=  z[*tuple_type[*Ts]]r=  )r=  r  r(  )r=  z"[str, *tuple_type[int, ...], bool])generic[str, *tuple_type[int, ...], bool])r=  r  r	  )r=  r*  r+  )r=  r  zgeneric[*tuple_type[int, ...]])r=  r-  r   )r=  r  r=  )r=  r  generic[T, *Ts])r=  r  generic[*Ts, T])r?  r  r   )r?  r  r  )r?  r  r(  )r?  r)  generic[int, str, bool])generic[list[T], *Ts]r  r   )rB  r  generic[list[int]])rB  r  zgeneric[list[int], str])rB  r)  zgeneric[list[int], str, bool])r@  r  r   )r@  r  r  )r@  r  r(  )r@  r)  rA  )generic[*Ts, list[T]]r  r   )rD  r  rC  )rD  r  zgeneric[int, list[str]])rD  r)  zgeneric[int, str, list[bool]])generic[T1, T2, *Ts]r  r   )rE  r  r   )rE  r  r(  )rE  r)  rA  )rE  [int, str, bool, bytes]generic[int, str, bool, bytes])generic[*Ts, T1, T2]r  r   )rH  r  r   )rH  r  r(  )rH  r)  rA  )rH  rF  rG  )generic[T1, *Ts, T2]r  r   )rI  r  r   )rI  r  r(  )rI  r)  rA  )rI  rF  rG  )r?  r  z#generic[int, *tuple_type[int, ...]])r?  [str, *tuple_type[int, ...]]r/  )r?  r,  z(generic[int, *tuple_type[int, ...], str])r@  r  z#generic[*tuple_type[int, ...], int])r@  rJ  z(generic[str, *tuple_type[int, ...], int])r@  r,  #generic[*tuple_type[int, ...], str])rI  r  z(generic[int, *tuple_type[int, ...], int])zgeneric[T, str, *Ts]r  z(generic[int, str, *tuple_type[int, ...]])zgeneric[*Ts, str, T]r  z(generic[*tuple_type[int, ...], str, int])rB  r  z)generic[list[int], *tuple_type[int, ...]])rD  r  z)generic[*tuple_type[int, ...], list[int]])z!generic[T, *tuple_type[int, ...]]r.  r/  )z&generic[T1, T2, *tuple_type[int, ...]][str, bool]z)generic[str, bool, *tuple_type[int, ...]])&generic[T1, *tuple_type[int, ...], T2]rL  r>  )rM  z[str, bool, float]r   )z!generic[T1, *tuple_type[T2, ...]]r  z#generic[int, *tuple_type[str, ...]])z!generic[*tuple_type[T1, ...], T2]r  rK  )z+generic[T1, *tuple_type[generic[*Ts], ...]]r)  z2generic[int, *tuple_type[generic[str, bool], ...]])z+generic[*tuple_type[generic[*Ts], ...], T1]r)  z2generic[*tuple_type[generic[int, str], ...], bool]r  r  r  r   r  r0  s                  r\   test_variadic_parametersz6GenericAliasSubstitutionTests.test_variadic_parametersI  s&   T]T]$##*(J
X AF 	<NM+<!1-}>OP-5[!Q" 6H 	1	8\\\	<\X #{2!..y9 7 X!567 7 (( X!56 . 		7 7 s$   <C/C#	&0C/#C,(C//C8N)rh   ri   rj   __doc__r   r1  r9  rN  rk   r^   r\   r  r    s    /d?B@dr^   r  c                   <    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
y	)
UnpackTestsc                 L    g t         t            t        t        t               y rb   )r  r   r   r   r   s    r\   test_accepts_single_typez$UnpackTests.test_accepts_single_type  s    %*uSzr^   c                     t        t        t        t        t                          }dD ]/  }| j                  |      5  | j                  ||       d d d        1 y # 1 sw Y   <xY wNr  r  r  required_item)setdirr   r   r   ru   assertInrW   	dir_itemsrX  s      r\   test_dirzUnpackTests.test_dir  sc    F5:./0	
 	8M M: 8mY78 8	88 8s   AA%	c                     | j                  t              5  t        t        t           t        t
           f    d d d        y # 1 sw Y   y xY wrb   )r   r   r   r   r   r   r   s    r\   test_rejects_multiple_typesz'UnpackTests.test_rejects_multiple_types  s:    y) 	+5:uSz)*	+ 	+ 	+s   "AA
c                 2   | j                  t              5  g t        t           d   t        t               d d d        | j                  t              5  t        t
        t              t
        t               d d d        y # 1 sw Y   JxY w# 1 sw Y   y xY wNr   )r   r   r  r   r   r   r   s    r\   &test_rejects_multiple_parameterizationz2UnpackTests.test_rejects_multiple_parameterization  s{    y) 	*eCjN1eCj)	*y) 	+5:uSz*	+ 	+	* 	*	+ 	+s   "B#BB
Bc                 l    | j                  t              5  t                d d d        y # 1 sw Y   y xY wrb   )r   r   r   r   s    r\   test_cannot_be_calledz!UnpackTests.test_cannot_be_called  s*    y) 	H	 	 	   *3c                     t        dt        t        d      }dt        |   fd}| j	                  t        |j                  d         dt         d       y )NMovie)r  yearr   c                       y rb   rk   )r   s    r\   fooz/UnpackTests.test_usage_with_kwargs.<locals>.foo      #r^   ztyping.Unpack[z.Movie])r9   r   r   r   r   r   r   rh   )rW   rh  rk  s      r\   test_usage_with_kwargsz"UnpackTests.test_usage_with_kwargs  sK    'C#=>-&--c11(;<)(7;	=r^   c                    t        d      } G d dt        g |         } d        }|t        g|   }| j                  |t           j
                  t        t        f       | j                  |g t        t              j
                  t        t        f       | j                  |g t        t              j
                  t        t        f       | j                  |t        t        t                 j
                  t        t        f       | j                  |t        t        t                 j
                  t        t        f       |t        g|   }| j                  |t           j
                  t        t        f       | j                  |g t        t              j
                  t        t        f       | j                  |g t        t              j
                  t        t        f       | j                  |t        t        t                 j
                  t        t        f       | j                  |t        t        t                 j
                  t        t        f       y )Nr  c                       e Zd Zy)+UnpackTests.test_builtin_tuple.<locals>.OldNr|   rk   r^   r\   Oldrp    r   r^   rq  c                  0    d 	x} f G fdd
}|      S )r  c                       e Zd ZW  Zy)+UnpackTests.test_builtin_tuple.<locals>.NewNrh   ri   rj   __type_params__.type_paramss   r\   Newrt         r^   ry  rk   r  .generic_baserx  s     @r\   z<generic parameters of New>zCUnpackTests.test_builtin_tuple.<locals>.<generic parameters of New>      #r^   )	r   r#   r   r   r   r  r  r   r   )rW   r  rq  ry  PartOldPartNews         r\   test_builtin_tuplezUnpackTests.test_builtin_tuple  s   $$'#2#,$chBh-..c
;%*-66c
C%*-66c
Cc
!34==SzJc
!34==SzJchBh-..c
;%*-66c
C%*-66c
Cc
!34==SzJc
!34==SzJr^   c                 v   t        d      } d        }|t        g|   }t        j                  d      }| j	                  t
        |      5  |t        t        t                  d d d        | j	                  t
        |      5  |t        t        t                  d d d        y # 1 sw Y   @xY w# 1 sw Y   y xY w)Nr  c                  0    d 	x} f G fdd
}|      S )r  c                       e Zd ZW  Zy)/UnpackTests.test_unpack_wrong_type.<locals>.GenNru  rw  s   r\   Genr    rz  r^   r  rk   r{  s     @r\   z<generic parameters of Gen>zGUnpackTests.test_unpack_wrong_type.<locals>.<generic parameters of Gen>  r}  r^   z*Unpack[...] must be used with a tuple type)	r   r   r   r   r   r   r   r  r   )rW   r  r  PartGenbad_unpack_params        r\   test_unpack_wrong_typez"UnpackTests.test_unpack_wrong_type  s    $chBh-99%QR##I/?@ 	'F49%&	'##I/?@ 	'F49%&	' 	'	' 	'	' 	's   B#B/#B,/B8N)rh   ri   rj   rS  r^  r`  rc  re  rm  r  r  rk   r^   r\   rQ  rQ    s+    8++=K(	'r^   rQ  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&y%)&TypeVarTupleTestsc                 V    |j                  |      s| j                  d|d|       y y )NzString z does not end with )endswithfail)rW   stringtails      r\   assertEndsWithz TypeVarTupleTests.assertEndsWith  s-    t$IIz)<THEF %r^   c                     t        d      }| j                  |j                  d       t        d      }| j                  |j                  d       y )Nr  r   )r   r   rh   )rW   r  r   s      r\   	test_namezTypeVarTupleTests.test_name  s>    $d+5!u-r^   c                 Z    t        d      }| j                  |j                  t               y Nr  )r   r   ri   rh   rW   r  s     r\   test_modulezTypeVarTupleTests.test_module  s     $1r^   c                     i }t        d|       |d   }| j                  |j                  d       | j                  |j                  d        y )Nz8from typing import TypeVarTuple; Ts = TypeVarTuple("Ts")r  )rz  r   rh   r   ri   )rW   r|  r  s      r\   	test_execzTypeVarTupleTests.test_exec  sA    GLXd+bmmT*r^   c                 >    t        d      }| j                  ||       y r  )r   r   r  s     r\    test_instance_is_equal_to_itselfz2TypeVarTupleTests.test_instance_is_equal_to_itself  s    $R r^   c                 L    | j                  t        d      t        d             y r  )r   r   r   s    r\   &test_different_instances_are_differentz8TypeVarTupleTests.test_different_instances_are_different  s    L.T0BCr^   c                 F    t        d      }| j                  |t                y r  )r   r   r  s     r\   (test_instance_isinstance_of_typevartuplez:TypeVarTupleTests.test_instance_isinstance_of_typevartuple  s    $b,/r^   c                 |    t        d      }| j                  t              5   |        d d d        y # 1 sw Y   y xY wr  )r   r   r   r  s     r\   test_cannot_call_instancez+TypeVarTupleTests.test_cannot_call_instance  s4    $y) 	D	 	 	s   2;c                     t        d      }| j                  g |d   g |d          | j                  t        |   t        |          y )Nr  r   )r   r   r   r  s     r\   -test_unpacked_typevartuple_is_equal_to_itselfz?TypeVarTupleTests.test_unpacked_typevartuple_is_equal_to_itself  sD    $2FbF1I.VBZ0r^   c                     t        d      }| j                  t        g |   t        g |          | j                  t        t        |      t        t        |             y r  )r   r   r  r   r   r  s     r\   +test_parameterised_tuple_is_equal_to_itselfz=TypeVarTupleTests.test_parameterised_tuple_is_equal_to_itself"  sN    $ssU3B3Z0vbz*E&*,=>r^   c                    t        d      }t        d      }| j                  t        g ||   t        g ||          | j                  t        t        |   t        |   f   t        t        |   t        |   f          y )NTs1r   )r   r   r  r   r   )rW   r  r   s      r\    tests_tuple_arg_ordering_mattersz2TypeVarTupleTests.tests_tuple_arg_ordering_matters'  s~    5!5!*3***3**	
 	&+vc{*+&+vc{*+	
r^   c                 L   t        d      }t        g |   }| j                  |j                  g |       | j                  |j                  |f       t
        t        |      }| j                  |j                  t        |   f       | j                  |j                  |f       y r  )r   r  r   r  r  r   r   )rW   r  t1t2s       r\   *test_tuple_args_and_parameters_are_correctz<TypeVarTupleTests.test_tuple_args_and_parameters_are_correct3  s    $3B3Zff-**RE26":vbzm4**RE2r^   c           	         t        d      }t        d      }t        d      } G d dt        g |         } G d dt        t        |            }||t        t
        fD ]  }|g |   }| j                  |d   |d          | j                  |t           |t                  | j                  |t        t        f   |t        t        f          |t        |      }| j                  |d   |d          | j                  |t           |t                  | j                  |t        t        f   |t        t        f          t        |g |      }	| j                  |	d   t        |d             | j                  |	t           t        |t                     | j                  |	t        t        f   t        |t        t        f             t        |t        |         }
| j                  |
d   t        |d             | j                  |
t           t        |t                     | j                  |
t        t        f   t        |t        t        f             ||g||   }| j                  t              5  |d    d d d        | j                  t              5  |t            d d d        | j                  |t        t        f   |t        t        f          | j                  |t        t        t        f   |t        t        t        f          | j                  |t        t        t        t        f   |t        t        t        t        f          ||t        |   |f   }| j                  t              5  |d    d d d        | j                  t              5  |t            d d d        | j                  |t        t        f   |t        t        f          | j                  |t        t        t        f   |t        t        t        f          | j                  |t        t        t        t        f   |t        t        t        t        f          t
        t        |   |g |   t        |   f   }| j                  t              5  |d    d d d        | j                  t              5  |t            d d d        |t        k7  rB| j                  |t        t        f   t
        t        t           |d   t        t           f          | j                  |t        t        t        f   t
        t        t           |t           t        t           f          | j                  |t        t        t        t        f   t
        t        t           |t        t        f   t        t           f          t        t        |   |t        |      t        |   f   }| j                  t              5  |d    d d d        | j                  t              5  |t            d d d        |t        k7  rB| j                  |t        t        f   t        t        t           |d   t        t           f          | j                  |t        t        t        f   t        t        t           |t           t        t           f          | j                  |t        t        t        t        f   t        t        t           |t        t        f   t        t           f           y # 1 sw Y   xY w# 1 sw Y   hxY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   oxY w# 1 sw Y   UxY w)	Nr  r   r#  c                       e Zd Zy)3TypeVarTupleTests.test_var_substitution.<locals>.G1Nr|   rk   r^   r\   G1r  @  r   r^   r  c                       e Zd Zy)3TypeVarTupleTests.test_var_substitution.<locals>.G2Nr|   rk   r^   r\   G2r  A  r   r^   r  rk   )r   r   r#   r   r   r  r   r{  r   r  r   r   r   r   r  )rW   r  r   r#  r  r  r   r   rB  rE  EFGHIs                  r\   r  z'TypeVarTupleTests.test_var_substitution<  s   $CLT]$"$+$+R% ?	KA#2#AQrUAbE*QuXqx0Qucz]AeSjM:&*AQrUAbE*QuXqx0Qucz]AeSjM:QssVAQrUD2K0QuXtAeH~6Qucz]D5#:,?@Qvbz]#AQrUD2K0QuXtAeH~6Qucz]D5#:,?@!*b*"*A""9- """9- %Qucz]AeSjM:Quc3/5#s?1CDQuc356%c5:P8QR!VBZ#$A""9- """9- %Qucz]AeSjM:Quc3/5#s?1CDQuc356%c5:P8QRd1gq"vtBx/0A""9- """9- %Ez  5#:!&tE{AbE49'D!EGQuc3/"4;#S	#ABDQuc356"4;#s(T%[#HIK d1gq}d2h67A""9- """9- %Ez  5#:!&tE{AbE49'D!EGQuc3/"4;#S	#ABDQuc356"4;#s(T%[#HIK}?	K,        s`   2[8
\-\
\9\,
\9]6
]8\	\	\	\)	,\6	9]	]	]	c                 X   t        d      }t        d      }t        d      } G d dt        g |         } G d dt        t        |            }||t        t
        fD ]q  }||   }| j                  t              5  |t        t        f    d d d        |||f   }| j                  t              5  |g |    d d d        | j                  t              5  |t        |       d d d        ||g|t        |   }| j                  t              5  |t        g|    d d d        | j                  t              5  |t        g||    d d d        ||t        |   t        |f   }| j                  t              5  |t        t        |   f    d d d        | j                  t              5  |t        t        |   t        |   f    d d d        t y # 1 sw Y   JxY w# 1 sw Y   *xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w)Nr  r   r#  c                       e Zd Zy)7TypeVarTupleTests.test_bad_var_substitution.<locals>.G1Nr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zy)7TypeVarTupleTests.test_bad_var_substitution.<locals>.G2Nr|   rk   r^   r\   r  r    r   r^   r  )
r   r   r#   r   r   r  r   r   r   r   )	rW   r  r   r#  r  r  r   r   rB  s	            r\   r  z+TypeVarTupleTests.test_bad_var_substitution  s   $CLT]$"$+$+R% 	/A"A""9- #s( !R%A""9- #2#""9- &* !/b/#/r/"A""9- #((""9- !#--R- ! !VBZb()A""9- ##vbz/"#""9- /#vbz6":-./ /)	/    ! !# #/ /sT   <G0	G!G.G;<H=H-HG	!G+	.G8	;H	H	H	H)	c                 r   t        d      } G d dt        g |         } G d dt        t        |            }| j                  t	        |      d       | j                  t	        g |d         d       | j                  t	        t        |         d       | j                  t	        t
        g |         d       | j                  t	        t        t        |            d	       | j                  t	        t
        g |    d
       | j                  t	        t        t        t        |               d       y )Nr  c                       e Zd Zy)2TypeVarTupleTests.test_repr_is_correct.<locals>.G1Nr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zy)2TypeVarTupleTests.test_repr_is_correct.<locals>.G2Nr|   rk   r^   r\   r  r    r   r^   r  r   ztyping.Unpack[Ts]ztuple[typing.Unpack[Ts]]ztyping.Tuple[typing.Unpack[Ts]]z*tuple[typing.Unpack[Ts]]z.typing.Unpack[typing.Tuple[typing.Unpack[Ts]]])r   r#   r   r   r   r  r   )rW   r  r  r  s       r\   test_repr_is_correctz&TypeVarTupleTests.test_repr_is_correct  s    $$"$+$+b4(ffQi*=>fRj)+>?eCRCj)+EFeF2J/02STuSbSz*,GHfU6":%678:jkr^   c           
      p   t        d      } G d dt        g |         } G d dt        t        |            }| j                  t	        |d         d       | j                  t	        |d         d       | j                  t	        |t
                 d	       | j                  t	        |t
                 d
       | j                  t	        |t
        t        f         d       | j                  t	        |t
        t        f         d       | j                  t	        |g t        t        df            d       | j                  t	        |t        t        t        df               d       | j                  t	        |t
        gt        t        df            d       | j                  t	        |t
        t        t        t        df      f         d       | j                  t	        |g t        t        df   t                 d       | j                  t	        |t        t        t        df      t        f         d       | j                  t	        |t
        gt        t        df   t                 d       | j                  t	        |t
        t        t        t        df      t        f         d       y )Nr  c                       e Zd Zy)@TypeVarTupleTests.test_variadic_class_repr_is_correct.<locals>.ANr|   rk   r^   r\   r   r    r   r^   r   c                       e Zd Zy)@TypeVarTupleTests.test_variadic_class_repr_is_correct.<locals>.BNr|   rk   r^   r\   r   r    r   r^   r   rk   A[()]zB[()]A[float]zB[float]A[float, str]zB[float, str].zA[*tuple[int, ...]]z(B[typing.Unpack[typing.Tuple[int, ...]]]zA[float, *tuple[int, ...]]z/A[float, typing.Unpack[typing.Tuple[int, ...]]]zA[*tuple[int, ...], str]z-B[typing.Unpack[typing.Tuple[int, ...]], str]zA[float, *tuple[int, ...], str]z4B[float, typing.Unpack[typing.Tuple[int, ...]], str])
r   r#   r   r  r   r{  r   r  r   r   )rW   r  r   r   s       r\   #test_variadic_class_repr_is_correctz5TypeVarTupleTests.test_variadic_class_repr_is_correct  sD   $##*r
#*D2K1D2K1D5NJ7D5NJ7D5#:/AD5#:/AD#3E#s(O#3!451	3D6%S/#:!;<F	H 	D5#:5c?#:!;<8	:D5&sCx*A#A!BCM	O 	D#8E#s(O#8S#8!9:6	8D6%S/#:C#?!@AK	M 	D5#?5c?#?C#?!@A=	?D5&sCx*A3#F!GHR	Tr^   c                    t        d      } G d dt        t        |            }|g |   }| j                  t	        |      d       | j                  t	        |d         d       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |t        |      }| j                  t	        |      d       | j                  t	        |d         d       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |g |t           }| j                  t	        |      d	       | j                  t	        |d         d
       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |t        |   t        f   }| j                  t	        |      d	       | j                  t	        |d         d
       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |t        g|   }| j                  t	        |      d       | j                  t	        |d         d
       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |t        t        |   f   }| j                  t	        |      d       | j                  t	        |d         d
       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |t        g|t           }	| j                  t	        |	      d       | j                  t	        |	d         d       | j                  t	        |	t
                 d       | j                  t	        |	t
        t        f         d       |t        t        |   t        f   }
| j                  t	        |
      d       | j                  t	        |
d         d       | j                  t	        |
t
                 d       | j                  t	        |
t
        t        f         d       |g |t        t        df      }| j                  t	        |      d       | j                  t	        |d         d       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |t        |   t        t        t        df      f   }| j                  t	        |      d       | j                  t	        |d         d       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       y )Nr  c                       e Zd Zy)FTypeVarTupleTests.test_variadic_class_alias_repr_is_correct.<locals>.ANr|   rk   r^   r\   r   r    r   r^   r   zA[typing.Unpack[Ts]]rk   r  r  r  zA[typing.Unpack[Ts], int]zA[int]zA[float, int]zA[float, str, int]zA[int, typing.Unpack[Ts]]zA[int, float]zA[int, float, str]zA[int, typing.Unpack[Ts], str]zA[int, str]zA[int, float, str, str].z&A[typing.Unpack[Ts], *tuple[str, ...]]zA[*tuple[str, ...]]zA[float, *tuple[str, ...]]zA[float, str, *tuple[str, ...]]z;A[typing.Unpack[Ts], typing.Unpack[typing.Tuple[str, ...]]]z(A[typing.Unpack[typing.Tuple[str, ...]]]z/A[float, typing.Unpack[typing.Tuple[str, ...]]]z4A[float, str, typing.Unpack[typing.Tuple[str, ...]]])
r   r#   r   r  r   r{  r   r   r  r   )rW   r  r   r   rB  rE  r  r  r  r  r  JKs                r\   )test_variadic_class_alias_repr_is_correctz;TypeVarTupleTests.test_variadic_class_alias_repr_is_correct  s   $*r
#*crcFDG%;<D2K1D5NJ7D5#:/AfRjMDG%;<D2K1D5NJ7D5#:/Ahrh3hKDG%@AD2K2D5NO<D5#:/1EFfRj#oDG%@AD2K2D5NO<D5#:/1EFchBhKDG%@AD2K2D5NO<D5#:/1EFc6":oDG%@AD2K2D5NO<D5#:/1EFcmBmmDG%EFD2K7D5N,@AD5#:/1JKc6":s"#DG%EFD2K7D5N,@AD5#:/1JK#r#E#s(O#$DG%MND2K)>?D5N,HID5#:/1RSfRj&sCx112DG%bcD2K)STD5N,]^D5#:/1ghr^   c           	         | j                  t        t        dz        5   G d dt              }d d d        t        d      }| j                  t        t        dz        5   G d d|      }d d d        | j                  t        t
              5   G d dt        t                    }d d d        | j                  t        t
              5   G d	 d
t        |       }d d d        | j                  t        t
              5   G d dt        t        |               }d d d        | j                  t        d      5   G d dt              }d d d        | j                  t        d      5   G d dg| }d d d        | j                  t        d      5   G d dt        |         }	d d d        y # 1 sw Y   }xY w# 1 sw Y   NxY w# 1 sw Y    xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)Nr   c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.CNr|   rk   r^   r\   rB  r    r   r^   rB  r  c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.DNr|   rk   r^   r\   rE  r    r   r^   rE  c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.ENr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.FNr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.GNr|   rk   r^   r\   r  r    r   r^   r  zCannot subclass typing\.Unpackc                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.HNr|   rk   r^   r\   r  r  "  r   r^   r  z#Cannot subclass typing.Unpack\[Ts\]c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.INr|   rk   r^   r\   r  r  $  r   r^   r  c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.JNr|   rk   r^   r\   r  r  &  r   r^   r  )r   r   r  r   r  r   r   r   )
rW   rB  r  rE  r  r  r  r  r  r  s
             r\   r   z&TypeVarTupleTests.test_cannot_subclass  s   ##I/OP 	('L'	($##I(>9; 	B	 ##I/CD 	('DL'	(##I/CD 	%$D"I$	%##I/CD 	,+D$+	,##I$EG 	"!F!	" ##I/UV 	R	##I/UV 	&%F2J%	& 	&#	( 	(	 		( 	(	% 	%	, 	,	" 	"	 		& 	&s_   F)F6GG;G5G(#G4H )F36G GGG%(G14G= H	c                 6   t        d      }t        d      } G d dt        g |         } G d dt        t        |            }|d   }|d   }| j	                  |j
                  d       | j	                  |j
                  d       |t           }|t           }| j	                  |j
                  t        f       | j	                  |j
                  t        f       |t        t        f   }	|t        t        f   }
| j	                  |	j
                  t        t        f       | j	                  |
j
                  t        t        f       ||   }||   }| j	                  |j
                  |f       | j	                  |j
                  |f       |g |   }|t        |      }| j	                  |j
                  g |       | j	                  |j
                  t        |   f       ||g|   }||t        |   f   }| j	                  |j
                  |g|       | j	                  |j
                  |t        |   f       |g ||   }|t        |   |f   }| j	                  |j
                  g ||       | j	                  |j
                  t        |   |f       y )Nr   r  c                       e Zd Zy)ATypeVarTupleTests.test_variadic_class_args_are_correct.<locals>.ANr|   rk   r^   r\   r   r  +  r   r^   r   c                       e Zd Zy)ATypeVarTupleTests.test_variadic_class_args_are_correct.<locals>.BNr|   rk   r^   r\   r   r  ,  r   r^   r   rk   )r   r   r#   r   r   r  r   r   )rW   r   r  r   r   rB  rE  r  r  r  r  r  r  r  LMNOPs                      r\   $test_variadic_class_args_are_correctz6TypeVarTupleTests.test_variadic_class_args_are_correct(  s4   CL$##*r
#*bEbER(R(cFcFcV,cV,c3hKc3hKc3Z0c3Z0aDaDaT*aT*crcFfRjMVrV,fRj]3af"fIamaX"X.a_5frf1fIfRj!mXrX1X.fRj!_5r^   c                 &   t        d      } G d dt        g |         }| j                  |t           j                  |       | j                  |t
           j                  |       | j                  |t        |      j                  |        G d dt        t        |            }| j                  |t           j                  |       | j                  |t
           j                  |       | j                  |t        |      j                  |       y )Nr  c                       e Zd Zy)BTypeVarTupleTests.test_variadic_class_origin_is_correct.<locals>.CNr|   rk   r^   r\   rB  r  T  r   r^   rB  c                       e Zd Zy)BTypeVarTupleTests.test_variadic_class_origin_is_correct.<locals>.DNr|   rk   r^   r\   rE  r  Y  r   r^   rE  )r   r#   r   r   r  r   r   )rW   r  rB  rE  s       r\   %test_variadic_class_origin_is_correctz7TypeVarTupleTests.test_variadic_class_origin_is_correctQ  s    $##af''+adooq)ar
m..2*r
#*af''+adooq)ar
m..2r^   c                    t        d      }d|\  fd}| j                  t        |      dt        |   i       dt        t
        t        f   \  fd}| j                  t        |      dt        t        t
        t        f      i        G d dt        g |         }d|t
        t        f   \  fd}| j                  t        |      dt        |t
        t        f      i       y )Nr  r   c                       y rb   rk   r   s    r\   func1zCTypeVarTupleTests.test_get_type_hints_on_unpack_args.<locals>.func1a      tr^   c                       y rb   rk   r  s    r\   func2zCTypeVarTupleTests.test_get_type_hints_on_unpack_args.<locals>.func2d  s    Dr^   c                       e Zd Zy)LTypeVarTupleTests.test_get_type_hints_on_unpack_args.<locals>.CustomVariadicNr|   rk   r^   r\   CustomVariadicr  g  r   r^   r  c                       y rb   rk   r  s    r\   func3zCTypeVarTupleTests.test_get_type_hints_on_unpack_args.<locals>.func3i  s    Tr^   r   r   r  r   r  r   r   r#   rW   r  r  r  r  r  s         r\   "test_get_type_hints_on_unpack_argsz4TypeVarTupleTests.test_get_type_hints_on_unpack_args^  s    $#"#UffRj%9:0%S/0UffU38_.E%FG0WSbS\09.c29Uff^CH5M.N%OPr^   c                    t        d      }d	d}| j                  t        |d|i      dt        |   i       d
d}| j                  t        |      dt        t        t
        t        f      i        G d dt        g |         }dd}| j                  t        |d|i      dt        |t
        t        f      i       y )Nr  r   c                       y rb   rk   r  s    r\   r  zJTypeVarTupleTests.test_get_type_hints_on_unpack_args_string.<locals>.func1o  s    r^   )localnsc                       y rb   rk   r  s    r\   r  zJTypeVarTupleTests.test_get_type_hints_on_unpack_args_string.<locals>.func2s  s    dr^   c                       e Zd Zy)STypeVarTupleTests.test_get_type_hints_on_unpack_args_string.<locals>.CustomVariadicNr|   rk   r^   r\   r  r  v  r   r^   r  c                       y rb   rk   r  s    r\   r  zJTypeVarTupleTests.test_get_type_hints_on_unpack_args_string.<locals>.func3x  s    tr^   )r   z*Ts)r   z*tuple[int, str])r   z*CustomVariadic[int, str]r   r  s         r\   )test_get_type_hints_on_unpack_args_stringz;TypeVarTupleTests.test_get_type_hints_on_unpack_args_stringl  s    $%UT2J7,	. 	3UffU38_.E%FG0WSbS\0;U-=~,NO &S)A"BC	Er^   c                 n   t        d      }| j                  t        g |   j                  g |       | j                  t        t
        |      j                  t
        |   f       | j                  t        g |t           j                  g |t               | j                  t        t
        |   t        f   j                  t
        |   t        f       | j                  t        t        g|   j                  t        g|       | j                  t        t        t
        |   f   j                  t        t
        |   f       | j                  t        t        g|t           j                  t        g|t               | j                  t        t        t
        |   t        f   j                  t        t
        |   t        f       | j                  t        g |t           j                  g |t               | j                  t        t
        |      j                  t
        |   f       y r  )r   r   r  r  r   r   r   r   r  s     r\   test_tuple_args_are_correctz-TypeVarTupleTests.test_tuple_args_are_correct|  s   $ss,,ff5vbz*33fRj]CxxCx11:R::>vbz3/886":s:KLsxRx11C:":>sF2J/883r
:KLs}R}}-66C	*sF2J34==vbz3/	1 	xxCx11:R::>vbz*33fRj]Cr^   c           	         t        d      }t        d      }t        d      }t        g |d f   }t        t        |   gd f   }| j                  |j                  g |t        d              | j                  |j                  t        |   t        d       f       t        t        g|d f   }t        t        t        |   gd f   }| j                  |j                  t        g|t        d              | j                  |j                  t        t        |   t        d       f       t        g |t        d f   }t        t        |   t        gd f   }	| j                  |j                  g |t        t        d              | j                  |	j                  t        |   t        t        d       f       t        t        g|t        d f   }
t        t        t        |   t        gd f   }| j                  |
j                  t        g|t        t        d              | j                  |j                  t        t        |   t        t        d       f       t        d gg|   }t        d gt        |   f   }| j                  |j                  t        d       g|       | j                  |j                  t        d       t        |   f       t        d gt        t        g|   f   }t        d gt        t        t        |   f   f   }| j                  |j                  t        d       t        t        g|   f       | j                  |j                  t        d       t        t        t        |   f   f       t        d gt        g |t           f   }t        d gt        t        |   t        f   f   }| j                  |j                  t        d       t        g |t           f       | j                  |j                  t        d       t        t        |   t        f   f       t        d gt        t        g|t           f   }t        d gt        t        t        |   t        f   f   }| j                  |j                  t        d       t        t        g|t           f       | j                  |j                  t        d       t        t        t        |   t        f   f       t        g |g|   }t        t        |   gt        |   f   }| j                  |j                  g ||       | j                  |j                  t        |   t        |   f       t        g |g|   }t        t        |   gt        |   f   }| j                  |j                  g ||       | j                  |j                  t        |   t        |   f       y )Nr  r  r   )
r   r"   r   r   r  r   r   r   r  r   )rW   r  r  r   r  r   cderf   ghijklmnopqrr   us                           r\   test_callable_args_are_correctz0TypeVarTupleTests.test_callable_args_are_correct  s   $5!5! UrUD[!fRj\4'(%6r%64:%67fRj$t*%=>cZBZ%&c6":&,-c%;B%;T
%;<c6":tDz%BCZrZ3Z%&fRj#&,-%;r%;3%;T
%;<fRj#tDz%BCc_B__d*+c6":s+T12c%@B%@%@T$Z%@Ac6":sDJ%GH dV[b[!dVVBZ'(d4j%62%67d4j&*%=>dVU388_,-dVU3r
?334d4j%b/%BCd4j%VBZ2H%IJdVU8B88_,-dVU6":s?334d4j%S/%BCd4j%r
C2H%IJdVU3==S=112dVU3r
C#7889d4j%b#2F%GHd4j%VBZ8L2M%NO UrUZRZ fRj\6":-.ZrZBZ0fRj&*%=>VsV\c\"fSk]F3K/0\s\S\2fSk6#;%?@r^   c           
      x   t        d      }t        d      }| j                  t              5   G d dt        g ||         }d d d        | j                  t              5   G d dt        t        |   t        |   f         }d d d        | j                  t              5   G d dt        g |||         }d d d        | j                  t              5   G d	 d
t        t        |   t        |   t        |   f         }d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   jxY w# 1 sw Y   y xY w)Nr  r   c                       e Zd Zy)STypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails.<locals>.CNr|   rk   r^   r\   rB  r!    r   r^   rB  c                       e Zd Zy)STypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails.<locals>.DNr|   rk   r^   r\   rE  r#    r   r^   rE  c                       e Zd Zy)STypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails.<locals>.ENr|   rk   r^   r\   r  r%    r   r^   r  c                       e Zd Zy)STypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails.<locals>.FNr|   rk   r^   r\   r  r'    r   r^   r  )r   r   r   r#   r   )rW   r  r   rB  rE  r  r  s          r\   6test_variadic_class_with_duplicate_typevartuples_failszHTypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails  s   5!5!y) 	/.GJSJ3J'.	/y) 	=<GF3K45<	= y) 	54G,S,3,,-4	5y) 	JIGF3KfSkABI	J 	J	/ 	/	= 	=	5 	5	J 	Js/   D!#D!D$+D0DD!$D-0D9c                    t        d      } G d dt        t        |            }|t        g|    |t        t        |   f    |g |t            |t        |   t        f    |t        g|t            |t        t        |   t        f    |t        t
        g|t        t            |t        t
        t        |   t        t        f    y )Nr  c                       e Zd Zy)]TypeVarTupleTests.test_type_concatenation_in_variadic_class_argument_list_succeeds.<locals>.CNr|   rk   r^   r\   rB  r+    r   r^   rB  )r   r#   r   r   r   boolr{  rW   r  rB  s      r\   @test_type_concatenation_in_variadic_class_argument_list_succeedszRTypeVarTupleTests.test_type_concatenation_in_variadic_class_argument_list_succeeds  s    $*r
#*	#((	#vbz/	(2(s(	&*c/	#--C-	#vbz3
	#t
$b
$%
$
$%	#tVBZ
+,r^   c                    t        d      }t        t        g|    t        g |t            t        t        g|t            t        t        t        g|t
        t            t        t        t        |   f    t        t        |   t        f    t        t        t        |   t        f    t        t        t        t        |   t
        t        f    y r  )r   r  r   r   r,  r{  r   r   r  s     r\   7test_type_concatenation_in_tuple_argument_list_succeedszITypeVarTupleTests.test_type_concatenation_in_tuple_argument_list_succeeds  s    $chBhhrh3hcmBmmc4("(e(S()c6":ofRj#oc6":s"#c4UC/0r^   c                     t        d      }| j                  t              5   G d dt        |         }d d d        y # 1 sw Y   y xY w)Nr  c                       e Zd Zy)[TypeVarTupleTests.test_variadic_class_definition_using_packed_typevartuple_fails.<locals>.CNr|   rk   r^   r\   rB  r3    r   r^   rB  )r   r   r   r#   r-  s      r\   >test_variadic_class_definition_using_packed_typevartuple_failszPTypeVarTupleTests.test_variadic_class_definition_using_packed_typevartuple_fails  s;    $y) 	'&GBK&	' 	' 	's	   =Ac                 6   t        d      }| j                  t              5   G d dt        g |t                 }d d d        | j                  t              5   G d dt        t
        |   t        f         }d d d        y # 1 sw Y   GxY w# 1 sw Y   y xY w)Nr  c                       e Zd Zy)VTypeVarTupleTests.test_variadic_class_definition_using_concrete_types_fails.<locals>.FNr|   rk   r^   r\   r  r7     r   r^   r  c                       e Zd Zy)VTypeVarTupleTests.test_variadic_class_definition_using_concrete_types_fails.<locals>.ENr|   rk   r^   r\   r  r9    r   r^   r  )r   r   r   r#   r   r   )rW   r  r  r  s       r\   9test_variadic_class_definition_using_concrete_types_failszKTypeVarTupleTests.test_variadic_class_definition_using_concrete_types_fails  s    $y) 	-,GHRHH%,	-y) 	43GF2JO,3	4 	4	- 	-	4 	4s   B BBBc           	      N   t        d      }t        d      }t        d      } G d dt        ||g|         }|t        t        f    |t        t        t
        f    |t        t        t
        t        f     G d dt        ||t        |   f         }|t        t        f    |t        t        t
        f    |t        t        t
        t        f     G d d	t        |g||         }|t        t        f    |t        t        t
        f    |t        t        t
        t        f     G d
 dt        |t        |   |f         }|t        t        f    |t        t        t
        f    |t        t        t
        t        f     G d dt        g |||         }|t        t        f    |t        t        t
        f    |t        t        t
        t        f     G d dt        t        |   ||f         }	|	t        t        f    |	t        t        t
        f    |	t        t        t
        t        f    y )Nr  r"  r#  c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.ANr|   rk   r^   r\   r   r=  	  r   r^   r   c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.BNr|   rk   r^   r\   r   r?    r   r^   r   c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.CNr|   rk   r^   r\   rB  rA    r   r^   rB  c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.DNr|   rk   r^   r\   rE  rC    r   r^   rE  c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.ENr|   rk   r^   r\   r  rE    r   r^   r  c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.FNr|   rk   r^   r\   r  rG  "  r   r^   r  )r   r   r#   r   r   r{  r,  r   )
rW   r  r"  r#  r   r   rB  rE  r  r  s
             r\   :test_variadic_class_with_2_typevars_accepts_2_or_more_argszLTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args  s   $T]T]+B$+	#s(	#sE/	#sE4
 2Br
*+2	#s(	#sE/	#sE4
 +R$+	#s(	#sE/	#sE4
 2F2J*+2	#s(	#sE/	#sE4
 +R$+	#s(	#sE/	#sE4
 2r
B*+2	#s(	#sE/	#sE4
 r^   c                     t        d      }dt        |   fd}d|\  fd}| j                  |j                  dt        |   i       | j                  |j                  dg |d   i       y )Nr  r   c                       y rb   rk   r  s    r\   rf   zGTypeVarTupleTests.test_variadic_args_annotations_are_correct.<locals>.f*  s    $r^   c                       y rb   rk   r  s    r\   r  zGTypeVarTupleTests.test_variadic_args_annotations_are_correct.<locals>.g+      4r^   r   )r   r   r   r   )rW   r  rf   r  s       r\   *test_variadic_args_annotations_are_correctz<TypeVarTupleTests.test_variadic_args_annotations_are_correct'  sb    $&VBZ&b**VVBZ,@A**VVrVAY,?@r^   c                 (   dt         t        df   \  fd}| j                  |j                  dg t         t        df   d   i       dt        t
        t        df      fd}| j                  |j                  dt        t
        t        df      i       y )Nr   .c                       y rb   rk   r  s    r\   r  zUTypeVarTupleTests.test_variadic_args_with_ellipsis_annotations_are_correct.<locals>.a0      r^   r   c                       y rb   rk   r  s    r\   r   zUTypeVarTupleTests.test_variadic_args_with_ellipsis_annotations_are_correct.<locals>.b4  s    tr^   )r  r   r   r   r   r   )rW   r  r   s      r\   8test_variadic_args_with_ellipsis_annotations_are_correctzJTypeVarTupleTests.test_variadic_args_with_ellipsis_annotations_are_correct/  s    ,eCHo,** "5E#s(O"5a"89	; 	4VE#s(O,3** &sCx"9:	<r^   c                    t        d      }dt        t        g|   \  fd}| j                  |j                  dg t        t        g|   d   i       dt        g |t           \  fd}| j                  |j                  dg t        g |t           d   i       dt        t
        g|t           \  fd}| j                  |j                  dg t        t
        g|t           d   i       dt        t        t        g|t        t
           \  fd}| j                  |j                  dg t        t        t        g|t        t
           d   i       dt        t        t        t        |   f      fd}| j                  |j                  dt        t        t        t        |   f      i       dt        t        t        |   t        f      fd	}| j                  |j                  dt        t        t        |   t        f      i       dt        t        t
        t        |   t        f      fd
}| j                  |j                  dt        t        t
        t        |   t        f      i       dt        t        t        t        t        |   t        t
        f      fd}	| j                  |	j                  dt        t        t        t        t        |   t        t
        f      i       y )Nr  r   c                       y rb   rk   r  s    r\   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.a=  rP  r^   r   c                       y rb   rk   r  s    r\   r   zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.bC  rP  r^   c                       y rb   rk   r  s    r\   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.cI  s    Tr^   c                       y rb   rk   r  s    r\   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.dO  s    $r^   c                       y rb   rk   r  s    r\   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.eW      dr^   c                       y rb   rk   r  s    r\   rf   zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.f]  rY  r^   c                       y rb   rk   r  s    r\   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.gc  s    4r^   c                       y rb   rk   r  s    r\   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.hi  s    r^   )
r   r  r   r   r   r   r,  r{  r   r   )
rW   r  r  r   r  r  r  rf   r  r  s
             r\   ;test_concatenation_in_variadic_args_annotations_are_correctzMTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct8  s   $ 	-eCH"Ho,(uSX2X(+,	

 	-eHRHHo,(uXbX#X(+,	

 	2eCM"McM*1-uS]2]s]+-a01	

 	?eC66E6367>:uS$77U7C78:1=>	
 	;VE#vbz/23:VE#vbz/234	

 	;VE&*c/23:VE&*c/234	

 	@VE#vbz3"678?VE#vbz3"6789	

 	MVE#tVBZ"CDELVE#tVBZ"CDEF	
r^   c                 :   t        d      } G d dt        g |         } G d dt        t        |            }| j                  |t           |t                  | j                  |t           |t                  t        d      }t        d      }| j                  |g |   |g |          | j                  |t        |      |t        |             | j                  |g ||   |g ||          | j                  |t        |   t        |   f   |t        |   t        |   f          | j                  |t        g||   |t        g||          | j                  |t        t        |   t        |   f   |t        t        |   t        |   f          y )Nr  c                       e Zd Zy)MTypeVarTupleTests.test_variadic_class_same_args_results_in_equalty.<locals>.CNr|   rk   r^   r\   rB  r`  q  r   r^   rB  c                       e Zd Zy)MTypeVarTupleTests.test_variadic_class_same_args_results_in_equalty.<locals>.DNr|   rk   r^   r\   rE  rb  r  r   r^   rE  r  r   )r   r#   r   r   r   rW   r  rB  rE  r  r   s         r\   0test_variadic_class_same_args_results_in_equaltyzBTypeVarTupleTests.test_variadic_class_same_args_results_in_equaltyo  s   $##*r
#*33(33(5!5!dsdGdsdG	
 	fSkNfSkN	

 	jsjSjMjsjSjM	
 	fSk6#;&'fSk6#;&'	

 	coCo#ocoCo#o	
 	c6#;s+,c6#;s+,	
r^   c                    t        d      } G d dt        g |         } G d dt        t        |            }| j                  |t        t
        f   |t
        t        f          | j                  |t        t
        f   |t
        t        f          t        d      }t        d      }| j                  |g ||   |g ||          | j                  |t        |   t        |   f   |t        |   t        |   f          y )Nr  c                       e Zd Zy)ETypeVarTupleTests.test_variadic_class_arg_ordering_matters.<locals>.CNr|   rk   r^   r\   rB  rg    r   r^   rB  c                       e Zd Zy)ETypeVarTupleTests.test_variadic_class_arg_ordering_matters.<locals>.DNr|   rk   r^   r\   rE  ri    r   r^   rE  r  r   )r   r#   r   r   r   r   rc  s         r\   (test_variadic_class_arg_ordering_mattersz:TypeVarTupleTests.test_variadic_class_arg_ordering_matters  s    $##*r
#*c3hKc3hK	
 	c3hKc3hK	

 5!5!jsjSjMjsjSjM	
 	fSk6#;&'fSk6#;&'	
r^   c                 *   t        d      }t        d      }t        d      } G d dt        g |         } G d dt        t        |            }| j                  |g |   |g |          | j                  |t        |      |t        |             y )Nr  r  r   c                       e Zd Zy)RTypeVarTupleTests.test_variadic_class_arg_typevartuple_identity_matters.<locals>.CNr|   rk   r^   r\   rB  rm    r   r^   rB  c                       e Zd Zy)RTypeVarTupleTests.test_variadic_class_arg_typevartuple_identity_matters.<locals>.DNr|   rk   r^   r\   rE  ro    r   r^   rE  )r   r#   r   r   )rW   r  r  r   rB  rE  s         r\   5test_variadic_class_arg_typevartuple_identity_matterszGTypeVarTupleTests.test_variadic_class_arg_typevartuple_identity_matters  s    $5!5!##*r
#*AdsdGQttW-AfSkNAfSkN;r^   N)'rh   ri   rj   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r
  r  r  r(  r.  r0  r4  r:  rH  rM  rR  r]  rd  rj  rp  rk   r^   r\   r  r    s    G.2+!D0
1
?


3FKP/<l"T@>i@&*'6R3QE D(;AzJ- 1'
4!!FA<5
n$
L
4	<r^   r  c                   <    e Zd Zed        Zed        Zed        Zy)TypeVarTuplePicklingTestsc                     t        d      at        j                  t        j                  t        |            }| j                  t        |       y )N
global_Ts1)r   rt  rs   loadsdumpsr   )rW   rq   
global_Ts2s      r\   6test_pickling_then_unpickling_results_in_same_identityzPTypeVarTuplePicklingTests.test_pickling_then_unpickling_results_in_same_identity  s5     ",/
\\&,,z5"AB
j*-r^   c                 8   t        d      ag t        d   }t        j                  t        j                  ||            }| j                  ||       t        t           }t        j                  t        j                  ||            }| j                  ||       y )N	global_Tsr   )r   rz  rs   ru  rv  r   r   )rW   rq   	unpacked1	unpacked2	unpacked3	unpacked4s         r\   ?test_pickling_then_unpickling_unpacked_results_in_same_identityzYTypeVarTuplePicklingTests.test_pickling_then_unpickling_unpacked_results_in_same_identity  st     !-	!iM!$	LLi!?@	i+9%	LLi!?@	i+r^   c           	         t        d      at        d      at        g t           t
        t        t              t        t        gt           t
        t        t        t           f   t        t        gt           t
        t        t        t           f   g}|D ]=  }t        j                  t        j                  ||            }| j                  ||       ? y )Nglobal_Trz  )r   r  r   rz  r  r   r   r   r   rs   ru  rv  r   )rW   rq   tuplestr  s        r\   >test_pickling_then_unpickling_tuple_with_typevartuple_equalityzXTypeVarTuplePicklingTests.test_pickling_then_unpickling_tuple_with_typevartuple_equality  s    
 :& -	 *9*&#$!-i- !VI&&'#/	/"#vi(()	
  	$Afll1e45BQ#	$r^   N)rh   ri   rj   ry   rx  r  r  rk   r^   r\   rr  rr    s>     . . 
, 
, $ $r^   rr  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)
UnionTestsc                 V    t         t        t        f   }| j                  |t                y rb   )r   r   r{  r   rW   r  s     r\   r9  zUnionTests.test_basics  s     #u*Au%r^   c                    | j                  t              5  t        t        t               d d d        | j                  t              5  t        t        t               d d d        | j                  t              5  t        t        t        t
        f   t               d d d        y # 1 sw Y   {xY w# 1 sw Y   UxY w# 1 sw Y   y xY wrb   )r   r   rT   r   r   r   r   s    r\   test_subclass_errorzUnionTests.test_subclass_error  s    y) 	#sE"	#y) 	#uc"	#y) 	-uS#X,	- 	-		# 	#	# 	#	- 	-s#   B%B1:"B=%B.1B:=Cc                 d   t         t           }| j                  |t               t         t        t        f   }t         t        t        f   }t         t        t        f   }| j                  ||       | j                  |t               | j                  |t               | j                  |t               y rb   )r   r   r   r   objectr   )rW   r  u1u2u3s        r\   test_union_anyzUnionTests.test_union_any  s    #JC 38_38_3;R B$B$B$r^   c                    t         t           }| j                  |t               t         t        t        f   }t         t        t        f   }| j                  ||       | j	                  |t               | j	                  |t               y rb   )r   r  r   r   r   )rW   r  r  r  s       r\   test_union_objectzUnionTests.test_union_object  sg    &MF#3;63;R B'B'r^   c                 t    t         t        t        f   }t         t        t        f   }| j                  ||       y rb   )r   r   r{  r   )rW   r  r  s      r\   test_unorderedzUnionTests.test_unordered  s.    3:5#:R r^   c                 J    t         t           }| j                  |t               y rb   )r   r{   r   )rW   r  s     r\   test_single_class_disappearsz'UnionTests.test_single_class_disappears  s    (Oa"r^   c                     t         t        t        f   }| j                  |t               | j	                  t        |j
                         | j	                  t        |j
                         y rb   )r   r{   r   r   r[  r  r  s     r\   test_base_class_keptzUnionTests.test_base_class_kept  sE    (G#$Ax(h

+gqzz*r^   c                     t         t        t        f   }t         |t        f   }| j	                  |t         t        t        t        f          y rb   )r   r   r{  r{   r   )rW   r  vs      r\   test_union_unionzUnionTests.test_union_union  s:    #u*!X+E#uh"678r^   c                 0    G d dt               } G d d|      } G d d|      }| j                  t        ||f   j                  ||f       t        ||f   }| j	                  t
              5  t        |       d d d        t        t        |f   }| j	                  t
              5  t        |       d d d        t        |t        f   }| j	                  t
              5  t        |       d d d        y # 1 sw Y   zxY w# 1 sw Y   NxY w# 1 sw Y   y xY w)Nc                       e Zd ZdZy);UnionTests.test_union_of_unhashable.<locals>.UnhashableMetaNrh   ri   rj   __hash__rk   r^   r\   UnhashableMetar  #      Hr^   r  c                       e Zd Zy).UnionTests.test_union_of_unhashable.<locals>.ANr|   rk   r^   r\   r   r  &  r   r^   r   	metaclassc                       e Zd Zy).UnionTests.test_union_of_unhashable.<locals>.BNr|   rk   r^   r\   r   r  '  r   r^   r   )r   r   r   r  r   r   hashr   )rW   r  r   r   union1union2union3s          r\   test_union_of_unhashablez#UnionTests.test_union_of_unhashable"  s    	T 	 	/.....q!t--1v6q!ty) 	L	 sAvy) 	L	 q#vy) 	L	 		 		 		 	s$   /C4'D D4C= D	Dc                 J   | j                  t        t              d       t        t        t        f   }| j                  t        |      dt
        z         t        t        t        f   }| j                  t        |      dt
        z         t        d      }t        |t        f   t           }| j                  t        |      t        t                     t        t        t           t        f   }| j                  t        |      d       t        t        t           t        t        t        f   f   }| j                  t        |      d       t        t        t        z     }| j                  t        |      d       t        d t        f   }| j                  t        |      d       t        t        d f   }| j                  t        |      d       t        d t        t        f   }| j                  t        |      d	       t        t           }| j                  t        |      d       y )
Nztyping.Unionztyping.Union[%s.Employee, int]ztyping.Union[int, %s.Employee]r   z#typing.Union[typing.List[int], int]z)typing.Union[list[int], dict[str, float]]ztyping.Union[int, float]ztyping.Optional[str]z typing.Union[NoneType, str, int])r   r   r   r{   r   rh   r   r   r  r&  r   r{  r   )rW   r  r   s      r\   r   zUnionTests.test_repr6  s   en5(C- a"BX"MN#x- a"BX"MNCL!S&M#a$s),$s)S.!a"GH$s)T#u*--.a"MN#+a"<=$)a"89#t)a"89$S.!a"DESMa"89r^   c                     t        t        t        t        t        f               }dD ]/  }| j                  |      5  | j                  ||       d d d        1 y # 1 sw Y   <xY wrU  )rY  rZ  r   r   r   ru   r[  r\  s      r\   r^  zUnionTests.test_dirO  sb    E#s(O,-	
 	8M M: 8mY78 8	88 8s   AA$	c                    | j                  t        d      5   G d dt              }d d d        | j                  t        t              5   G d dt	        t                    }d d d        | j                  t        d      5   G d dt        t
        t        f         }d d d        y # 1 sw Y   xY w# 1 sw Y   QxY w# 1 sw Y   y xY w)	NzCannot subclass typing\.Unionc                       e Zd Zy)*UnionTests.test_cannot_subclass.<locals>.CNr|   rk   r^   r\   rB  r  Z  r   r^   rB  c                       e Zd Zy)*UnionTests.test_cannot_subclass.<locals>.DNr|   rk   r^   r\   rE  r  ]  r   r^   rE  z)Cannot subclass typing\.Union\[int, str\]c                       e Zd Zy)*UnionTests.test_cannot_subclass.<locals>.ENr|   rk   r^   r\   r  r  a  r   r^   r  )r   r   r   r   r   r   r   )rW   rB  rE  r  s       r\   r   zUnionTests.test_cannot_subclassW  s    ##I02 	E 	 ##I/CD 	DK 	 ##I<> 	E#s(O 	 		 		 		 	s#   B&	B2 B>&B/2B;>Cc                    | j                  t              5  t                d d d        | j                  t              5   t        t                      d d d        t        t        t
        f   }| j                  t              5   |        d d d        | j                  t              5   t        |              d d d        y # 1 sw Y   xY w# 1 sw Y   |xY w# 1 sw Y   PxY w# 1 sw Y   y xY wrb   )r   r   r   r   r   r{  r  s     r\   r   z"UnionTests.test_cannot_instantiated  s    y) 	G	y) 	DKM	#u*y) 	C	y) 	DGI	 		 		 		 		 	s.   CCC(C&CCC#&C/c                 8   | j                  t        t        t        j                  t
           f   t        k(         | j                  t        t        t        j                  t
           f   t        j                  t
           k(         | j                  t        t        t        t        j                  t
           f   j                         | j                  t        j                  t
           t        t        t        j                  t
           f   j                         y rb   )r   r   r   rc   Iterabler   r[  r  r   s    r\   test_union_generalizationz$UnionTests.test_union_generalizationo  s    sFOOC$889S@AsFOOC$889V__S=QQRc5fooc&:!:;DDEfooc*E#vs7K2K,L,U,UVr^   c                    | j                  t        t               | j                  t        t               | j                  t        t               | j                  t
        t               | j                  d gt
               | j                  t
        t        j                         | j                  t
        t        j                     t               y rb   )	r   r   r  r   r$   r   rc   Mappingr!   r   s    r\   test_union_compare_otherz#UnionTests.test_union_compare_otheru  s    E6*E3'He,He,TFH-Hfnn5HV%:%:;UCr^   c                 `    t         t           }t        t        d f   }| j                  ||       y rb   )r   r   r   r   )rW   r  r  s      r\   test_optionalzUnionTests.test_optional~  s)    SM#t)Ar^   c                 j    | j                  t              5  t        d    d d d        y # 1 sw Y   y xY wNrk   )r   r   r   r   s    r\   
test_emptyzUnionTests.test_empty  s,    y) 	"I	 	 	   
)2c                 r    t         t        t        f   }d|fd}| j                  t	        |      d   |       y )Nr   c                      y rb   rk   r   s    r\   rf   z(UnionTests.test_no_eval_union.<locals>.f      Sr^   )r   r   r   r   r+   )rW   r  rf   s      r\   test_no_eval_unionzUnionTests.test_no_eval_union  s/    #s(OnQ',a0r^   c                 h    dt         fd}| j                  t        t        |t         f         d       y )Nr   c                       y rb   rk   rk   r^   r\   funz0UnionTests.test_function_repr_union.<locals>.fun  s    #r^   ztyping.Union[fun, int])r   r   r   r   )rW   r  s     r\   test_function_repr_unionz#UnionTests.test_function_repr_union  s(    SeCHo.0HIr^   c                 .    t         t        t        f   }| y rb   )r   r   r>   r  s     r\   test_union_str_patternz!UnionTests.test_union_str_pattern  s    #w,	r^   c                 X    ddl m t        t        f    fd}t        |t        f    y )Nr   )Elementc                       |  S rb   rk   )r   r  s    r\   Elemz#UnionTests.test_etree.<locals>.Elem  s    D>!r^   )xml.etree.ElementTreer  r   r   )rW   r  r  s     @r\   
test_etreezUnionTests.test_etree  s'     	2gsl	" 	dCir^   c                    | j                  t        t        d   t        d   f   j                  t        d   t        d   f       | j                  t        t        d   t        d   f   t        d          | j                  t        t        d   t        d   f   j                  t        d   t        d   f       | j                  t        t        d   t        d   f   j                  t        d   t        d   f       dd l} G d d|j
                        }| j                  t        t        |j                     t        |j                     f   t        |j                            | j                  t        t        |j                     t        |j                     f   t        |j                            | j                  t        t        |j                     t        |j                     f   j                  t        |j                     t        |j                     f       | j                  t        t        d   t        |j                     t        d   f   j                  t        d   t        |j                     t        d   f       | j                  t        t        d   t        |j                     t        d   f   j                  t        d   t        |j                     t        d   f       y )Nrn   r   Fr   Tc                       e Zd ZdZdZy)/UnionTests.test_union_of_literals.<locals>.Intsr   rn   Nrh   ri   rj   r   r   rk   r^   r\   Intsr        AAr^   r  )r   r   r   r  enumIntEnumr   r   )rW   r  r  s      r\   test_union_of_literalsz!UnionTests.test_union_of_literals  s<   wqz71:56??!!*gaj1	3wqz71:56 	% 	wu~wqz9:CC!%.'!*5	7wt}gaj89BB!$-4	6 		4<< 	 	wtvv?@ 	*wtvv?@ 	* 	wtvv?@II!$&&/7466?;	= 	wqz7466?GENJKTT!!*gdffowu~F	Hwqz7466?GDMIJSS!!*gdffowt}E	Gr^   N)rh   ri   rj   r9  r  r  r  r  r  r  r  r  r   r^  r   r   r  r  r  r  r  r  r  r  r  rk   r^   r\   r  r    st    &-	%(!
#+9
(:28	WD
1
J


Gr^   r  c                   0    e Zd Zd Zd Zd Zd Zd Zd Zy)
TupleTestsc                    | j                  t              5  t        t        t        t        t
        f          d d d        | j                  t              5  t        t        t        t        t
        f          d d d         G d dt              }| j                  t        t               | j                  |t               y # 1 sw Y   xY w# 1 sw Y   UxY w)Nc                       e Zd Zy)"TupleTests.test_basics.<locals>.TPNr|   rk   r^   r\   TPr    r   r^   r  )r   r   rT   r   r   r   r  r]   )rW   r  s     r\   r9  zTupleTests.test_basics  s    y) 	/ueCHo.	/y) 	/ueCHo.	/ 	eU+b%(	/ 	/	/ 	/s   "B?"C?CCc                 \   | j                  t        t           t        t                  | j                  t        t        df   t        t        df          | j                  t        t           t        t        t        f          | j                  t        t           t        t        df          y N.)r   r   r   r   r   s    r\   r   zTupleTests.test_equality  sr    sU3Z0sCx%S/:E#Jc3h8E#Jc3h8r^   c                      G d dt               }| j                  |t               | j                  t        t               | j                  t         t               y )Nc                       e Zd Zy)/TupleTests.test_tuple_subclass.<locals>.MyTupleNr|   rk   r^   r\   MyTupler        r^   r  )r  r]   r   )rW   r  s     r\   test_tuple_subclasszTupleTests.test_tuple_subclass  s>    	e 	gu-eU+eU+r^   c                     | j                  t              5  t        dt        t        t        f          d d d        | j                  dt               y # 1 sw Y    xY w)N)r   r   )r   r   r   r   r   r   r   s    r\   test_tuple_instance_type_errorz)TupleTests.test_tuple_instance_type_error  sG    y) 	0vuS#X/	0fe,	0 	0s   AAc                    | j                  t        t              d       | j                  t        t        d         d       | j                  t        t        t        t        f         d       | j                  t        t        t        df         d       | j                  t        t        t
        t                    d       y )Nztyping.Tuplerk   ztyping.Tuple[()]ztyping.Tuple[int, float].ztyping.Tuple[int, ...]ztyping.Tuple[list[int]])r   r   r   r   r{  r  r   s    r\   r   zTupleTests.test_repr  s    en5eBi*<=eCJ/02LMeCHo.0HIeDI./1JKr^   c                     | j                  t              5  t        dt               d d d        | j                  t              5  t        dt        t                  d d d        y # 1 sw Y   ?xY w# 1 sw Y   y xY wr   )r   r   rT   r   r   r   s    r\   r   zTupleTests.test_errors  se    y) 	"r5!	"y) 	'r5:&	' 	'	" 	"	' 	's   A%A1%A.1A:N)	rh   ri   rj   r9  r   r  r  r   r   rk   r^   r\   r  r    s!    )9,-
L'r^   r  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)BaseCallableTestsc                 $   | j                   }| j                  t              5  t        t        j
                  |t        gt        f          d d d        | j                  t        j
                  |       | j                  ||       y # 1 sw Y   <xY wrb   )r"   r   r   rT   typesFunctionTyper   r]   rW   r"   s     r\   test_self_subclassz$BaseCallableTests.test_self_subclass  ss    ==y) 	Au))8SE3J+?@	Ae00(;h1	A 	As   )BBc                 ,   | j                   }|t        gt        f   }| j                  ||t        gt        f          | j                  t        ||t        gt        f   h      d       | j	                  ||t        gt
        f          | j	                  ||t
        gt        f          | j	                  ||t        t        gt        f          | j	                  ||g t        f          | j	                  ||dt        f          | j	                  ||       y )Nrn   .)r"   r   r   r  r   r   )rW   r"   rB  s      r\   test_eq_hashzBaseCallableTests.test_eq_hash  s    ==cUCZ HcUCZ01a3%*!567;Axs
34Axs
34Axc
C89AxC01AxS12Ax(r^   c                     | j                   }t        t        |dt        f               }dD ]/  }| j	                  |      5  | j                  ||       d d d        1 y # 1 sw Y   <xY w)N.rV  rW  )r"   rY  rZ  r   ru   r[  )rW   r"   r]  rX  s       r\   r^  zBaseCallableTests.test_dir   sl    ==HS#X./0	
 	8M M: 8mY78 8	88 8s   AA(	c                    | j                   }| j                  t              5   |        d d d        | j                  t              5   t        |              d d d        |t        gt
        f   }| j                  t              5   |        d d d        | j                  t              5   t        |              d d d        y # 1 sw Y   xY w# 1 sw Y   yxY w# 1 sw Y   PxY w# 1 sw Y   y xY wrb   )r"   r   r   r   r   r   )rW   r"   r  s      r\   r   z)BaseCallableTests.test_cannot_instantiate	  s    ==y) 	J	y) 	DN	cUCZ y) 	C	y) 	DGI	 		 		 		 		 	s/   CCC*C(CCC%(C1c                     | j                   }| j                  t              5  |t            d d d        y # 1 sw Y   y xY wrb   )r"   r   r   r   r  s     r\   test_callable_wrong_formsz+BaseCallableTests.test_callable_wrong_forms  s5    ==y) 	SM	 	 	s   
5>c                 j    | j                   }d }| j                  ||       | j                  d |       y )Nc                       y rb   rk   rk   r^   r\   rf   z9BaseCallableTests.test_callable_instance_works.<locals>.f      r^   )r"   r   r   rW   r"   rf   s      r\   test_callable_instance_worksz.BaseCallableTests.test_callable_instance_works  s0    ==	a*  x0r^   c                 
   | j                   }d }| j                  t              5  t        ||g d f          d d d        | j                  t              5  t        ||g t        f          d d d        | j                  t              5  t        d |g d f          d d d        | j                  t              5  t        d |g t        f          d d d        y # 1 sw Y   xY w# 1 sw Y   xxY w# 1 sw Y   UxY w# 1 sw Y   y xY w)Nc                       y rb   rk   rk   r^   r\   rf   z>BaseCallableTests.test_callable_instance_type_error.<locals>.f#  r  r^   )r"   r   r   r   r   r  s      r\   !test_callable_instance_type_errorz3BaseCallableTests.test_callable_instance_type_error!  s    ==	y) 	.q(2t8,-	.y) 	-q(2s7+,	-y) 	1tXb$h/0	1y) 	0tXb#g./	0 	0	. 	.	- 	-	1 	1	0 	0s/   CC!C-6C9C!C*-C69Dc                    | j                   }|j                   d}|g t        f   }| j                  t	        |      | d       |t
        t        gt        f   }| j                  t	        |      | d       |dt
        f   }| j                  t	        |      | d       |t
        t        gt        t           f   }| j                  t	        |      | d       y )N	.Callablez
[[], bool]z[[str, float], int].z
[..., str]z[[str, float], list[int]])	r"   ri   r,  r   r   r   r{  r   r  )rW   r"   fullnamect0ct2ctvct3s          r\   r   zBaseCallableTests.test_repr.  s    ==))*)4r4x cxj
$;<U|S()cxj0C$DEsCx cxj
$;<U|T#Y./cxj0I$JKr^   c                     | j                   }d|dt        f   fd}| j                  t        |t	               t                     d|dt        f   i       y )Nr  .c                      y rb   rk   r  s    r\   rk  z:BaseCallableTests.test_callable_with_ellipsis.<locals>.foo<  r  r^   )r"   r   r   r+   globalslocals)rW   r"   rk  s      r\   test_callable_with_ellipsisz-BaseCallableTests.test_callable_with_ellipsis:  sP    ==	8CF# 	 	WYAxQ/0	2r^   c                 T    | j                   }t        j                  |dt        f       y r  )r"   rc   r   r   r  s     r\   test_ellipsis_in_genericz*BaseCallableTests.test_ellipsis_in_genericB  s     ==HS#X&'r^   c                     | j                   }| j                  |t        z  t        |t        f          | j                  t        |z  t        t        |f          y rb   )r"   r   r   r   r  s     r\   test_or_and_rorz!BaseCallableTests.test_or_and_rorG  sG    ==E)55+AB)5+ABr^   c                    | j                   }|t        t        gt        f   }|t        j
                  j                   u r | j                  |t        j                         | j                  |j                  t        j
                  j                          | j                  |j                  t        t        t        f       | j                  |j                  d       y r  )r"   r   r   r{  collectionsabcr   r  GenericAliasr   r  r   r  r  rW   r"   r  s      r\   
test_basiczBaseCallableTests.test_basicL  s    ==#sU*+{///!!%););<e&&(@(@A#sE):;--r2r^   c                     | j                   }|t        t        gt        f   }| j	                   t        j                  |             |       y rb   )r"   r   r   r{  r   r  refr  s      r\   test_weakrefzBaseCallableTests.test_weakrefU  s=    ==#sU*++U+-u5r^   c                    | j                   }t        d      at        d      at        d      a|t        t        gt        f   |t        t        f   |t        t        f   |t        t        t        f   t        f   |t        g t        t           t        f   g}|D ]  }t        t        j                  dz         D ]  }| j                  ||      5  t        j                  ||      }t        j                   |      }| j#                  |j$                  |j$                         | j#                  |j&                  |j&                         | j#                  |j(                  |j(                         d d d          bbby # 1 sw Y   xY w)NT_pickleP_pickle	TS_picklern   )r  rq   )r"   r   r  rE   r   r   r!  r   r   r{  rF   rr   rs   rt   ru   rv  ru  r   r  r  r  )rW   r"   samplesr  rq   r   loadeds          r\   test_picklezBaseCallableTests.test_pickleZ  sh   ==:&Z( -	 c3Z&'Xs]#Xx'([h/45[!5)!5X!56;<
  	REv66:; R\\U\; RUE2A#\\!_F$$U%5%5v7H7HI$$U^^V__E$$U%9%96;P;PQR RR	R h	R Rs   BE>>Fc                    | j                   }|j                   d}|t        t        gt        f   }|t        t        gt
        f   }|dt        f   }| j                  |t           |t        t        gt        f          | j                  |d    |t        t        d       gt        d       f          | j                  |t        t        t        f   |t        t        gt        f          | j                  |t           |dt        f          | j                  |t           |dt        f          |t        t
        t        f   }| j                  t        |      | d       | j                  t        |t                 | d       | j                  |t           |t        t        gt        f          |t        j                  t           t        t        t        f   t
        gt        f   }| j                  |t        t        t        f   |t        j                  t           t        t        t        f   t        gt        f          y )Nr  .z[[int, ~VT], str]z[[int, dict], str])r"   ri   r   r   r   r   r   r   r   r{  r   r   r&  rc   r   r  )rW   r"   r  C1C2C3C4C5s           r\   r  z'BaseCallableTests.test_var_substitutions  s   ==))*)4sAhk"r1grk"c1fC(C:s?";<D8S$t*,=tDz,I#JKCO,hU|S7H.IJC(38"45HxX'>? RbhZ/@#ABbhH:5G)HID8S$K,<#=> v{{1~uRU|R8#=>CeO,!6;;s#3U38_e"Lc"QR	Tr^   c                     | j                   }t        d      }t        d      }d}| j                  t        |      5  |||f   dt
        f    d d d        y # 1 sw Y   y xY w)Nr  r   zAExpected a list of types, an ellipsis, ParamSpec, or Concatenate.r   )r"   rE   r   r   r   r   )rW   r"   r  r   pats        r\   test_type_subst_errorz'BaseCallableTests.test_type_subst_error  s[    ==cNCLQ##Is3 	#QTN1c6"	# 	# 	#s   AAc                     | j                   } G d d|      }|t        gt        f   }| j                   |       j                  |       | j                   |       j                  |t        gt        f          y )Nc                       e Zd Zd Zy)/BaseCallableTests.test_type_erasure.<locals>.C1c                      y rb   rk   r   s    r\   __call__z8BaseCallableTests.test_type_erasure.<locals>.C1.__call__      r^   Nrh   ri   rj   r2  rk   r^   r\   r&  r0    s    r^   r&  )r"   r   r   r   r   r   __orig_class__)rW   r"   r&  r  s       r\   test_type_erasurez#BaseCallableTests.test_type_erasure  s^    ==	 	 uaxLacmmR(++Rq\:r^   c                    | j                   }|j                   d}t        d      }t        d      }||t        f   }| j	                  |t
        gt        f   |t
        gt        f          | j	                  |t
        t        gt        f   |t
        t        gt        f          | j	                  |g t        f   |g t        f          | j	                  |dt        f   |dt        f          | j	                  ||t        f   ||t        f          | j	                  |t        t
        |f   t        f   |t        t
        |f   t        f          | j	                  t        |      | d       | j	                  t        |t
        t        gt        f         | d       | j                  t              5  |t
        t        f    d d d        ||t
        f   }| j	                  |t
        g   |t
        gt
        f          | j	                  |t
        t        g   |t
        t        gt
        f          | j	                  |g    |g t
        f          | j	                  |d   |dt
        f          | j	                  ||   ||t
        f          | j	                  |t        t
        |f      |t        t
        |f   t
        f          | j	                  |t
           |t
        gt
        f          | j	                  |t
        t        f   |t
        t        gt
        f          | j	                  t        |      | d       | j	                  t        |t
        t        f         | d       y # 1 sw Y   xY w)	Nr  r  P2.z[~P, ~T]z[[int, str], str]z	[~P, int]z[[int, str], int])r"   ri   rE   r   r   r   r   rF   r   r   r   )rW   r"   r  r  r8  r&  r'  s          r\   test_paramspecz BaseCallableTests.test_paramspec  s   ==))*)4cNt_ad^SE3J3%*)=>S#JO,hSz3.GHBGhr3w&78CHxS'9:BGhr3w&78KR0#56!+c2g"6";<	>bhZx#89b#sS12xj@Q4RSy) 	sCxL	 afSEHcUCZ$89S#J3*c/)BCB"c'!23C(38"45B"c'!23KR01!+c2g"6";<	> 	C(C5#:"67CHxc
C'@AbhZy#9:bcl+z9J-KL!	 	s   1M##M-c                    | j                   }|j                   d}t        d      }t        d      }t        d      }|t        t
        |f   |f   }| j                  t        |      | d       | j                  ||t
        f   |t        t
        |f   t
        f          | j                  |t        t        gt
        f   |t
        t        t        gt
        f          | j                  |g t
        f   |t
        gt
        f          | j                  |t        t        |f   t
        f   |t        t
        t        |f   t
        f          | j                  |dt
        f   |t        t
        df   t
        f          |t        t
        |f   t
        f   }| j                  t        |      | d       | j                  ||   |t        t
        |f   t
        f          | j                  |t        t        g   |t
        t        t        gt
        f          | j                  |t        t        f   |t
        t        t        gt
        f          | j                  |g    |t
        gt
        f          | j                  |t        t        |f      |t        t
        t        |f   t
        f          | j                  |d   |t        t
        df   t
        f          y )Nr  r   r  r8  z![typing.Concatenate[int, ~P], ~T].z"[typing.Concatenate[int, ~P], int])
r"   ri   r   rE   rF   r   r   r   r   r{  )rW   r"   r  r   r  r8  rB  s          r\   test_concatenatez"BaseCallableTests.test_concatenate  s   ==))*)4CLcNt_[a(!+,a$:%FG	I2s7Xk#r'.BC.G%HIC<,-xc58I38N/OP2s7XseSj%9:;sBw/45!+c3l";S"@A	C38h{38/Dc/I&JK[a(#-.a$:%GH	J2S"W)=s)B CDC<(Ce3Dc3I*JK3:#sE1BC1G(HI2# 45;sBw/0!+c3l";S"@A	C3+c3h*?*D!EFr^   c           	      n   | j                   }t        d      }t        d      }t        d      }t        d      }t        d      } G d dt        ||f         }| j                  |j                  ||f       |t        |g|||f   f   }| j                  |j                  t        |f|||f   f       | j                  |j                  ||f       | j                  |t        t        t           t        gf   |t        t        g|t        t           t        gt        f   f          |||gt        f   t        |   gt        f   }	| j                  |	j                  ||gt        f   t        |   ft        f       | j                  |	j                  |f       | j                  |	t        t              ||t        t           gt        f   t        t        t              gt        f          ||||f   |g|f   }
| j                  |
j                  |||f   |f|f       | j                  |
j                  ||f       | j                  |
g t        f   ||g t        f   t        gt        f          | j                  |
t        t        gt        f   ||t        t        gt        f   t        gt        f          | j                  |
t        t        g|f   t           ||t        t        gt        f   t        gt        f          ||t        g|t        |f   |g|f   }| j                  |j                  |t        g|t        |f   |f|f       | j                  |j                  ||f       | j                  |t        t        t        f   ||t        t        t        t        gt        f   t        gt        f          y )Nr  r8  r   r#  r  c                       e Zd Zy)3BaseCallableTests.test_nested_paramspec.<locals>.MyNr|   rk   r^   r\   Myr>    r  r^   r?  )r"   rE   r   r   r#   r   r  r   r  r   r  r  r,  r{  )rW   r"   r  r8  r   r#  r  r?  r&  r'  r(  r)  s               r\   test_nested_paramspecz'BaseCallableTests.test_nested_paramspec  s    ==cNt_CLT]$	A 	 	**QF3b	8BF++,Ry(2r62B&CD**RH5C$s)U!334S#J$s)U1CS1H(IIJ	L 2$)$d2h/45"s(;T"X'F&LM**RE2DIXtCyk3&67d3iI3NO	Q "b&!2&*+R(8"'=r&BC**RH5BGXb#g.4c9:	<S$K,-XsDk3&67=sBC	ES$KN+C0XsDk3&67=sBC	E 3//S/2-.3R78#C"1D(Er'JB&OP**RH5D%./XsD%&=u&DEuMuTU	Wr^   c                    | j                   }|t        t        gt        f   }| j	                  t
        d      5  |t            d d d        t        d      }||t        f   }| j	                  t
        d      5  |t        t        t        f    d d d        | j	                  t
        d      5  |t            d d d        y # 1 sw Y   {xY w# 1 sw Y   >xY w# 1 sw Y   y xY w)Nzis not a generic classr  many arguments forfew arguments for)r"   r   r   r{  r   r   rE   r   )rW   r"   r  r  r&  s        r\   r   zBaseCallableTests.test_errors	  s    ==#sU*+##I/GH 	#J	cNad^##I/CD 	sC}	##I/BC 	sG	 		 		 		 	s#   
B<6C)
C<CCCN)rh   ri   rj   r  r  r^  r   r  r   r  r   r  r  r  r  r  r$  r  r-  r6  r9  r;  r@  r   rk   r^   r\   r  r    ss    2
)8

10
L2(
C
36
*2T0#; MDG6(WT
r^   r  c                   *    e Zd Zej                  Zd Zy)TypingCallableTestsc                 `   t         j                  t        t        gt        f   }t
        j                  j                  t        t        gt        f   }| j                  |j                  |j                         | j                  t        |j                        t        |j                               y rb   )
rc   r"   r   r   r&  r  r  r   r  r  )rW   c1c2s      r\   test_consistencyz$TypingCallableTests.test_consistency	  sr     __c3Z-.__%%sCj$&67bkk2bkk*D,=>r^   N)rh   ri   rj   rc   r"   rI  rk   r^   r\   rE  rE  	  s    H?r^   rE  c                   8    e Zd Zej                  j
                  Zy)CollectionsCallableTestsN)rh   ri   rj   r  r  r"   rk   r^   r\   rK  rK  	  s    ''Hr^   rK  c                   f    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zy)LiteralTestsc                     t         d    t         d    t         d    t         d     t         d    t         d    t         t         d   t         d   f    t         d    y )	Nrn   rn   r      )r   r   zT)rn   2Fr        )s   foor*  )r   r   s    r\   r9  zLiteralTests.test_basics"	  sL    
wt},-r^   c                     dd l } G d d|j                        }| j                  t        |j                     j
                  |j                  f       y )Nr   c                       e Zd ZdZy)"LiteralTests.test_enum.<locals>.Myr   N)rh   ri   rj   r   rk   r^   r\   r?  rX  /	  s    Ar^   r?  )r  Enumr   r   r   r  )rW   r  r?  s      r\   	test_enumzLiteralTests.test_enum-	  s;    	 	 	//"$$9r^   c                 b    t         t            t         d    t         ddd    t         t            y )N)y       @      @.rk   rP  rT  rk  r*  )r   r   r   r   s    r\   3test_illegal_parameters_do_not_raise_runtime_errorsz@LiteralTests.test_illegal_parameters_do_not_raise_runtime_errors4	  s'     	 !$%
r^   c                 D    t         t        d       t         t        d       y )NrO  )rk  r*  baz)r   r   r   s    r\    test_literals_inside_other_typesz-LiteralTests.test_literals_inside_other_types<	  s    WWW*+,r^   c                    | j                  t        t        d         d       | j                  t        t        d         d       | j                  t        t        t                 d       | j                  t        t              d       | j                  t        t        d          d       | j                  t        t        d         d	       y )
Nrn   ztyping.Literal[1])rn   Trk  ztyping.Literal[1, True, 'foo']ztyping.Literal[int]ztyping.Literalztyping.Literal[None]rn   r   rP  rP  ztyping.Literal[1, 2, 3])r   r   r   r   r   s    r\   r   zLiteralTests.test_repr@	  s    gaj)+>?gn568XYgcl+-BCg(89gdm,.DEgj124MNr^   c                     t        t        t        d               }dD ]/  }| j                  |      5  | j	                  ||       d d d        1 y # 1 sw Y   <xY w)NrO  rV  rW  )rY  rZ  r   ru   r[  r\  s      r\   r^  zLiteralTests.test_dirH	  s_    GG,-.	
 	8M M: 8mY78 8	88 8s   AA	c                    | j                  t              5  t                d d d        | j                  t              5  t        d           d d d        | j                  t              5   t        t                      d d d        | j                  t              5   t        t        d                 d d d        y # 1 sw Y   xY w# 1 sw Y   }xY w# 1 sw Y   WxY w# 1 sw Y   y xY wrK  )r   r   r   r   r   s    r\   rI  zLiteralTests.test_cannot_initP	  s    y) 	I	y) 	AJL	y) 	DMO	y) 	D	 		 		 		 		 	s.   B<C)CC <CCC C)c                    | j                  t              5  t        dt        d          d d d        | j                  t              5  t        t        t        d          d d d        | j                  t              5  t        dt        d          d d d        | j                  t              5  t        t        t        d          d d d        y # 1 sw Y   xY w# 1 sw Y   |xY w# 1 sw Y   WxY w# 1 sw Y   y xY wrK  )r   r   r   r   r   rT   r   s    r\    test_no_isinstance_or_issubclassz-LiteralTests.test_no_isinstance_or_issubclassZ	  s    y) 	&q'!*%	&y) 	(sGAJ'	(y) 	&q'!*%	&y) 	(sGAJ'	( 	(	& 	&	( 	(	& 	&	( 	(s/   CC<C&-C2CC#&C/2C;c                     | j                  t              5   G d dt        d         }d d d        | j                  t              5   G d dt              }d d d        y # 1 sw Y   7xY w# 1 sw Y   y xY w)Nc                       e Zd Zy)-LiteralTests.test_no_subclassing.<locals>.FooNr|   rk   r^   r\   r   ri  f	  r   r^   r   rn   c                       e Zd Zy)-LiteralTests.test_no_subclassing.<locals>.BarNr|   rk   r^   r\   r   rk  h	  r   r^   r   r   r   r   rW   r   r   s      r\   test_no_subclassingz LiteralTests.test_no_subclassingd	  sa    y) 	('gaj'	(y) 	%$g$	% 	%	( 	(	% 	%s   AA+A(+A4c                 p    | j                  t              5  t        d   d    d d d        y # 1 sw Y   y xY wrK  rl  r   s    r\   test_no_multiple_subscriptsz(LiteralTests.test_no_multiple_subscriptsj	  s0    y) 	AJqM	 	 	s   ,5c                 D   | j                  t        d   t        d          | j                  t        d   t        d          | j                  t        d   t        d          | j                  t        d   t        d          | j                  t        d   t        d          | j                  t        d   t        d	          | j                  t        d   t        d          | j                  t        d   t        d
          | j                  t        d   t        d          y )Nr   FTrn   r   )rn   T)rn   rn   r  Tr   r   rn   rO  rb  )r   r   r   r   s    r\   
test_equalzLiteralTests.test_equaln	  s    GAJ7GDM71:6GAJ
3GG,gaj9GG,gdm<GDM77+;<WQZ06)7:+>?r^   c                 0   | j                  t        t        d         t        t        d                | j                  t        t        d         t        t        d                | j                  t        t        d         t        t        d                y )Nrn   r  rs  rO  rb  )r   r  r   r   s    r\   	test_hashzLiteralTests.test_hashy	  sj    gaj)4
+;<gdm,d74=.ABgg./gj6I1JKr^   c                 F   | j                  t        d   j                  d       | j                  t        d   j                  d       | j                  t        dt        d   t        d   f   j                  d       | j                  t        g g f   j                  g g f       y )NrO  rb  rn   r   )rP  rT  )rn   r   rP  rT  )r   r   r  r   s    r\   	test_argszLiteralTests.test_args~	  s    )22I>,55yAGAJ!=>GGVR11B8<r^   c                    t         t         d   t         d   t         d   f   }t         t         d   df   }t         t         d      }|||fD ]7  }| j                  |t         d          | j                  |j                  d       9 y )Nrn   r   rP  r  rO  )r   r   r  )rW   l1l2l3r  s        r\   test_flattenzLiteralTests.test_flatten	  s    WQZWQZ78WT]A%&WW%&R 	4AQ 01QZZ3	4r^   c                    dd l } G d d|j                        }t        t        |j                     t        |j                     t        d   t        d   f   }| j                  |j                  |j                  |j                  ddf       y )Nr   c                       e Zd ZdZdZy)5LiteralTests.test_does_not_flatten_enum.<locals>.Intsrn   r   Nr  rk   r^   r\   r  r  	  r  r^   r  rn   r   )r  r  r   r   r   r   r  )rW   r  r  r  s       r\   test_does_not_flatten_enumz'LiteralTests.test_does_not_flatten_enum	  sq    	4<< 	 DFFODFFOAJAJ
 	dffdffa%;<r^   N)rh   ri   rj   r9  rZ  r]  r`  r   r^  rI  rf  rn  rp  rt  rv  rx  r}  r  rk   r^   r\   rM  rM  !	  sP    	 :-O8(%	@L
=4=r^   rM  XKXVc                   B    e Zd ZdedefdZdedefdZd	dededefdZy)
SimpleMappingkeyr   c                      y rb   rk   rW   r  s     r\   __getitem__zSimpleMapping.__getitem__	      r^   r  c                      y rb   rk   rW   r  r  s      r\   __setitem__zSimpleMapping.__setitem__	  r  r^   Ndefaultc                      y rb   rk   rW   r  r  s      r\   getzSimpleMapping.get	  r  r^   rb   )rh   ri   rj   r  r  r  r  r  rk   r^   r\   r  r  	  sB    r b r " r B " r^   r  c                   8    e Zd Zd ZdefdZdefdZddefdZy)MySimpleMappingc                     i | _         y rb   storer   s    r\   r   zMySimpleMapping.__init__	  s	    
r^   r  c                      | j                   |   S rb   r  r  s     r\   r  zMySimpleMapping.__getitem__	  s    zz#r^   c                 "    || j                   |<   y rb   r  r  s      r\   r  zMySimpleMapping.__setitem__	  s    

3r^   Nc                 D    	 | j                   |   S # t        $ r |cY S w xY wrb   )r  KeyErrorr  s      r\   r  zMySimpleMapping.get	  s)    	::c?" 	N	s    rb   )rh   ri   rj   r   r   r  r  r  rk   r^   r\   r  r  	  s+    s  s  s r^   r  c                   "    e Zd ZU eed<   eed<   y)
Coordinater   r   Nrh   ri   rj   r   r   rk   r^   r\   r  r  	      
F
Fr^   r  c                       e Zd ZU eed<   y)PointlabelNrh   ri   rj   r   r   rk   r^   r\   r  r  	  s    Jr^   r  c                   ,    e Zd ZU eed<   eed<   eed<   y)MyPointr   r   r  Nrh   ri   rj   r   r   r   rk   r^   r\   r  r  	  s    
F
FJr^   r  c                       e Zd ZU eed<   y)XAxisr   Nr  rk   r^   r\   r  r  	      
Fr^   r  c                       e Zd ZU eed<   y)YAxisr   Nr  rk   r^   r\   r  r  	  r  r^   r  c                       e Zd Zy)PositionNr|   rk   r^   r\   r  r  	  s    r^   r  c                   (    e Zd ZU eed<   dedefdZy)Protoattrr   r   c                      y rb   rk   rW   r   s     r\   methz
Proto.meth	  r  r^   N)rh   ri   rj   r   r   r   r  rk   r^   r\   r  r  	  s    
I  r^   r  c                       e Zd Zy)ConcreteNr|   rk   r^   r\   r  r  	  r}   r^   r  c                   ,    e Zd ZU dZeed<   dedefdZy)Otherrn   r  r   r   c                     |dk(  ryy)Nthisrn   r   rk   r  s     r\   r  z
Other.meth	  s    &=r^   N)rh   ri   rj   r  r   r   r   r  rk   r^   r\   r  r  	  s    D#M  r^   r  c                   "    e Zd ZU eed<   eed<   y)NTr   r   Nr  rk   r^   r\   r  r  	  r  r^   r  c                   ,    e Zd ZU ej                  ed<   y)HasCallProtocolr2  N)rh   ri   rj   rc   r"   r   rk   r^   r\   r  r  	  s    oor^   r  c                      e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&d% Z'd& Z(d' Z)d( Z*d) Z+d* Z,d+ Z-d, Z.d- Z/d. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4 Z6d5 Z7d6 Z8d7 Z9d8 Z:d9 Z;d: Z<d; Z=d< Z>d= Z?d> Z@d? ZAd@ ZBdA ZCdB ZDdC ZEdD ZFdE ZGdF ZHdG ZIdH ZJdI ZKyJ)KProtocolTestsc                 j   t          G d dt                     } G d d      } G d d      }d }| j                  ||       | j                   |       |       | j	                  ||       | j                   |       |       | j	                  t        j                  |       | j                  ||       y )Nc                       e Zd Zd Zy),ProtocolTests.test_basic_protocol.<locals>.Pc                      y rb   rk   r   s    r\   r  z1ProtocolTests.test_basic_protocol.<locals>.P.meth	      r^   Nrh   ri   rj   r  rk   r^   r\   r  r  	      r^   r  c                       e Zd Zy),ProtocolTests.test_basic_protocol.<locals>.CNr|   rk   r^   r\   rB  r  	  r   r^   rB  c                       e Zd Zd Zy),ProtocolTests.test_basic_protocol.<locals>.Dc                      y rb   rk   r   s    r\   r  z1ProtocolTests.test_basic_protocol.<locals>.D.meth	  r  r^   Nr  rk   r^   r\   rE  r  	      r^   rE  c                       y rb   rk   rk   r^   r\   rf   z,ProtocolTests.test_basic_protocol.<locals>.f	  r  r^   )r*   r'   r]   r   r`   r   r  r  )rW   r  rB  rE  rf   s        r\   test_basic_protocolz!ProtocolTests.test_basic_protocol	  s    		 	 
	 		 		 	a#ac1%  A&  a(  !3!3Q7  A&r^   c                 |    | j                  t        d      5  t         d               }d d d        y # 1 sw Y   y xY w)Nz:@runtime_checkable can be only applied to protocol classesc                  0    d x} f G fdd
}|      S )r   c                       e Zd ZW  Zy)FProtocolTests.test_runtime_checkable_generic_non_protocol.<locals>.FooNru  rw  s   r\   r   r  
  s    r^   r   rk   r   r|  rx  s     @r\   z<generic parameters of Foo>z^ProtocolTests.test_runtime_checkable_generic_non_protocol.<locals>.<generic parameters of Foo>
  s    r^   )r   r   r*   rW   r   s     r\   +test_runtime_checkable_generic_non_protocolz9ProtocolTests.test_runtime_checkable_generic_non_protocol
  s;    ##H
 	  	 	 	s   2;c                     t          d               } G d d      }| j                  ||        G d d      }| j                  ||       y )Nc                  >    d xf G fdd
} t         |       S )r   c                   "    e Zd ZW  ZdW fdZy)9ProtocolTests.test_runtime_checkable_generic.<locals>.Foor   c                      y rb   rk   r   s    r\   r  z>ProtocolTests.test_runtime_checkable_generic.<locals>.Foo.meth
      r^   Nrh   ri   rj   rv  r  rx  r   s   r\   r   r  
  s    $a$r^   r   r'   r|  rx  r   s    @@r\   z<generic parameters of Foo>zQProtocolTests.test_runtime_checkable_generic.<locals>.<generic parameters of Foo>
  s     	% 	%X 	%r^   c                       e Zd ZdefdZy):ProtocolTests.test_runtime_checkable_generic.<locals>.Implr   c                      y rb   rk   r   s    r\   r  z?ProtocolTests.test_runtime_checkable_generic.<locals>.Impl.meth
  r+  r^   Nrh   ri   rj   r   r  rk   r^   r\   Implr  
  s
    &c&r^   r  c                       e Zd ZdefdZy)=ProtocolTests.test_runtime_checkable_generic.<locals>.NotImplr   c                      y rb   rk   r   s    r\   methodzDProtocolTests.test_runtime_checkable_generic.<locals>.NotImpl.method
  r/  r^   N)rh   ri   rj   r   r  rk   r^   r\   NotImplr  
  s
    ((r^   r  )r*   r]   r`   )rW   r   r  r  s       r\   test_runtime_checkable_genericz,ProtocolTests.test_runtime_checkable_generic
  sL    		% 
	%	' 	' 	dC(	) 	) 	  #.r^   c                     t          G d dt                     } d        } d        }| j                   |d      |       | j                   |d      |       y )Nc                       e Zd ZU eed<   y)IProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.HasXr   Nr  rk   r^   r\   HasXr  
      Fr^   r  c                  4    d xf G fdd
} |       S )r   c                   (    e Zd ZW  ZU W ed<   d Zy)HProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.Barr   c                     || _         y rb   r   r   s     r\   r   zQProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.Bar.__init__$
  r   r^   N)rh   ri   rj   rv  r   r   r  s   r\   r   r  "
  s     Dr^   r   rk   r  s    @@r\   z<generic parameters of Bar>z`ProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.<generic parameters of Bar>"
  s    ! 	 	 	r^   c                  0    d x} f G fdd
}|      S )r   c                   &    e Zd ZW  ZU eed<   d Zy)MProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.Capybarar   c                     || _         y rb   r   )rW   r   s     r\   r   zVProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.Capybara.__init__)
  r   r^   N)rh   ri   rj   rv  r   r   r   rw  s   r\   Capybarar  '
  s     Fr^   r  rk   r  s     @r\   z <generic parameters of Capybara>zeProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.<generic parameters of Capybara>'
  s    q 	 	 	r^   rn   r  r*   r'   r   r   )rW   r  r   r  s       r\   -test_pep695_generics_can_be_runtime_checkablez;ProtocolTests.test_pep695_generics_can_be_runtime_checkable
  sO    		8 	 
		
	
 	c!fd+  #5r^   c                    t          G d dt                     } G d d      }d }t        t        t        |t
        j                  fD ]  }| j                  ||        t               ddt        |fD ]  }| j                  ||        y )Nc                       e Zd Zy)FProtocolTests.test_everything_implements_empty_protocol.<locals>.EmptyNr|   rk   r^   r\   Emptyr  0
      r^   r  c                       e Zd Zy)BProtocolTests.test_everything_implements_empty_protocol.<locals>.CNr|   rk   r^   r\   rB  r  4
  r  r^   rB  c                       y rb   rk   rk   r^   r\   rf   zBProtocolTests.test_everything_implements_empty_protocol.<locals>.f7
  r  r^   rn   rk   )
r*   r'   r  r   r  r  r  r]   rc   r   )rW   r  rB  rf   things        r\   )test_everything_implements_empty_protocolz7ProtocolTests.test_everything_implements_empty_protocol/
  s    		H 	 
		 		 dE1e.@.@A 	0E!!%/	0h2vq1 	0E!!%/	0r^   c                 6    d }| j                  |t               y )Nc                       y rb   rk   rk   r^   r\   rf   z:ProtocolTests.test_function_implements_protocol.<locals>.f@
  r  r^   )r   r  re   s     r\   !test_function_implements_protocolz/ProtocolTests.test_function_implements_protocol?
  s    	 	a1r^   c                      G d d      } G d dt               }| j                  t              5   G d d|t               }d d d        | j                  t              5   G d dt         |      }d d d        | j                  t              5   G d	 d
||t               }d d d         G d d||      } G d d||      }| j                   |       |       | j                   |       |       y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   hxY w)Nc                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.CNr|   rk   r^   r\   rB  r
  F
  r   r^   rB  c                       e Zd Zy):ProtocolTests.test_no_inheritance_from_nominal.<locals>.BPNr|   rk   r^   r\   BPr  H
  r   r^   r  c                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.PNr|   rk   r^   r\   r  r  K
  r   r^   r  c                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.QNr|   rk   r^   r\   Qr  N
  r   r^   r  c                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.RNr|   rk   r^   r\   Rr  Q
  r   r^   r  c                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.DNr|   rk   r^   r\   rE  r  T
  r   r^   rE  c                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.ENr|   rk   r^   r\   r  r  V
  r   r^   r  )r'   r   r   r   )rW   rB  r  r  r  r  rE  r  s           r\    test_no_inheritance_from_nominalz.ProtocolTests.test_no_inheritance_from_nominalE
  s      y) 	Ax 	 y) 	Ha 	 y) 	B8 	 	A2  a(  a(	 		 		 	s#   C,C8D,C58DDc                 n    G d dt               }| j                  t              5   |        d d d         G d d|      }| j                   |       |       | j                  t              5   |d       d d d        t	        d      } G d dt         |         }| j                  t              5   |        d d d        | j                  t              5   |t
                   d d d        | j                  t              5   ||           d d d         G d	 d
||         }| j                   |t
                  |       | j                  t              5   |t
           d       d d d        y # 1 sw Y   BxY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)Nc                       e Zd Zy).ProtocolTests.test_no_instantiation.<locals>.PNr|   rk   r^   r\   r  r  \
  r   r^   r  c                       e Zd Zy).ProtocolTests.test_no_instantiation.<locals>.CNr|   rk   r^   r\   rB  r  a
  r   r^   rB  r   r   c                       e Zd Zy)/ProtocolTests.test_no_instantiation.<locals>.PGNr|   rk   r^   r\   PGr!  i
  r   r^   r"  c                       e Zd Zy)/ProtocolTests.test_no_instantiation.<locals>.CGNr|   rk   r^   r\   CGr$  r
  r   r^   r%  )r'   r   r   r   r   r   )rW   r  rB  r   r"  r%  s         r\   test_no_instantiationz#ProtocolTests.test_no_instantiation[
  sn   y) 	C	 	ac1%y) 	bE	 CL#!#y) 	D	y) 	BsGI	y) 	BqEG	 	Agbgi,y) 	BsGBK	 	/	 		 		 		 		 		 	sG   E-,	E:/FF FF+-E7:FFFF(+F4c                      G d dt               } G d d      } |       }|j                  |d       | j                  |j                  d       y )Nc                   (    e Zd ZU eed<   deddfdZy)LProtocolTests.test_protocol_defining_init_does_not_get_overridden.<locals>.Pr   r   Nc                     || _         y rb   r   r   s     r\   r   zUProtocolTests.test_protocol_defining_init_does_not_get_overridden.<locals>.P.__init__~
  r   r^   rh   ri   rj   r   r   r   rk   r^   r\   r  r)  |
      F# $ r^   r  c                       e Zd Zy)LProtocolTests.test_protocol_defining_init_does_not_get_overridden.<locals>.CNr|   rk   r^   r\   rB  r.  
  r   r^   rB  rn   )r'   r   r   r   rW   r  rB  r  s       r\   3test_protocol_defining_init_does_not_get_overriddenzAProtocolTests.test_protocol_defining_init_does_not_get_overriddenx
  s>    	 	 	C	

1aa r^   c                      G d dt               } G d d|      } |d      }| j                  ||       | j                  |j                  d       y )Nc                   (    e Zd ZU eed<   deddfdZy)JProtocolTests.test_concrete_class_inheriting_init_from_protocol.<locals>.Pr   r   Nc                     || _         y rb   r   r   s     r\   r   zSProtocolTests.test_concrete_class_inheriting_init_from_protocol.<locals>.P.__init__
  r   r^   r+  rk   r^   r\   r  r3  
  r,  r^   r  c                       e Zd Zy)JProtocolTests.test_concrete_class_inheriting_init_from_protocol.<locals>.CNr|   rk   r^   r\   rB  r6  
  r   r^   rB  rn   )r'   r   r   r   r/  s       r\   1test_concrete_class_inheriting_init_from_protocolz?ProtocolTests.test_concrete_class_inheriting_init_from_protocol
  sE    	 	
 	aDa#a r^   c                     t          G d dt                     } G d d|      } G d d|      }| j                  t              5   |        d d d        | j	                   |       |       y # 1 sw Y   !xY w)Nc                   6    e Zd Zej                  defd       Zy)9ProtocolTests.test_cannot_instantiate_abstract.<locals>.Pr   c                     t         rb   )NotImplementedErrorr   s    r\   amethz?ProtocolTests.test_cannot_instantiate_abstract.<locals>.P.ameth
  s    ))r^   N)rh   ri   rj   r  abstractmethodr   r=  rk   r^   r\   r  r:  
  s!    *s *  *r^   r  c                       e Zd Zy)9ProtocolTests.test_cannot_instantiate_abstract.<locals>.BNr|   rk   r^   r\   r   r@  
  r  r^   r   c                       e Zd ZdefdZy)9ProtocolTests.test_cannot_instantiate_abstract.<locals>.Cr   c                      y)N   rk   r   s    r\   r=  z?ProtocolTests.test_cannot_instantiate_abstract.<locals>.C.ameth
      r^   N)rh   ri   rj   r   r=  rk   r^   r\   rB  rB  
  s    s r^   rB  )r*   r'   r   r   r   )rW   r  r   rB  s       r\    test_cannot_instantiate_abstractz.ProtocolTests.test_cannot_instantiate_abstract
  so    		* 	* 
	*
	 		 	 y) 	C	ac1%	 	s   A,,A5c                     G d dt               }t         G d d|t                      } G d d      } G d d      } G d	 d
      }| j                   |       |       | j                   |       |       | j                  ||       | j                  ||       | j	                   |       |       | j                  ||       y )Nc                       e Zd Zd Zy)5ProtocolTests.test_subprotocols_extending.<locals>.P1c                      y rb   rk   r   s    r\   meth1z;ProtocolTests.test_subprotocols_extending.<locals>.P1.meth1
  r  r^   Nrh   ri   rj   rK  rk   r^   r\   P1rI  
  r  r^   rM  c                       e Zd Zd Zy)5ProtocolTests.test_subprotocols_extending.<locals>.P2c                      y rb   rk   r   s    r\   meth2z;ProtocolTests.test_subprotocols_extending.<locals>.P2.meth2
  r  r^   Nrh   ri   rj   rQ  rk   r^   r\   r8  rO  
  r  r^   r8  c                       e Zd Zd Zd Zy)4ProtocolTests.test_subprotocols_extending.<locals>.Cc                      y rb   rk   r   s    r\   rK  z:ProtocolTests.test_subprotocols_extending.<locals>.C.meth1
  r  r^   c                      y rb   rk   r   s    r\   rQ  z:ProtocolTests.test_subprotocols_extending.<locals>.C.meth2
  r  r^   Nrh   ri   rj   rK  rQ  rk   r^   r\   rB  rT  
      r^   rB  c                       e Zd Zd Zy)5ProtocolTests.test_subprotocols_extending.<locals>.C1c                      y rb   rk   r   s    r\   rK  z;ProtocolTests.test_subprotocols_extending.<locals>.C1.meth1
  r  r^   NrL  rk   r^   r\   r&  rZ  
  r  r^   r&  c                       e Zd Zd Zy)5ProtocolTests.test_subprotocols_extending.<locals>.C2c                      y rb   rk   r   s    r\   rQ  z;ProtocolTests.test_subprotocols_extending.<locals>.C2.meth2
  r  r^   NrR  rk   r^   r\   r'  r]  
  r  r^   r'  r'   r*   r   r`   r   r]   )rW   rM  r8  rB  r&  r'  s         r\   test_subprotocols_extendingz)ProtocolTests.test_subprotocols_extending
  s    	 	 
	X 	 
		 		 		 	 	  r*  r*  R(  R(ac2&a$r^   c                     G d dt               } G d dt               }t         G d d||t                      } G d d      } G d	 d
      } G d d      }| j                   |       |       | j                   |       |       | j                  ||       | j                  ||       | j	                   |       |       | j                  ||       y )Nc                       e Zd Zd Zy)3ProtocolTests.test_subprotocols_merging.<locals>.P1c                      y rb   rk   r   s    r\   rK  z9ProtocolTests.test_subprotocols_merging.<locals>.P1.meth1
  r  r^   NrL  rk   r^   r\   rM  rc  
  r  r^   rM  c                       e Zd Zd Zy)3ProtocolTests.test_subprotocols_merging.<locals>.P2c                      y rb   rk   r   s    r\   rQ  z9ProtocolTests.test_subprotocols_merging.<locals>.P2.meth2
  r  r^   NrR  rk   r^   r\   r8  rf  
  r  r^   r8  c                       e Zd Zy)2ProtocolTests.test_subprotocols_merging.<locals>.PNr|   rk   r^   r\   r  ri  
  r  r^   r  c                       e Zd Zd Zd Zy)2ProtocolTests.test_subprotocols_merging.<locals>.Cc                      y rb   rk   r   s    r\   rK  z8ProtocolTests.test_subprotocols_merging.<locals>.C.meth1
  r  r^   c                      y rb   rk   r   s    r\   rQ  z8ProtocolTests.test_subprotocols_merging.<locals>.C.meth2
  r  r^   NrW  rk   r^   r\   rB  rk  
  rX  r^   rB  c                       e Zd Zd Zy)3ProtocolTests.test_subprotocols_merging.<locals>.C1c                      y rb   rk   r   s    r\   rK  z9ProtocolTests.test_subprotocols_merging.<locals>.C1.meth1
  r  r^   NrL  rk   r^   r\   r&  ro  
  r  r^   r&  c                       e Zd Zd Zy)3ProtocolTests.test_subprotocols_merging.<locals>.C2c                      y rb   rk   r   s    r\   rQ  z9ProtocolTests.test_subprotocols_merging.<locals>.C2.meth2
  r  r^   NrR  rk   r^   r\   r'  rr  
  r  r^   r'  r_  )rW   rM  r8  r  rB  r&  r'  s          r\   test_subprotocols_mergingz'ProtocolTests.test_subprotocols_merging
  s    	 		 	 
	B 	 
		 		 		 	 	  q)  q)  Q'  Q'ac1%a#r^   c                    t        d      }t         G d dt                     }t         G d dt        |                } G d dt              } G d d	t        |         } G d
 d      }| j                  ||       | j                  ||       | j                  ||       d}| j	                  t
        |      5  t        |||          d d d        | j	                  t
        |      5  t        |||          d d d        d}| j	                  t
        |      5  t        ||       d d d        | j	                  t
        |      5  t        ||       d d d        | j	                  t
        |      5  t        |||          d d d        | j	                  t
        |      5  t        ||t                  d d d        d}	| j	                  t
        |	      5  t        d|       d d d        | j	                  t
        |	      5  t        d|       d d d        | j	                  t
        |	      5  t        d|       d d d        | j	                  t
        |	      5  t        d|       d d d        y # 1 sw Y   xY w# 1 sw Y   ~xY w# 1 sw Y   ^xY w# 1 sw Y   @xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)Nr   c                       e Zd Zd Zy)2ProtocolTests.test_protocols_issubclass.<locals>.Pc                      y rb   rk   r   s    r\   r   z4ProtocolTests.test_protocols_issubclass.<locals>.P.x
      r^   Nrh   ri   rj   r   rk   r^   r\   r  rw  
      r^   r  c                       e Zd Zd Zy)3ProtocolTests.test_protocols_issubclass.<locals>.PGc                      y rb   rk   r   s    r\   r   z5ProtocolTests.test_protocols_issubclass.<locals>.PG.x
  ry  r^   Nrz  rk   r^   r\   r"  r}  
  r{  r^   r"  c                       e Zd Zd Zy)5ProtocolTests.test_protocols_issubclass.<locals>.BadPc                      y rb   rk   r   s    r\   r   z7ProtocolTests.test_protocols_issubclass.<locals>.BadP.x
  ry  r^   Nrz  rk   r^   r\   BadPr  
      r^   r  c                       e Zd Zd Zy)6ProtocolTests.test_protocols_issubclass.<locals>.BadPGc                      y rb   rk   r   s    r\   r   z8ProtocolTests.test_protocols_issubclass.<locals>.BadPG.x
  ry  r^   Nrz  rk   r^   r\   BadPGr  
  r  r^   r  c                       e Zd Zd Zy)2ProtocolTests.test_protocols_issubclass.<locals>.Cc                      y rb   rk   r   s    r\   r   z4ProtocolTests.test_protocols_issubclass.<locals>.C.x
  ry  r^   Nrz  rk   r^   r\   rB  r  
  r  r^   rB  BSubscripted generics cannot be used with class and instance checksLInstance and class checks can only be used with @runtime_checkable protocols$issubclass\(\) arg 1 must be a classrn   )r   r*   r'   r]   r   r   rT   r   )
rW   r   r  r"  r  r  rB  no_subscripted_generics only_runtime_checkable_protocolsonly_classes_alloweds
             r\   test_protocols_issubclassz'ProtocolTests.test_protocols_issubclass
  s   CL		 	 
	 
	! 	 
		8 		HQK 		 	 	a#a$dB' Q 	  ##I/FG 	!q"Q% 	!##I/FG 	!q"Q% 	!+ 	)
 ##I/OP 	 q$	 ##I/OP 	!q% 	! ##I/FG 	!q"Q% 	!##I/FG 	$r2c7#	$  G##I/CD 	q!	##I/CD 	q"	##I/CD 	 q$	 ##I/CD 	!q% 	! 	!9	! 	!	! 	!	  	 	! 	!	! 	!	$ 	$
	 		 		  	 	! 	!sx   8I%&I2I?J,JJ&J29J>$K
K%I/2I<?J	JJ#&J/2J;>K
KKc                    t          G d dt                     } G d dt              } G d dt              } G d dt              } G d	 d
t              } G d dt              } G d dt              }||||||fD ]9  }| j                  |j                        5  | j	                  ||       d d d        ;  G d dt              }	 G d dt              }
| j                  |	|       | j                  |
|        G d d      } G d d      } G d d      } G d d      }| j                  ||       | j	                  ||       | j	                  ||       | j	                  ||       y # 1 sw Y   xY w)Nc                       e Zd Zd Zy)ZProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.CallableMembersProtoc                      y rb   rk   r   s    r\   r  z_ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.CallableMembersProto.meth%      Cr^   Nr  rk   r^   r\   CallableMembersProtor  #      r^   r  c                       e Zd Zd Zy)TProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.IdenticalProtoc                      y rb   rk   r   s    r\   r  zYProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.IdenticalProto.meth,  r  r^   Nr  rk   r^   r\   IdenticalProtor  +  s    r^   r  c                       e Zd Zd Zd Zy)SProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.SupersetProtoc                      y rb   rk   r   s    r\   r  zXProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.SupersetProto.meth/  r  r^   c                      y rb   rk   r   s    r\   rQ  zYProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.SupersetProto.meth20      Sr^   N)rh   ri   rj   r  rQ  rk   r^   r\   SupersetProtor  .  s     r^   r  c                   "    e Zd ZU eg df   ed<   y)]ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NonCallableMembersProtoNr  rh   ri   rj   r"   r   rk   r^   r\   NonCallableMembersProtor  2      2t8$$r^   r  c                   :    e Zd ZU eg df   ed<   eeegef   ed<   y)eProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NonCallableMembersSupersetProtoNr  rQ  )rh   ri   rj   r"   r   r   r   r,  rk   r^   r\   NonCallableMembersSupersetProtor  5  s%    2t8$$S#J,--r^   r  c                   (    e Zd ZU eg df   ed<   d Zy)XProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.MixedMembersProto1Nr  c                      y rb   rk   r   s    r\   rQ  z^ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.MixedMembersProto1.meth2;  r  r^   )rh   ri   rj   r"   r   rQ  rk   r^   r\   MixedMembersProto1r  9      2t8$$ r^   r  c                   ,    e Zd ZU d Zeeegef   ed<   y)XProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.MixedMembersProto2c                      y rb   rk   r   s    r\   r  z]ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.MixedMembersProto2.meth>  r  r^   rQ  N)	rh   ri   rj   r  r"   r   r   r,  r   rk   r^   r\   MixedMembersProto2r  =  s    S#J,--r^   r  rp   c                       e Zd Zy)SProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.EmptyProtocolNr|   rk   r^   r\   EmptyProtocolr  K  r   r^   r  c                       e Zd Zd Zy)WProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.UnrelatedProtocolc                      y rb   rk   r   s    r\   wutz[ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.UnrelatedProtocol.wutM      3r^   N)rh   ri   rj   r  rk   r^   r\   UnrelatedProtocolr  L  s    r^   r  c                   "    e Zd ZU eg df   ed<   y)^ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.AnnotatedButNotAProtocolNr  r  rk   r^   r\   AnnotatedButNotAProtocolr  W  r  r^   r  c                       e Zd Zd Zy)gProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclassc                      y rb   rk   r   s    r\   r  zlProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass.meth[      Dr^   Nr  rk   r^   r\   !NotAProtocolButAnImplicitSubclassr  Z       r^   r  c                   (    e Zd ZU eg df   ed<   d Zy)hProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass2Nr  c                      y rb   rk   r   s    r\   r  zmProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass2.meth_  r  r^   )rh   ri   rj   r"   r   r  rk   r^   r\   "NotAProtocolButAnImplicitSubclass2r  ]  r  r^   r  c                   F    e Zd ZU eg df   ed<   eeegef   ed<   d Zd Z	y)hProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass3Nr  rQ  c                      y rb   rk   r   s    r\   r  zmProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass3.methd  r  r^   c                      y)NTrk   rW   r   r   s      r\   rQ  znProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass3.meth2e  s    $r^   )
rh   ri   rj   r"   r   r   r   r,  r  rQ  rk   r^   r\   "NotAProtocolButAnImplicitSubclass3r  a  s+    2t8$$S#J,-- .r^   r  )r*   r'   ru   rh   r]   r`   )rW   r  r  r  r  r  r  r  rq   r  r  r  r  r  r  s                  r\   .test_implicit_issubclass_between_two_protocolsz<ProtocolTests.test_implicit_issubclass_between_two_protocols"  s{   		 8 	  
	 	 X 	 	!H 	!	%h 	%	.h 	.	! 	!	. 	.
 M+B+-?AS
 	CE ENN3 C%%e-ABC C		C 	+H*	 	 	  0DE  !24HI	% 	%	! 	!	! 	!	/ 	/ 	  !9;OP?AUV@BVW@BVWKC Cs   E**E3	c                 d   | j                  t        j                         t        j                          | j	                  t
        d      5   G d dt        j                  j                  t              }d d d        | j                  g t        j                  j                         y # 1 sw Y   4xY w)Nz/Protocols can only inherit from other protocolsc                       e Zd Zy)CProtocolTests.test_isinstance_checks_not_at_whim_of_gc.<locals>.FooNr|   rk   r^   r\   r   r  t  r   r^   r   )
addCleanupgcenabledisabler   r   r  r  r  r'   r   r  s     r\   (test_isinstance_checks_not_at_whim_of_gcz6ProtocolTests.test_isinstance_checks_not_at_whim_of_gcl  sx    		"


##=
 	koo--x 		 	  [__%<%<=	 	s   
)B&&B/c                 D    G d d      }| j                  t        t               | j                  t               t               | j                  t        t               | j                  dt               | j                  |t               | j                   |       t               d}| j                  t        |      5  t        dt               d d d        | j                  t        |      5  t        dt               d d d        | j                  t        |      5  t         |       t               d d d        t        d      }t         G d dt                     }t         G d	 d
t                     }t         G d dt        |                }|||fD ]=  }| j                  |j                        5  | j                  |t               d d d        ? | j                  t        |       | j                  t               |       | j                  t        t               | j                  t               t               | j                  t        |       | j                  d|       | j                  t        t               | j                  dt               | j                  ||       | j                   |       |       | j                  |t               | j                   |       t               y # 1 sw Y   #xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w)Nc                       e Zd Zd Zy)JProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.Cc                      y rb   rk   r   s    r\   r   zLProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.C.x{  s    r^   Nrz  rk   r^   r\   rB  r  z  s    r^   rB  rk  r  rn   r   c                       e Zd Zy)VProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.EmptyProtocolNr|   rk   r^   r\   r  r    s    '+r^   r  c                       e Zd ZdedefdZy)[ProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.SupportsStartsWithr   r   c                      y rb   rk   r   s     r\   
startswithzfProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.SupportsStartsWith.startswith  s    #r^   Nrh   ri   rj   r   r,  r  rk   r^   r\   SupportsStartsWithr    s    5C5D5r^   r  c                       e Zd Zd Zy)RProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.SupportsXc                      y rb   rk   r   s    r\   r   zTProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.SupportsX.x  ry  r^   Nrz  rk   r^   r\   	SupportsXr    r{  r^   r  rp   )r`   r  r'   r   r   r   r   rT   r   r*   ru   rh   r]   r   )rW   rB  r  r   r  r  r  rq   s           r\   1test_issubclass_and_isinstance_on_Protocol_itselfz?ProtocolTests.test_issubclass_and_isinstance_on_Protocol_itselfy  s   	 	 	  2  84  h/  1  H-  h/F##I/CD 	$q(#	$##I/CD 	(uh'	(##I/CD 	&qsH%	& CL	+H+ 
+		6 	6 
	6 
	 	 
	 #$6	A 	7EENN3 7%%eX67 7	7 	fm4fh6  2  84c#56e%78  h/  1a+ac9-  H-  h/U	$ 	$	( 	(	& 	&"7 7s0   <K.+K;L2L.K8;LLL	c                     G d d      }t          G d dt                     }d}| j                  t        |      5  t	        ||       d d d        | j                   |       |       |j                  |       | j                  t        |      5  t	        ||       d d d        | j                   |       |        G d d|      }| j                  ||       | j                   |       |       |j                  |       | j                  ||       | j                   |       |       | j                  t        |      5  t	        ||       d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)Nc                       e Zd ZdZy)?ProtocolTests.test_protocols_issubclass_non_callable.<locals>.Crn   Nrz  rk   r^   r\   rB  r        Ar^   rB  c                       e Zd ZdZy)FProtocolTests.test_protocols_issubclass_non_callable.<locals>.PNonCallrn   Nrz  rk   r^   r\   PNonCallr        Ar^   r  <Protocols with non-method members don't support issubclass()c                       e Zd Zy)?ProtocolTests.test_protocols_issubclass_non_callable.<locals>.DNr|   rk   r^   r\   rE  r    r   r^   rE  )
r*   r'   r   r   rT   r   registerr`   r   r]   )rW   rB  r  non_callable_members_illegalrE  s        r\   &test_protocols_issubclass_non_callablez4ProtocolTests.test_protocols_issubclass_non_callable  sX   	 	 
	x 	 
	 K 	% ##I/KL 	$q(#	$ 	ac8,!##I/KL 	$q(#	$ 	ac8, 	  A&  a(	

1a#ac1%##I/KL 	$q(#	$ 	$)	$ 	$	$ 	$	$ 	$s#   EE!>E-E!E*-E6c                     t          G d dt                     } G d d      }| j                   |       |       | j                  t        d      5  t        ||       d d d        y # 1 sw Y   y xY w)Nc                       e Zd ZU eed<   y)RProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance.<locals>.Spamr   Nr  rk   r^   r\   Spamr    r  r^   r  c                       e Zd ZddZy)RProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance.<locals>.EggsNc                     d| _         y r   r   r   s    r\   r   z[ProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance.<locals>.Eggs.__init__  s	    r^   r   Nr   rk   r^   r\   Eggsr    s    r^   r   r  )r*   r'   r   r   r   rT   rW   r  r   s      r\   6test_no_weird_caching_with_issubclass_after_isinstancezDProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance  sp    		8 	 
		 	 	dfd+ ##J
 	# tT"		# 	# 	#   A&&A/c                     t          G d dt                     } G d d      }| j                   |       |       | j                  t        d      5  t        ||       d d d        y # 1 sw Y   y xY w)Nc                       e Zd ZU eed<   y)TProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_2.<locals>.Spamr   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd Zy)TProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_2.<locals>.EggsNr|   rk   r^   r\   r   r    r   r^   r   r  r*   r'   r   r   r   rT   r  s      r\   8test_no_weird_caching_with_issubclass_after_isinstance_2zFProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_2  sk    		8 	 
	 	  . ##J
 	# tT"		# 	# 	#r  c                     t          G d dt                     } G d d      }| j                   |       |       | j                  t        d      5  t        ||       d d d        y # 1 sw Y   y xY w)Nc                       e Zd ZU eed<   y)TProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_3.<locals>.Spamr   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd Zd Zy)TProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_3.<locals>.Eggsc                 $    |dk(  ryt        |      )Nr   r   AttributeErrorrW   r  s     r\   __getattr__z`ProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_3.<locals>.Eggs.__getattr__  s    3;$T**r^   Nrh   ri   rj   r  rk   r^   r\   r   r    s    +r^   r   r  r	  r  s      r\   8test_no_weird_caching_with_issubclass_after_isinstance_3zFProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_3  sp    		8 	 
		+ 	+ 	  . ##J
 	# tT"		# 	# 	#r  c                     t          d               } d        }| j                   |d      |       | j                  t        d      5  t	        ||       d d d        y # 1 sw Y   y xY w)Nc                  >    d xf G fdd
} t         |       S )r   c                   "    e Zd ZW  ZU W ed<   y)YProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695.<locals>.Spamr   Nrh   ri   rj   rv  r   r  s   r\   r  r    s
     Dr^   r  r  r  s    @@r\   z<generic parameters of Spam>zqProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695.<locals>.<generic parameters of Spam>  s     	 	h 	r^   c                  4    d xf G fdd
} |       S )r   c                   &    e Zd ZW  ZdW ddfdZy)YProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695.<locals>.Eggsr   r   Nc                     || _         y rb   r   r   s     r\   r   zbProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695.<locals>.Eggs.__init__  r   r^   )rh   ri   rj   rv  r   r  s   r\   r   r    s    !  r^   r   rk   r  s    @@r\   z<generic parameters of Eggs>zqProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695.<locals>.<generic parameters of Eggs>  s    1 	 	 	r^   r   r  )r*   r   r   r   rT   r  s      r\   =test_no_weird_caching_with_issubclass_after_isinstance_pep695zKProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695  sf    		 
		 	d2h- ##J
 	# tT"		# 	# 	#s   AA'c                 Z   t        d      }t         G d dt                     }t         G d dt        |                }t         G d dt                     }t         G d d	t                     } G d
 d      t         G fddt                     } G d dt              } G d dt        |         } G d d      }	 G d d      }
|	|
fD ]U  }|||||fD ]I  }| j                  |j                  |j                        5  | j                   |       |       d d d        K W d}| j                  t        |      5  t         |	       ||          d d d        | j                  t        |      5  t         |	       ||	          d d d        d}| j                  t        |      5  t         |	       |       d d d        | j                  t        |      5  t         |	       |       d d d        y # 1 sw Y   #xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   _xY w# 1 sw Y   y xY w)Nr   c                       e Zd Zd Zy)2ProtocolTests.test_protocols_isinstance.<locals>.Pc                      y rb   rk   r   s    r\   r  z7ProtocolTests.test_protocols_isinstance.<locals>.P.meth4  ry  r^   Nr  rk   r^   r\   r  r#  2  r{  r^   r  c                       e Zd Zd Zy)3ProtocolTests.test_protocols_isinstance.<locals>.PGc                      y rb   rk   r   s    r\   r  z8ProtocolTests.test_protocols_isinstance.<locals>.PG.meth8  ry  r^   Nr  rk   r^   r\   r"  r&  6  r{  r^   r"  c                   $    e Zd Zej                  Zy);ProtocolTests.test_protocols_isinstance.<locals>.WeirdProtoN)rh   ri   rj   r   	maketransr  rk   r^   r\   
WeirdProtor)  :  s    ==Dr^   r+  c                       e Zd Zd Zy)<ProtocolTests.test_protocols_isinstance.<locals>.WeirdProto2c                       y rb   rk   r   r   s     r\   <lambda>zEProtocolTests.test_protocols_isinstance.<locals>.WeirdProto2.<lambda>@      r^   Nr  rk   r^   r\   WeirdProto2r-  >  s    /Dr^   r2  c                       e Zd Zd Zy)?ProtocolTests.test_protocols_isinstance.<locals>.CustomCallablec                      y rb   rk   r   s      r\   r2  zHProtocolTests.test_protocols_isinstance.<locals>.CustomCallable.__call__C  r  r^   Nr4  rk   r^   r\   CustomCallabler4  B  r  r^   r6  c                       e Zd Z W         Zy)=ProtocolTests.test_protocols_isinstance.<locals>.WeirderProtoNr  )r6  s   r\   WeirderProtor8  F  s    !#Dr^   r9  c                       e Zd Zd Zy)5ProtocolTests.test_protocols_isinstance.<locals>.BadPc                      y rb   rk   r   s    r\   r  z:ProtocolTests.test_protocols_isinstance.<locals>.BadP.methK  ry  r^   Nr  rk   r^   r\   r  r;  J  r  r^   r  c                       e Zd Zd Zy)6ProtocolTests.test_protocols_isinstance.<locals>.BadPGc                      y rb   rk   r   s    r\   r  z;ProtocolTests.test_protocols_isinstance.<locals>.BadPG.methN  ry  r^   Nr  rk   r^   r\   r  r>  M  r  r^   r  c                       e Zd Zd Zy)2ProtocolTests.test_protocols_isinstance.<locals>.Cc                      y rb   rk   r   s    r\   r  z7ProtocolTests.test_protocols_isinstance.<locals>.C.methQ  ry  r^   Nr  rk   r^   r\   rB  rA  P  r  r^   rB  c                       e Zd Zd Zy)3ProtocolTests.test_protocols_isinstance.<locals>.C2c                     d | _         y )Nc                       y rb   rk   rk   r^   r\   r0  zNProtocolTests.test_protocols_isinstance.<locals>.C2.__init__.<locals>.<lambda>U  r1  r^   )r  r   s    r\   r   z<ProtocolTests.test_protocols_isinstance.<locals>.C2.__init__T  s	    (	r^   Nr   rk   r^   r\   r'  rD  S      )r^   r'  )klassrq   r  r  )	r   r*   r'   ru   rh   r   r   r   r   )rW   r   r  r"  r+  r2  r9  r  r  rB  r'  rH  rq   r  only_runtime_checkable_msgr6  s                  @r\   test_protocols_isinstancez'ProtocolTests.test_protocols_isinstance/  s,   CL		 	 
	 
	! 	 
	 
	! 	! 
	! 
	0( 	0 
	0	 	 
	$8 	$ 
	$	8 		HQK 		 		) 	) U 	:EB
KE :\\enn\M :))%'59: ::	:
 #g##I/FG 	#qsBqE"	###I/FG 	#qsBqE"	#0 	#
 ##I/IJ 	"qsD!	"##I/IJ 	#qsE"	# 	##: :
	# 	#	# 	#	" 	"	# 	#s<   G0=G=0H	%HH!0G:=H	HH!H*c           
          G d d      } G d d       G fdd      } G d d|      } G d	 d
|      } G d d      }t        d      t         G d dt                     }t         G d dt                     }t         G d dt                        }t         G fddt                        }	t         G d dt                     }
t         G fddt                        }||||	|
|fD ]  }||||fD ]I  }| j                  |j                  |j                        5  | j                   |       |       d d d        K | j                  d|j                        5  | j                   |       |       d d d          G d dt              } G d dt              } G d d t                 } G fd!d"t                 }|   ||   |	   |	|   |   ||   ||||f
}|D ]c  }|||||fD ]W  }| j                  |j                  |#      5  | j                  t              5  t         |       |       d d d        d d d        Y e y # 1 sw Y   `xY w# 1 sw Y   vxY w# 1 sw Y   0xY w# 1 sw Y   xY w)$Nc                       e Zd Zed        Zy)MProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.Cc                      yr   rk   r   s    r\   r  zRProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.C.attro      r^   Nrh   ri   rj   propertyr  rk   r^   r\   rB  rM  n  s     r^   rB  c                       e Zd ZddZy)\ProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.CustomDescriptorNc                      yr   rk   rW   objobjtypes      r\   __get__zdProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.CustomDescriptor.__get__t  rE  r^   rb   rh   ri   rj   rX  rk   r^   r\   CustomDescriptorrS  s  s    r^   rZ  c                       e Zd Z W         Zy)MProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.DNrh   ri   rj   r  rZ  s   r\   rE  r\  w      #%Dr^   rE  c                       e Zd Zy)MProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.ENr|   rk   r^   r\   r  ra  |  r   r^   r  c                       e Zd Zy)MProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.FNr|   rk   r^   r\   r  rc  }  r   r^   r  c                       e Zd Zy)QProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.EmptyNr|   rk   r^   r\   r  re    r   r^   r  r   c                       e Zd Zed        Zy)MProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.Pc                      y rb   rk   r   s    r\   r  zRProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.P.attr      r^   NrP  rk   r^   r\   r  rg         r^   r  c                       e Zd ZU eed<   y)NProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.P1r  Nr  rk   r^   r\   rM  rl        Ir^   rM  c                       e Zd Zed        Zy)NProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.PGc                      y rb   rk   r   s    r\   r  zSProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.PG.attr  ri  r^   NrP  rk   r^   r\   r"  ro    rj  r^   r"  c                       e Zd ZU W  ed<   y)OProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.PG1r  Nrh   ri   rj   r   r   s   r\   PG1rr        Gr^   ru  c                       e Zd Zd Zy)SProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.MethodPc                      y rb   rk   r   s    r\   r  zXProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.MethodP.attr  r  r^   Nr]  rk   r^   r\   MethodPrx    r  r^   rz  c                       e Zd ZdW  fdZy)TProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.MethodPGr   c                      y rb   rk   r   s    r\   r  zYProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.MethodPG.attr  r  r^   Nr]  rt  s   r\   MethodPGr|        $a$r^   r~  rH  protocol_classc                       e Zd Zed        Zy)PProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadPc                      y rb   rk   r   s    r\   r  zUProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadP.attr  ri  r^   NrP  rk   r^   r\   r  r         r^   r  c                       e Zd ZU eed<   y)QProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadP1r  Nr  rk   r^   r\   BadP1r        Ir^   r  c                       e Zd Zed        Zy)QProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadPGc                      y rb   rk   r   s    r\   r  zVProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadPG.attr  ri  r^   NrP  rk   r^   r\   r  r    r  r^   r  c                       e Zd ZU W  ed<   y)RProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadPG1r  Nrs  rt  s   r\   BadPG1r    s    Gr^   r  )rH  rV  )
r   r*   r'   ru   rh   r   r   r   r   r   )rW   rB  rE  r  r  r  r  rM  r"  ru  rz  r~  r  rH  r  r  r  r  casesrV  rZ  r   s                       @@r\   4test_protocols_isinstance_properties_and_descriptorszBProtocolTests.test_protocols_isinstance_properties_and_descriptorsm  s   	 	
	 		& 	&
 	CL		  	  
	  
	 	 
	 
	 ! 	  
	  
	(1+ 	 
	 
	 h 	  
	  
	%x{ 	% 
	%  Rgx? 		BNAq! C\\..#1#:#: "  C ))%'>B	C CC GN<S<ST B((.AB B		B	 8 	 	H 		 HQK 	 	Xa[ 	 qE2a5#a&#a&(1+QKueV

  	1CAq!U* 1\\C\@ 1**95 1"57C011 11	19C CB B21 11 1s<   &I%II8+I,	=I8II)	,I51I88Jc                     t          G d dt                     } G d d      } G d d      }| j                   |       |       | j                   |       |       y )Nc                       e Zd ZU eed<   y)NProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.HasXr   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd ZdZd Zy)XProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.CustomDirWithXr  c                     g S rb   rk   r   s    r\   __dir__z`ProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.CustomDirWithX.__dir__      	r^   N)rh   ri   rj   r   r  rk   r^   r\   CustomDirWithXr    s    Ar^   r  c                       e Zd Zd Zy)[ProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.CustomDirWithoutXc                     dgS Nr   rk   r   s    r\   r  zcProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.CustomDirWithoutX.__dir__  s	    ur^   N)rh   ri   rj   r  rk   r^   r\   CustomDirWithoutXr        r^   r  r  )rW   r  r  r  s       r\   2test_protocols_isinstance_not_fooled_by_custom_dirz@ProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir  sX    		8 	 
		 	
	 	 	n.5  !2!4d;r^   c                 @    G d d      } G d d       G fdd      } G d d|      } G d	 d
|      } G d d      }t        d      t         G d dt                     }t         G d dt                     }t         G d dt                        }t         G fddt                        }	t         G d dt                     }
t         G fddt                        }||||	|
|fD ]  }||||fD ]I  }| j                  |j                  |j                        5  | j                   |       |       d d d        K | j                  d|j                        5  | j                   |       |       d d d         y # 1 sw Y   xY w# 1 sw Y   xY w)Nc                       e Zd Zed        Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.Cc                     t        d      )Nnor  r   s    r\   r  zZProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.C.attr  s    $T**r^   NrP  rk   r^   r\   rB  r    s    + +r^   rB  c                       e Zd ZddZy)dProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.CustomDescriptorNc                     t        d      NNORuntimeErrorrU  s      r\   rX  zlProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.CustomDescriptor.__get__      "4((r^   rb   rY  rk   r^   r\   rZ  r    s    )r^   rZ  c                       e Zd Z W         Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.DNr]  r^  s   r\   rE  r    r_  r^   rE  c                       e Zd Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.ENr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.FNr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zd Zy)eProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.WhyWouldYouDoThisc                     t        d      )Nr  r  )rW   r  s     r\   r  zqProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.WhyWouldYouDoThis.__getattr__  s    "5))r^   Nr  rk   r^   r\   WhyWouldYouDoThisr    s    *r^   r  r   c                       e Zd Zed        Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.Pc                      y rb   rk   r   s    r\   r  zZProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.P.attr  ri  r^   NrP  rk   r^   r\   r  r    rj  r^   r  c                       e Zd ZU eed<   y)VProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.P1r  Nr  rk   r^   r\   rM  r    rm  r^   rM  c                       e Zd Zed        Zy)VProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.PGc                      y rb   rk   r   s    r\   r  z[ProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.PG.attr  ri  r^   NrP  rk   r^   r\   r"  r    rj  r^   r"  c                       e Zd ZU W  ed<   y)WProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.PG1r  Nrs  rt  s   r\   ru  r    rv  r^   ru  c                       e Zd Zd Zy)[ProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.MethodPc                      y rb   rk   r   s    r\   r  z`ProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.MethodP.attr  r  r^   Nr]  rk   r^   r\   rz  r    r  r^   rz  c                       e Zd ZdW  fdZy)\ProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.MethodPGr   c                      y rb   rk   r   s    r\   r  zaProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.MethodPG.attr  r  r^   Nr]  rt  s   r\   r~  r     r  r^   r~  r  )r   r*   r'   ru   rh   r   r   )rW   rB  rE  r  r  r  r  rM  r"  ru  rz  r~  r  rH  rZ  r   s                 @@r\   <test_protocols_isinstance_attribute_access_with_side_effectszJProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects  s   	+ 	+
	) 	)	& 	&
 		* 	* CL		  	  
	  
	 	 
	 
	 ! 	  
	  
	(1+ 	 
	 
	 h 	  
	  
	%x{ 	% 
	%  Rgx? 	NNAq! C\\..#1#:#: "  C ))%'>B	C CC )-66   N (():)<nM	N N	NC CN Ns   &F%FFF	c                 v    t          G d dt                     } G d d      }| j                   |       |       y )Nc                       e Zd ZU eed<   y)?ProtocolTests.test_protocols_isinstance___slots__.<locals>.HasXr   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd ZdZy)MProtocolTests.test_protocols_isinstance___slots__.<locals>.HasNothingButSlotsr   Nrh   ri   rj   	__slots__rk   r^   r\   HasNothingButSlotsr    s    Ir^   r  r*   r'   r   )rW   r  r  s      r\   #test_protocols_isinstance___slots__z1ProtocolTests.test_protocols_isinstance___slots__  s=     
	8 	 
		 	 	02D9r^   c                 D    G d d      } G d d      } G d d      } G d d      }| j                   |d	d
d      t               | j                   |d	d
      t               | j                  t               t               | j                   |d	d
      t               | j                  t               t               | j                  t               t               | j                   |d      t               | j                   |       t               | j                   |       t               | j                   |       t               | j                   |       t               | j                  t               t               | j                  t        d	d
      t               y )Nc                       e Zd Zd Zy)<ProtocolTests.test_protocols_isinstance_py36.<locals>.APointc                 .    || _         || _        || _        y rb   r   r   r  )rW   r   r   r  s       r\   r   zEProtocolTests.test_protocols_isinstance_py36.<locals>.APoint.__init__   s    "
r^   Nr   rk   r^   r\   APointr    s    #r^   r  c                       e Zd ZdZd Zy)<ProtocolTests.test_protocols_isinstance_py36.<locals>.BPointr   c                      || _         || _        y rb   r   r   r  s      r\   r   zEProtocolTests.test_protocols_isinstance_py36.<locals>.BPoint.__init__(  s    r^   N)rh   ri   rj   r  r   rk   r^   r\   BPointr  %  s    Er^   r  c                       e Zd Zd Zd Zy)7ProtocolTests.test_protocols_isinstance_py36.<locals>.Cc                     || _         y rb   r  r  s     r\   r   z@ProtocolTests.test_protocols_isinstance_py36.<locals>.C.__init__-  	     	r^   c                      yrb  rk   r  s     r\   r  z<ProtocolTests.test_protocols_isinstance_py36.<locals>.C.meth0      r^   N)rh   ri   rj   r   r  rk   r^   r\   rB  r  ,  s    !r^   rB  c                       e Zd Zy)9ProtocolTests.test_protocols_isinstance_py36.<locals>.BadNr|   rk   r^   r\   Badr  3  r   r^   r  rn   r   r   r   )	r   r  r   r  r  r  r  r  r  )rW   r  r  rB  r  s        r\   test_protocols_isinstance_py36z,ProtocolTests.test_protocols_isinstance_py36  s&   	# 	#	 		 	 	fQ3/7fQlE2  E2fQlH5egu-hj%0aeU+  .  .  1  1  (3bAh1r^   c                     t        d      }t         G d dt                     }t         G d dt        |                } G d d      }| j                   |d      |       | j                   |d      |       y )	Nr   c                       e Zd ZdZy)7ProtocolTests.test_protocols_isinstance_init.<locals>.Prn   Nrz  rk   r^   r\   r  r  F  r  r^   r  c                       e Zd ZdZy)8ProtocolTests.test_protocols_isinstance_init.<locals>.PGrn   Nrz  rk   r^   r\   r"  r  J  r  r^   r"  c                       e Zd Zd Zy)7ProtocolTests.test_protocols_isinstance_init.<locals>.Cc                     || _         y rb   r   r   s     r\   r   z@ProtocolTests.test_protocols_isinstance_init.<locals>.C.__init__O  r   r^   Nr   rk   r^   r\   rB  r  N  r   r^   rB  rn   )r   r*   r'   r   )rW   r   r  r"  rB  s        r\   test_protocols_isinstance_initz,ProtocolTests.test_protocols_isinstance_initC  sw    CL		 	 
	 
	! 	 
		 	 	adA&adB'r^   c                     t          G d dt                     } G d d      } |       }| j                  ||       d|_        | j	                  ||       |`| j                  ||       y )Nc                       e Zd ZU eed<   y)DProtocolTests.test_protocols_isinstance_monkeypatching.<locals>.HasXr   Nr  rk   r^   r\   r  r  V  r  r^   r  c                       e Zd Zy)CProtocolTests.test_protocols_isinstance_monkeypatching.<locals>.FooNr|   rk   r^   r\   r   r  Z  r   r^   r   r   )r*   r'   r   r   r   )rW   r  r   rf   s       r\   (test_protocols_isinstance_monkeypatchingz6ProtocolTests.test_protocols_isinstance_monkeypatchingU  se    		8 	 
	 	E  D)a&C  D)r^   c                     G d dt         t                 } G d d|t                 } G d d      } G d d      }|t           }| j                   |       |       | j	                  ||        G d	 d
|t                 } G d d|t                 }|t
           }| j                   |       |       | j                  ||       y )Nc                       e Zd Zy)=ProtocolTests.test_protocol_checks_after_subscript.<locals>.PNr|   rk   r^   r\   r  r  d  r   r^   r  c                       e Zd Zy)=ProtocolTests.test_protocol_checks_after_subscript.<locals>.CNr|   rk   r^   r\   rB  r  e  r   r^   rB  c                       e Zd Zy)BProtocolTests.test_protocol_checks_after_subscript.<locals>.Other1Nr|   rk   r^   r\   Other1r  f  r   r^   r   c                       e Zd Zy)BProtocolTests.test_protocol_checks_after_subscript.<locals>.Other2Nr|   rk   r^   r\   Other2r  g  r   r^   r  c                       e Zd Zy)>ProtocolTests.test_protocol_checks_after_subscript.<locals>.D1Nr|   rk   r^   r\   D1r  m  r   r^   r  c                       e Zd Zy)>ProtocolTests.test_protocol_checks_after_subscript.<locals>.D2Nr|   rk   r^   r\   D2r  n  r   r^   r	  )r'   r   r   r   r`   r   r   r]   )	rW   r  rB  r   r  CAr  r	  CIs	            r\   $test_protocol_checks_after_subscriptz2ProtocolTests.test_protocol_checks_after_subscriptc  s    ""!sV  1-  +33sVbdA&b!$r^   c                    t          G d dt                     } G d dt              } G d d|      } G d d      }|j                  |       |j                  |       | j                   |       |       | j                   |       |       y )	Nc                       e Zd ZdZy)8ProtocolTests.test_protocols_support_register.<locals>.Prn   Nrz  rk   r^   r\   r  r  u  r  r^   r  c                       e Zd Zd Zy)9ProtocolTests.test_protocols_support_register.<locals>.PMc                      y rb   rk   r   s    r\   r  z>ProtocolTests.test_protocols_support_register.<locals>.PM.methz  r  r^   Nr  rk   r^   r\   PMr  y  r  r^   r  c                       e Zd Zy)8ProtocolTests.test_protocols_support_register.<locals>.DNr|   rk   r^   r\   rE  r  |  r   r^   rE  c                       e Zd Zy)8ProtocolTests.test_protocols_support_register.<locals>.CNr|   rk   r^   r\   rB  r  ~  r   r^   rB  )r*   r'   r  r   )rW   r  r  rE  rB  s        r\   test_protocols_support_registerz-ProtocolTests.test_protocols_support_registert  sp    		 	 
		! 	! 		

1	

1ac1%ac1%r^   c                     t          G d dt                     } G d d      } G d d|      } G d d      }| j                   |       |       | j                   |       |       y )	Nc                       e Zd ZdZy)NProtocolTests.test_none_on_non_callable_doesnt_block_implementation.<locals>.Prn   Nrz  rk   r^   r\   r  r    r  r^   r  c                       e Zd ZdZy)NProtocolTests.test_none_on_non_callable_doesnt_block_implementation.<locals>.Arn   Nrz  rk   r^   r\   r   r    r  r^   r   c                       e Zd ZdZy)NProtocolTests.test_none_on_non_callable_doesnt_block_implementation.<locals>.BNrz  rk   r^   r\   r   r        Ar^   r   c                       e Zd Zd Zy)NProtocolTests.test_none_on_non_callable_doesnt_block_implementation.<locals>.Cc                     d | _         y rb   r   r   s    r\   r   zWProtocolTests.test_none_on_non_callable_doesnt_block_implementation.<locals>.C.__init__  	    r^   Nr   rk   r^   r\   rB  r"        r^   rB  r  rW   r  r   r   rB  s        r\   5test_none_on_non_callable_doesnt_block_implementationzCProtocolTests.test_none_on_non_callable_doesnt_block_implementation  sa    		 	 
		 		 		 	 	ac1%ac1%r^   c                     t          G d dt                     } G d d      } G d d|      } G d d      }| j                   |       |       | j                   |       |       y )	Nc                       e Zd Zd Zy)DProtocolTests.test_none_on_callable_blocks_implementation.<locals>.Pc                      y rb   rk   r   s    r\   r   zFProtocolTests.test_none_on_callable_blocks_implementation.<locals>.P.x  ry  r^   Nrz  rk   r^   r\   r  r*    r{  r^   r  c                       e Zd Zd Zy)DProtocolTests.test_none_on_callable_blocks_implementation.<locals>.Ac                      y rb   rk   r   s    r\   r   zFProtocolTests.test_none_on_callable_blocks_implementation.<locals>.A.x  ry  r^   Nrz  rk   r^   r\   r   r-    r  r^   r   c                       e Zd ZdZy)DProtocolTests.test_none_on_callable_blocks_implementation.<locals>.BNrz  rk   r^   r\   r   r0    r   r^   r   c                       e Zd Zd Zy)DProtocolTests.test_none_on_callable_blocks_implementation.<locals>.Cc                     d | _         y rb   r   r   s    r\   r   zMProtocolTests.test_none_on_callable_blocks_implementation.<locals>.C.__init__  r$  r^   Nr   rk   r^   r\   rB  r2    r%  r^   rB  )r*   r'   r   r&  s        r\   +test_none_on_callable_blocks_implementationz9ProtocolTests.test_none_on_callable_blocks_implementation  sa    		 	 
		 		 		 	 	  a(  a(r^   c                     G d dt               }t         G d dt                      } G d d|      } G d d|      } G d	 d
t        j                        } G d dt        j                        }| j	                   |       |       | j	                   |       |       | j                  ||       | j                  ||       | j                   |       |       | j                  ||       | j                  dt        |             | j                  dt        |             | j                  dt        |             | j                  dt        |             h d}| j                  t        |      j                         t        |      j                         |z         | j                  t        |      j                         t        |      j                         |z         y )Nc                       e Zd ZdZy)5ProtocolTests.test_non_protocol_subclasses.<locals>.Prn   Nrz  rk   r^   r\   r  r7    r  r^   r  c                       e Zd Zd Zy)6ProtocolTests.test_non_protocol_subclasses.<locals>.PRc                      y rb   rk   r   s    r\   r  z;ProtocolTests.test_non_protocol_subclasses.<locals>.PR.meth  r  r^   Nr  rk   r^   r\   PRr9         r^   r;  c                       e Zd ZdZy)8ProtocolTests.test_non_protocol_subclasses.<locals>.NonPrn   Nrz  rk   r^   r\   NonPr>    r  r^   r?  c                       e Zd Zy)9ProtocolTests.test_non_protocol_subclasses.<locals>.NonPRNr|   rk   r^   r\   NonPRrA    r   r^   rB  c                       e Zd ZdZy)5ProtocolTests.test_non_protocol_subclasses.<locals>.Crn   Nrz  rk   r^   r\   rB  rD    r  r^   rB  r  c                       e Zd Zd Zy)5ProtocolTests.test_non_protocol_subclasses.<locals>.Dc                      y rb   rk   r   s    r\   r  z:ProtocolTests.test_non_protocol_subclasses.<locals>.D.meth  r  r^   Nr  rk   r^   r\   rE  rF    r  r^   rE  __protocol_attrs____non_callable_proto_members__>   r   _is_protocolr  r   __subclasshook___is_runtime_protocol)r'   r*   r  ABCMetar   r`   r   r]   assertNotInvarsassertLessEqualkeys)rW   r  r;  r?  rB  rB  rE  acceptable_extra_attrss           r\   test_non_protocol_subclassesz*ProtocolTests.test_non_protocol_subclasses  s   	 	 
	! 	! 
	!	1 	 	B	#++ 		!#++ 	! 	  d+  e,  D)  E*egr*eR(-tDz:-tE{;94:F94;G"
 	T$Z__.QAW0WXKQ1G G	
r^   c                     G d dt               } G d d      } G d d      } G d d|      }| j                   |       |       | j                   |       |       | j                  ||       | j	                  ||       y )	Nc                       e Zd ZdZy)1ProtocolTests.test_custom_subclasshook.<locals>.Prn   Nrz  rk   r^   r\   r  rV    r  r^   r  c                       e Zd Zy)7ProtocolTests.test_custom_subclasshook.<locals>.OKClassNr|   rk   r^   r\   OKClassrX    r   r^   rY  c                       e Zd ZdZy)8ProtocolTests.test_custom_subclasshook.<locals>.BadClassrn   Nrz  rk   r^   r\   BadClassr[    r  r^   r\  c                       e Zd Zed        Zy)1ProtocolTests.test_custom_subclasshook.<locals>.Cc                 8    |j                   j                  d      S NOK)rh   r  rX   others     r\   rK  zBProtocolTests.test_custom_subclasshook.<locals>.C.__subclasshook__  s    ~~0066r^   Nrh   ri   rj   classmethodrK  rk   r^   r\   rB  r^    s    7 7r^   rB  )r'   r   r   r]   r`   )rW   r  rY  r\  rB  s        r\   test_custom_subclasshookz&ProtocolTests.test_custom_subclasshook  sr    	 	 		 		7 	7
 	gi+  Q/gq)  1-r^   c                    t          G d dt                     } G d d      } G d d      }| j                   |       |       | j                   |       |       | j	                  ||       | j                  ||        G d dt              }d	}| j                  t        |      5  t        t        |       d d d        | j                  t        |      5  t        t               |       d d d        y # 1 sw Y   =xY w# 1 sw Y   y xY w)
Nc                        e Zd ZdZed        Zy)6ProtocolTests.test_custom_subclasshook_2.<locals>.HasXrn   c                     t        |d      S r  hasattrrb  s     r\   rK  zGProtocolTests.test_custom_subclasshook_2.<locals>.HasX.__subclasshook__      uc**r^   N)rh   ri   rj   r   re  rK  rk   r^   r\   r  ri    s    
 A+ +r^   r  c                       e Zd Zy)7ProtocolTests.test_custom_subclasshook_2.<locals>.EmptyNr|   rk   r^   r\   r  ro    r   r^   r  c                       e Zd ZdZy)@ProtocolTests.test_custom_subclasshook_2.<locals>.ImplementsHasXrn   Nrz  rk   r^   r\   ImplementsHasXrq    r  r^   rr  c                       e Zd Zed        Zy)EProtocolTests.test_custom_subclasshook_2.<locals>.NotRuntimeCheckablec                     t        |d      S r  rk  rb  s     r\   rK  zVProtocolTests.test_custom_subclasshook_2.<locals>.NotRuntimeCheckable.__subclasshook__  rm  r^   Nrd  rk   r^   r\   NotRuntimeCheckablert    s    + +r^   rv  r  )r*   r'   r   r   r]   r`   r   r   rT   r  r   )rW   r  r  rr  rv  must_be_runtime_checkables         r\   test_custom_subclasshook_2z(ProtocolTests.test_custom_subclasshook_2  s    		+8 	+ 
	+ 		 	 	n.5  $/nd3  -
	+( 	+0 	"
 ##I/HI 	4v23	4##I/HI 	6vx!45	6 	6	4 	4	6 	6s   &C3C?3C<?Dc                     t          G d dt                     } G d d      }| j                  t        d      5  t	         |       |       d d d        y # 1 sw Y   y xY w)Nc                       e Zd ZdZy)8ProtocolTests.test_issubclass_fails_correctly.<locals>.Prn   Nrz  rk   r^   r\   r  r{    r  r^   r  c                       e Zd Zy)8ProtocolTests.test_issubclass_fails_correctly.<locals>.CNr|   rk   r^   r\   rB  r}    r   r^   rB  r  )r*   r'   r   r   rT   rW   r  rB  s      r\   test_issubclass_fails_correctlyz-ProtocolTests.test_issubclass_fails_correctly  sT    		 	 
	 	##I/VW 	qsA	 	 	s   AAc                    t        d      }t        d      }t         G d dt        ||f                } G d d|t        |f   t        |         }| j	                  t
              5  |t            d d d        | j	                  t
              5  |t        t        f    d d d         G d d|t        |f         }| j                   |t                  |       y # 1 sw Y   ixY w# 1 sw Y   HxY w)	Nr   Sc                       e Zd Zd Zy)9ProtocolTests.test_defining_generic_protocols.<locals>.PRc                      y rb   rk   r   s    r\   r  z>ProtocolTests.test_defining_generic_protocols.<locals>.PR.meth  r  r^   Nr  rk   r^   r\   r;  r    r<  r^   r;  c                       e Zd ZdZy)8ProtocolTests.test_defining_generic_protocols.<locals>.Prn   Nrh   ri   rj   r   rk   r^   r\   r  r    r  r^   r  c                       e Zd Zy)8ProtocolTests.test_defining_generic_protocols.<locals>.CNr|   rk   r^   r\   rB  r  &  r   r^   rB  )r   r*   r'   r   r   r   r   r   )rW   r   r  r;  r  rB  s         r\   test_defining_generic_protocolsz-ProtocolTests.test_defining_generic_protocols  s    CLCL		!!Q$ 	! 
	!	36
HQK 	 y) 	sG	y) 	c3hK	 	"36
!fafh*	 		 	s   %
CC#C #C,c           	         t        d      t        d      }t         G d dt        t        |f                } G d d|t        t
        f   t              }| j                  t              5  t        |t        t
        f   |       d d d        | j                  ||       | j                  t              5  |t            d d d         G fddt        t                 } G fd	d
t           t              }t         G d d|t
           t                     } G d d      }| j                   |       |       y # 1 sw Y   xY w# 1 sw Y   xY w)Nr   r  c                       e Zd Zd Zy)CProtocolTests.test_defining_generic_protocols_old_style.<locals>.PRc                      y rb   rk   r   s    r\   r  zHProtocolTests.test_defining_generic_protocols_old_style.<locals>.PR.meth0  r  r^   Nr  rk   r^   r\   r;  r  .  r<  r^   r;  c                       e Zd ZdZy)BProtocolTests.test_defining_generic_protocols_old_style.<locals>.Prn   Nr  rk   r^   r\   r  r  2  r  r^   r  c                        e Zd ZdW  defdZy)CProtocolTests.test_defining_generic_protocols_old_style.<locals>.P1r   r   c                      y rb   rk   r   s     r\   r*  zGProtocolTests.test_defining_generic_protocols_old_style.<locals>.P1.bar<      r^   Nrh   ri   rj   r   r*  rt  s   r\   rM  r  ;      +Q+3+r^   rM  c                        e Zd ZdW  defdZy)CProtocolTests.test_defining_generic_protocols_old_style.<locals>.P2r   r   c                      y rb   rk   r   s     r\   r*  zGProtocolTests.test_defining_generic_protocols_old_style.<locals>.P2.bar?  r  r^   Nr  rt  s   r\   r8  r  >  r  r^   r8  c                       e Zd ZdZy)EProtocolTests.test_defining_generic_protocols_old_style.<locals>.PSubrn   Nrz  rk   r^   r\   PSubr  A  r  r^   r  c                        e Zd ZdZdedefdZy)EProtocolTests.test_defining_generic_protocols_old_style.<locals>.Testrn   r   r   c                     |S rb   rk   r   s     r\   r*  zIProtocolTests.test_defining_generic_protocols_old_style.<locals>.Test.barH  s    r^   N)rh   ri   rj   r   r   r*  rk   r^   r\   Testr  E  s    AS S r^   r  )r   r*   r'   r#   r   r   r   r   rT   r]   r   )	rW   r  r;  r  rM  r8  r  r  r   s	           @r\   )test_defining_generic_protocols_old_stylez7ProtocolTests.test_defining_generic_protocols_old_style*  s"   CLCL		!71a4= 	! 
	!	38h 	 y) 	)r#s(|R(	)a$y) 	sG		,71: 	,	,X 	, 
	2c7H 	 
		 	 	dfd+-	) 	)	 	s   ,D;5
E;EEc                     t          d               } d        }| j                   |       |       | j                  ||       t          d               }| j                  d|       | j                  t        |       y )Nc                  >    d xf G fdd
} t         |       S )r   c                   &    e Zd ZW  ZdW ddfdZy)HProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.Foor   r   Nc                      y rb   rk   r   s     r\   r  zMProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.Foo.methP  rl  r^   r  r  s   r\   r   r  N  s    -a-D-r^   r   r  r  s    @@r\   z<generic parameters of Foo>z`ProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.<generic parameters of Foo>N  s     	. 	.X 	.r^   c                  4    d xf G fdd
} |       S )r   c                   &    e Zd ZW  ZdW ddfdZy)HProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.Barr   r   Nc                      y rb   rk   r   s     r\   r  zMProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.Bar.methS  rl  r^   r  r  s   r\   r   r  R  s    -a-D-r^   r   rk   r  s    @@r\   z<generic parameters of Bar>z`ProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.<generic parameters of Bar>R  s    ! 	. 	. 	.r^   c                  >    d xf G fdd
} t         |       S )r   c                   "    e Zd ZW  ZdW fdZy)RProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.SupportsTruncr   c                      y rb   rk   r   s    r\   	__trunc__z\ProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.SupportsTrunc.__trunc__Z      cr^   N)rh   ri   rj   rv  r  r  s   r\   SupportsTruncr  X  s    )1)r^   r  r  r  s    @@r\   z%<generic parameters of SupportsTrunc>zjProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.<generic parameters of SupportsTrunc>X  s     	* 	*x 	*r^   g        )r*   r   r]   r{  )rW   r   r   r  s       r\   -test_pep695_generic_protocol_callable_membersz;ProtocolTests.test_pep695_generic_protocol_callable_membersM  sq    		. 
	.	. 	ceS)c3'		* 
	* 	c=1e]3r^   c                    t        d      } G d dt        |         } G d d||         }| j                   |t                  j                  d        G d d      } G d	 d
|||         }| j                   |t                  j                  d        G d d||   |      }| j                   |t                  j                  d       y )Nr   c                       e Zd Zy))ProtocolTests.test_init_called.<locals>.PNr|   rk   r^   r\   r  r  b  r   r^   r  c                       e Zd Zd Zy))ProtocolTests.test_init_called.<locals>.Cc                     d| _         y r`  testr   s    r\   r   z2ProtocolTests.test_init_called.<locals>.C.__init__e  r  r^   Nr   rk   r^   r\   rB  r  d      !r^   rB  ra  c                       e Zd Zd Zy))ProtocolTests.test_init_called.<locals>.Bc                     d| _         y r`  r  r   s    r\   r   z2ProtocolTests.test_init_called.<locals>.B.__init__k  r  r^   Nr   rk   r^   r\   r   r  j  r  r^   r   c                       e Zd Zy)*ProtocolTests.test_init_called.<locals>.D1Nr|   rk   r^   r\   r  r  n  r  r^   r  c                       e Zd Zy)*ProtocolTests.test_init_called.<locals>.D2Nr|   rk   r^   r\   r	  r  s  r  r^   r	  )r   r'   r   r   r  )rW   r   r  rB  r   r  r	  s          r\   test_init_calledzProtocolTests.test_init_called_  s    CL""	!! 	! 	3-	! 	!	AaD 	 	C.	1q 	 	C.r^   c                    t        d      } G d dt        |         } G d d||         }| j                   |t                  j                  d       | j                  t              5   |t           d       d d d        | j                  t              5   |t           d       d d d        y # 1 sw Y   8xY w# 1 sw Y   y xY w)	Nr   c                       e Zd Zy)(ProtocolTests.test_new_called.<locals>.PNr|   rk   r^   r\   r  r  {  r   r^   r  c                        e Zd Z fdZ xZS )(ProtocolTests.test_new_called.<locals>.Cc                 6    t        |   | g| }d|_        |S r`  )r   __new__r  )rX   r   rW   r   s      r\   r  z0ProtocolTests.test_new_called.<locals>.C.__new__~  s"    ws2T2 	r^   rh   ri   rj   r  r   r   s   @r\   rB  r  }  s     r^   rB  ra  r   r  )r   r'   r   r   r  r   r   )rW   r   r  rB  s       r\   test_new_calledzProtocolTests.test_new_calledx  s    CL""	! 	 	3-y) 	AcF2J	y) 	AcFRL	 		 		 	s   )B0B<0B9<Cc                 T   t        d      }t        d      }| j                  t              5   G d dt        ||f         }d d d        | j                  t              5   G d dt        t                 }d d d        | j                  t              5   G d dt        |   t        |         }d d d        | j                  t              5   G d	 dt
        j                  ||f   t        |         }d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   fxY w# 1 sw Y   y xY w)
Nr   r  c                       e Zd Zy)6ProtocolTests.test_protocols_bad_subscripts.<locals>.PNr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zy)6ProtocolTests.test_protocols_bad_subscripts.<locals>.QNr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zy)6ProtocolTests.test_protocols_bad_subscripts.<locals>.RNr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zy)6ProtocolTests.test_protocols_bad_subscripts.<locals>.SNr|   rk   r^   r\   r  r    r   r^   )r   r   r   r'   r   rc   r  )rW   r   r  r  r  r  s         r\   test_protocols_bad_subscriptsz+ProtocolTests.test_protocols_bad_subscripts  s    CLCLy) 	*)HQTN)	*y) 	)(HSM(	)y) 	43HQK!3	4y) 	=<FNN1a4((1+<	= 	=	* 	*	) 	)	4 	4	= 	=s/   C:DD
'D:DDDD'c                     t        d      }t        d      } G d dt        ||f         }| j                  t        |||f         j	                  d             | j                  t        |t
        t        f         j	                  d             y )Nr   r  c                       e Zd Zy)4ProtocolTests.test_generic_protocols_repr.<locals>.PNr|   rk   r^   r\   r  r    r   r^   r  z	P[~T, ~S]zP[int, str])r   r'   r   r   r  r   r   rW   r   r  r  s       r\   test_generic_protocols_reprz)ProtocolTests.test_generic_protocols_repr  sk    CLCL%A%Qq!tW..{;<QsCx[)22=ABr^   c                 r   t        d      }t        d      } G d dt        ||f         }| j                  ||       | j                  |t        |f   |t        |f          | j                  |||f   t        ||f      t        t
        f   |t        t        t
        f   t        t        t
        f   f          y )Nr   r  c                       e Zd Zy)2ProtocolTests.test_generic_protocols_eq.<locals>.PNr|   rk   r^   r\   r  r    r   r^   r  )r   r'   r   r   r   r   r  s       r\   test_generic_protocols_eqz'ProtocolTests.test_generic_protocols_eq  s    CLCL%A%A36Ac1fI.1a4q!t-c3h75c?E#s(O;<	>r^   c                 T   t        d      } G d dt        |         }| j                  |j                  |f       | j                  |t           j                  d       | j                  |t           j
                  t        f       | j                  |t           j                  |       y )Nr   c                       e Zd Zy)DProtocolTests.test_generic_protocols_special_from_generic.<locals>.PNr|   rk   r^   r\   r  r    r   r^   r  rk   )r   r'   r   r  r   r  r   r  )rW   r   r  s      r\   +test_generic_protocols_special_from_genericz9ProtocolTests.test_generic_protocols_special_from_generic  s{    CL""))A403..333&1af''+r^   c                    t          G d dt                     } G d dt              }t        d      } G d dt        |         }| j                  |j                         | j                  |j                         | j                  |j                         | j                  |j                         | j                  |j                         | j                  |t           j                         | j                  t        j                  |      dh       | j                  t        j                  |      d	h       | j                  t        t        j                  |            t        d	dh             y )
Nc                       e Zd ZdZy)FProtocolTests.test_generic_protocols_special_from_protocol.<locals>.PRrn   Nrz  rk   r^   r\   r;  r    r  r^   r;  c                       e Zd Zd Zy)EProtocolTests.test_generic_protocols_special_from_protocol.<locals>.Pc                      y rb   rk   r   s    r\   r  zJProtocolTests.test_generic_protocols_special_from_protocol.<locals>.P.meth  r  r^   Nr  rk   r^   r\   r  r    r  r^   r  r   c                       e Zd ZdZd Zy)FProtocolTests.test_generic_protocols_special_from_protocol.<locals>.PGrn   c                      y rb   rk   r   s    r\   r  zKProtocolTests.test_generic_protocols_special_from_protocol.<locals>.PG.meth  r  r^   N)rh   ri   rj   r   r  rk   r^   r\   r"  r    s    Ar^   r"  r  r   )r*   r'   r   r   rJ  r   rL  r   r   rc   _get_protocol_attrs	frozenset)rW   r;  r  r   r"  s        r\   ,test_generic_protocols_special_from_protocolz:ProtocolTests.test_generic_protocols_special_from_protocol  s   		 	 
		 	 CL	! 	 	'((//0//03,,-33A6A33B7#?6#=#=b#AB"C=1	3r^   c                    | j                  t              5  t         G d d             }d d d         G d dt              }| j                  t              5  t         G d d|             }d d d        y # 1 sw Y   KxY w# 1 sw Y   y xY w)Nc                       e Zd Zy)8ProtocolTests.test_no_runtime_deco_on_nominal.<locals>.CNr|   rk   r^   r\   rB  r    s    r^   rB  c                       e Zd ZdZy)<ProtocolTests.test_no_runtime_deco_on_nominal.<locals>.Protorn   Nrz  rk   r^   r\   r  r    r  r^   r  c                       e Zd Zy)?ProtocolTests.test_no_runtime_deco_on_nominal.<locals>.ConcreteNr|   rk   r^   r\   r  r    s    r^   r  )r   r   r*   r'   )rW   rB  r  r  s       r\   test_no_runtime_deco_on_nominalz-ProtocolTests.test_no_runtime_deco_on_nominal  s    y) 	M 		H 	 y) 	5  	 		 		 	s   A4B 4A= B	c                    t          G d dt                     } G d dt              }| j                   |       |        G d d      } G d d      }| j	                   |       |       | j	                   |       |        G d	 d
      } G d d      }| j	                   |       |       | j	                   |       |       y )Nc                       e Zd ZdZy)4ProtocolTests.test_none_treated_correctly.<locals>.PNrz  rk   r^   r\   r  r    s    Ar^   r  c                       e Zd Zy)4ProtocolTests.test_none_treated_correctly.<locals>.BNr|   rk   r^   r\   r   r    r   r^   r   c                       e Zd ZdZy)4ProtocolTests.test_none_treated_correctly.<locals>.Crn   Nrz  rk   r^   r\   rB  r    r  r^   rB  c                       e Zd ZdZy)4ProtocolTests.test_none_treated_correctly.<locals>.DNrz  rk   r^   r\   rE  r     r   r^   rE  c                       e Zd Zd Zy)5ProtocolTests.test_none_treated_correctly.<locals>.CIc                     d| _         y rK  r   r   s    r\   r   z>ProtocolTests.test_none_treated_correctly.<locals>.CI.__init__  r   r^   Nr   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zd Zy)5ProtocolTests.test_none_treated_correctly.<locals>.DIc                     d | _         y rb   r   r   s    r\   r   z>ProtocolTests.test_none_treated_correctly.<locals>.DI.__init__  r$  r^   Nr   rk   r^   r\   DIr    r%  r^   r  )r*   r'   r  r   r   )rW   r  r   rB  rE  r  r  s          r\   test_none_treated_correctlyz)ProtocolTests.test_none_treated_correctly  s    		 	 
	 	  a(	 		 	 	ac1%ac1%	 		 	 	bdA&bdA&r^   c                      G d dt               }t        j                  t        j                  |f   }t        j                  |t        j                  f   }| j	                  ||       y )Nc                       e Zd ZdZy)1ProtocolTests.test_protocols_in_unions.<locals>.PNrz  rk   r^   r\   r  r    r   r^   r  )r'   rc   r   r  r   )rW   r  AliasAlias2s       r\   test_protocols_in_unionsz&ProtocolTests.test_protocols_in_unions  sN    	 	 V__a/0a01'r^   c                    t        d      }t         G d dt        |                a G d dt        t                 at               }d|_        d|_        t        t        j                  dz         D ]  }t        j                  ||      }t        j                  |      }| j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  ddd	       t        j                  t        |      }t        j                  |      } G d
 d      }| j!                   |       |        y )Nr   c                       e Zd ZdZy)r  rn   Nrz  rk   r^   r\   r  r    r  r^   r  c                       e Zd Zy)CPNr|   rk   r^   r\   r  r  	  r  r^   r  r   r  rn   r\  c                       e Zd ZdZy)2ProtocolTests.test_protocols_pickleable.<locals>.Ern   Nrz  rk   r^   r\   r  r    s    r^   r  )r   r*   r'   r  r   r  rk  r*  rr   rs   rt   rv  ru  r   r   __dict__r   )	rW   r   r  rq   rQ  r   r   rE  r  s	            r\   test_protocols_pickleablez'ProtocolTests.test_protocols_pickleable  s   CL		 	 
		3 	 D622Q67 	*EQ&AQAQUUB'QUUE*QSS!$QZZE)BCQ&AQA  !!!#q)	*r^   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rb   )r]   r   rc   SupportsIntr`   r   r   s    r\   test_supports_intzProtocolTests.test_supports_int  s.    c6#5#56  f&8&89r^   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rb   )r]   r{  rc   SupportsFloatr`   r   r   s    r\   test_supports_floatz!ProtocolTests.test_supports_float"  s.    eV%9%9:  f&:&:;r^   c                      G d d      }| j                  t        t        j                         | j                  |t        j                         | j	                  t
        t        j                         y )Nc                       e Zd Zd Zy).ProtocolTests.test_supports_complex.<locals>.Cc                      y)Ny                rk   r   s    r\   __complex__z:ProtocolTests.test_supports_complex.<locals>.C.__complex__)  rE  r^   N)rh   ri   rj   r!  rk   r^   r\   rB  r  (  s    r^   rB  )r]   complexrc   SupportsComplexr`   r   rW   rB  s     r\   test_supports_complexz#ProtocolTests.test_supports_complex&  sP    	 	 	gv'='=>a!7!78  f&<&<=r^   c                      G d d      }| j                  t        t        j                         | j                  |t        j                         | j	                  t
        t        j                         y )Nc                       e Zd Zd Zy),ProtocolTests.test_supports_bytes.<locals>.Bc                      yNr^   rk   r   s    r\   	__bytes__z6ProtocolTests.test_supports_bytes.<locals>.B.__bytes__3  s    r^   N)rh   ri   rj   r+  rk   r^   r\   r   r(  2  r   r^   r   )r]   r  rc   SupportsBytesr`   r   )rW   r   s     r\   test_supports_bytesz!ProtocolTests.test_supports_bytes0  sP    	 	 	eV%9%9:a!5!56  f&:&:;r^   c                     | j                  t        t        j                         | j                  t        t        j                         | j                  t        t        j                         y rb   )r]   r{  rc   SupportsAbsr   r`   r   r   s    r\   test_supports_abszProtocolTests.test_supports_abs:  sD    eV%7%78c6#5#56  f&8&89r^   c                    t        t        t        j                         | j	                  t        t        j                         | j	                  t
        t        j                         | j                  t        t        j                         y rb   )rT   r{  rc   SupportsRoundr]   r   r`   r   r   s    r\   test_supports_roundz!ProtocolTests.test_supports_round?  sT    5&../eV%9%9:c6#7#78  f&:&:;r^   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rb   )r]   r  rc   
Reversibler`   r   r   s    r\   test_reversiblezProtocolTests.test_reversibleE  s.    dF$5$56  f&7&78r^   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rb   )r]   r   rc   SupportsIndexr`   r   r   s    r\   test_supports_indexz!ProtocolTests.test_supports_indexI  s.    c6#7#78  f&:&:;r^   c                     | j                  dt        j                          G d dt        j                        } G d d|      } |       }| j                  ||       y )Nr   c                       e Zd ZdefdZy)>ProtocolTests.test_bundled_protocol_instance_works.<locals>.C1r   c                      yr   rk   r   s    r\   __int__zFProtocolTests.test_bundled_protocol_instance_works.<locals>.C1.__int__P  rE  r^   N)rh   ri   rj   r   r>  rk   r^   r\   r&  r<  O  s     r^   r&  c                       e Zd Zy)>ProtocolTests.test_bundled_protocol_instance_works.<locals>.C2Nr|   rk   r^   r\   r'  r@  R  r  r^   r'  )r   rc   r/  r  )rW   r&  r'  r  s       r\   $test_bundled_protocol_instance_worksz2ProtocolTests.test_bundled_protocol_instance_worksM  sM    a!3!34	## 		 	Da$r^   c                    t          G d dt        j                  j                  t                     } G d d      } G d d      }| j                  ||       | j                  ||       t          G d dt        j                  j                  t                     } G d	 d
      } G d d      }| j                  ||       | j                   |       |       | j                  ||       | j                   |       |       y )Nc                       e Zd Zd Zy)@ProtocolTests.test_collections_protocols_allowed.<locals>.Customc                      y rb   rk   r   s    r\   closezFProtocolTests.test_collections_protocols_allowed.<locals>.Custom.closeZ  r  r^   N)rh   ri   rj   rF  rk   r^   r\   CustomrD  X  r<  r^   rG  c                       e Zd Zy);ProtocolTests.test_collections_protocols_allowed.<locals>.ANr|   rk   r^   r\   r   rI  \  r   r^   r   c                       e Zd Zd Zd Zy);ProtocolTests.test_collections_protocols_allowed.<locals>.Bc                     g S rb   rk   r   s    r\   __iter__zDProtocolTests.test_collections_protocols_allowed.<locals>.B.__iter__^  r  r^   c                      yrb  rk   r   s    r\   rF  zAProtocolTests.test_collections_protocols_allowed.<locals>.B.close`  r  r^   N)rh   ri   rj   rM  rF  rk   r^   r\   r   rK  ]  s    r^   r   c                       e Zd ZdeddfdZy)JProtocolTests.test_collections_protocols_allowed.<locals>.ReleasableBuffermvr   Nc                      y rb   rk   rW   rQ  s     r\   __release_buffer__z]ProtocolTests.test_collections_protocols_allowed.<locals>.ReleasableBuffer.__release_buffer__h  s    #r^   )rh   ri   rj   
memoryviewrT  rk   r^   r\   ReleasableBufferrP  f  s    EZEDEr^   rV  c                       e Zd Zy);ProtocolTests.test_collections_protocols_allowed.<locals>.CNr|   rk   r^   r\   rB  rX  j  r   r^   rB  c                   ,    e Zd ZdedefdZdeddfdZy);ProtocolTests.test_collections_protocols_allowed.<locals>.Dflagsr   c                     t        d      S r*  )rU  )rW   r[  s     r\   
__buffer__zFProtocolTests.test_collections_protocols_allowed.<locals>.D.__buffer__l  s    !#&r^   rQ  Nc                      y rb   rk   rS  s     r\   rT  zNProtocolTests.test_collections_protocols_allowed.<locals>.D.__release_buffer__n  r  r^   )rh   ri   rj   r   rU  r]  rT  rk   r^   r\   rE  rZ  k  s(    ' '
 'Z D r^   rE  )
r*   r  r  r  r'   r]   r`   Bufferr   r   )rW   rG  r   r   rV  rB  rE  s          r\   "test_collections_protocols_allowedz0ProtocolTests.test_collections_protocols_allowedW  s    		![__--x 	! 
	! 		 	 	a(  F+		F{55x 	F 
	F 		 	 	a!12ac#34  $45  &67r^   c                     | j                  t              5   G d dt        t              }d d d         G d dt        j
                  t              }y # 1 sw Y   (xY w)Nc                       e Zd Zy)EProtocolTests.test_builtin_protocol_allowlist.<locals>.CustomProtocolNr|   rk   r^   r\   CustomProtocolrc  x  r   r^   rd  c                       e Zd Zy)KProtocolTests.test_builtin_protocol_allowlist.<locals>.CustomContextManagerNr|   rk   r^   r\   CustomContextManagerrf  {  r  r^   rg  )r   r   r   r'   rc   ContextManager)rW   rd  rg  s      r\   test_builtin_protocol_allowlistz-ProtocolTests.test_builtin_protocol_allowlistv  sG    y) 	8 		6#8#8( 			 	s   AAc                      G d dt               }| j                  t        d      5  t        d|       d d d        y # 1 sw Y   y xY w)Nc                       e Zd ZU eed<   y)CProtocolTests.test_non_runtime_protocol_isinstance_check.<locals>.Pr   Nr  rk   r^   r\   r  rl        Fr^   r  z@runtime_checkablern   )r'   r   r   r   rW   r  s     r\   *test_non_runtime_protocol_isinstance_checkz8ProtocolTests.test_non_runtime_protocol_isinstance_check~  s@    	 	 ##I/CD 	q!	 	 	s	   <Ac                 F     G d dt               } G d d|      } |        y )Nc                       e Zd ZU eed<   y)-ProtocolTests.test_super_call_init.<locals>.Pr   Nr  rk   r^   r\   r  rr    rm  r^   r  c                        e Zd Z fdZ xZS )/ProtocolTests.test_super_call_init.<locals>.Fooc                 "    t         |           y rb   )r   r   )rW   r   s    r\   r   z8ProtocolTests.test_super_call_init.<locals>.Foo.__init__  s     "r^   r   r   s   @r\   r   rt    s    # #r^   r   r  )rW   r  r   s      r\   test_super_call_initz"ProtocolTests.test_super_call_init  s!    	 		#! 	# 	r^   c                     t         j                  j                  j                           G d dt         j                  j                  t              }| j                  dt         j                  j                         y )Nc                       e Zd Zy)_ProtocolTests.test_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta.<locals>.FooNr|   rk   r^   r\   r   ry    r   r^   r   rn   )r  r  Sized_abc_registry_clearr'   r   r  s     r\   Dtest_interaction_with_isinstance_checks_on_superclasses_with_ABCMetazRProtocolTests.test_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta  sH    1138+//''8
 	  KOO$9$9:r^   c                     t         j                  j                  j                           G d dt        j                  t
              }| j                  dt        j                         y )Nc                       e Zd Zy)aProtocolTests.test_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta_2.<locals>.FooNr|   rk   r^   r\   r   r    r   r^   r   rn   )r  r  rz  r{  rc   r'   r   r  s     r\   Ftest_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta_2zTProtocolTests.test_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta_2  s<    113/&,,/
 	  FLL1r^   c                     t         t         G d dt                            }| j                  t        |       | j                  t	               |       y )Nc                       e Zd Zy)MProtocolTests.test_empty_protocol_decorated_with_final.<locals>.EmptyProtocolNr|   rk   r^   r\   r  r    s    '*r^   r  )r&   r*   r'   r]   r  r   )rW   r  s     r\   (test_empty_protocol_decorated_with_finalz6ProtocolTests.test_empty_protocol_decorated_with_final  s?    		*H* 
 
*fm4fh6r^   c                     t         t         G d dt                            }| j                  t        |       | j                  t        |       | j                  d|       | j                  d|       y )Nc                       e Zd ZdedefdZy)]ProtocolTests.test_protocol_decorated_with_final_callable_members.<locals>.ProtocolWithMethodr  r   c                      y rb   rk   )rW   r  s     r\   r  zhProtocolTests.test_protocol_decorated_with_final_callable_members.<locals>.ProtocolWithMethod.startswith  s    sr^   Nr  rk   r^   r\   ProtocolWithMethodr    s     ;::r^   r  rk  r   )	r&   r*   r'   r]   r   r`   r   r   r   )rW   r  s     r\   3test_protocol_decorated_with_final_callable_memberszAProtocolTests.test_protocol_decorated_with_final_callable_members  si    			; 	; 
 
	; 	c#56  &89e%78  %78r^   c                    t         t         G d dt                            } G d d      }d}| j                  t        |      5  t        ||       d d d        | j                  t        |      5  t        t        |       d d d        | j                   |       |       | j                  d|       y # 1 sw Y   bxY w# 1 sw Y   ?xY w)Nc                       e Zd ZU eed<   y)kProtocolTests.test_protocol_decorated_with_final_noncallable_members.<locals>.ProtocolWithNonCallableMemberr   Nr  rk   r^   r\   ProtocolWithNonCallableMemberr    s	     Fr^   r  c                       e Zd ZdZy)QProtocolTests.test_protocol_decorated_with_final_noncallable_members.<locals>.Foor   Nrz  rk   r^   r\   r   r    s    Ar^   r   r  r   	r&   r*   r'   r   r   rT   r   r   r   )rW   r  r   only_callable_members_pleases       r\   6test_protocol_decorated_with_final_noncallable_memberszDProtocolTests.test_protocol_decorated_with_final_noncallable_members  s    			H 	 
 
		 	 L 	% ##I/KL 	;s9:	; ##I/KL 	;s9:	; 	ce%BC  %BC	; 	;	; 	;   B2/B>2B;>Cc                    t         t         G d dt                            } G d d      }d}| j                  t        |      5  t        ||       d d d        | j                  t        |      5  t        t        |       d d d        | j                   |       |       | j                  d|       y # 1 sw Y   bxY w# 1 sw Y   ?xY w)Nc                        e Zd ZU eed<   ddZy)`ProtocolTests.test_protocol_decorated_with_final_mixed_members.<locals>.ProtocolWithMixedMembersr   Nc                      y rb   rk   r   s    r\   r  zgProtocolTests.test_protocol_decorated_with_final_mixed_members.<locals>.ProtocolWithMixedMembers.method  r  r^   r  )rh   ri   rj   r   r   r  rk   r^   r\   ProtocolWithMixedMembersr    s     F)r^   r  c                       e Zd ZdZddZy)KProtocolTests.test_protocol_decorated_with_final_mixed_members.<locals>.Foor   Nc                      y rb   rk   r   s    r\   r  zRProtocolTests.test_protocol_decorated_with_final_mixed_members.<locals>.Foo.method  r  r^   r  )rh   ri   rj   r   r  rk   r^   r\   r   r    s
    A)r^   r   r  r   r  )rW   r  r   r  s       r\   0test_protocol_decorated_with_final_mixed_membersz>ProtocolTests.test_protocol_decorated_with_final_mixed_members  s    			*x 	* 
 
	*	* 	*
 L 	% ##I/KL 	6s45	6 ##I/KL 	6s45	6 	ce%=>  %=>	6 	6	6 	6r  c                 v     G d d       G fddt               }| j                  |j                  dh       y )Nc                       e Zd Zd Zy)aProtocolTests.test_nonruntime_protocol_interaction_with_evil_classproperty.<locals>.classpropertyc                     t        d      r  r  )rW   instancer   s      r\   rX  ziProtocolTests.test_nonruntime_protocol_interaction_with_evil_classproperty.<locals>.classproperty.__get__  r  r^   NrY  rk   r^   r\   classpropertyr    rG  r^   r  c                       e Zd Z W         Zy)_ProtocolTests.test_nonruntime_protocol_interaction_with_evil_classproperty.<locals>.CommentableNrh   ri   rj   evilr  s   r\   Commentabler    s
     ?Dr^   r  r  )r'   r   rH  )rW   r  r  s     @r\   <test_nonruntime_protocol_interaction_with_evil_classpropertyzJProtocolTests.test_nonruntime_protocol_interaction_with_evil_classproperty  s3    	) 	)	#( 	# 	77&Br^   c                 f    G d dt                G fdd      | j                  t              5 }t         G fddt                     }d d d        j
                  }| j                  |j                  d   d       | j                  t        |j                               y # 1 sw Y   ZxY w)	Nc                       e Zd Zy)\ProtocolTests.test_runtime_protocol_interaction_with_evil_classproperty.<locals>.CustomErrorNr|   rk   r^   r\   CustomErrorr    r   r^   r  c                       e Zd Z fdZy)^ProtocolTests.test_runtime_protocol_interaction_with_evil_classproperty.<locals>.classpropertyc                     rb   rk   )rW   r  r   r  s      r\   rX  zfProtocolTests.test_runtime_protocol_interaction_with_evil_classproperty.<locals>.classproperty.__get__  s	    !!r^   NrY  )r  s   r\   r  r    s    "r^   r  c                       e Zd Z W         Zy)\ProtocolTests.test_runtime_protocol_interaction_with_evil_classproperty.<locals>.CommentableNr  r  s   r\   r  r    s
    $r^   r  r   zEFailed to determine whether protocol member 'evil' is a method member)	Exceptionr   r   r*   r'   r  r   r   r   r   	__cause__)rW   r!  r  excr  r  s       @@r\   9test_runtime_protocol_interaction_with_evil_classpropertyzGProtocolTests.test_runtime_protocol_interaction_with_evil_classproperty  s    *)*	" 	" y) 	'R'h ' '	'
 llHHQKS	
 	d3==);7	' 	's   B''B0N)Lrh   ri   rj   r  r  r  r  r  r  r  r&  r0  r7  rF  r`  rt  r  r  r  r  r  r  r
  r  r   rJ  r  r  r  r  r  r  r  r  r  r'  r4  rS  rf  rx  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r%  r-  r0  r3  r6  r9  rA  r`  ri  ro  rv  r|  r  r  r  r  r  r  r  rk   r^   r\   r  r  	  s   ',/6$0 2),:!
!&$%@!$F9!vHXT>90v!$F#,#(#0#,<#|R1h<">N@
:#2J($*%"&"&$)$&
P.&&6P+(!,F4$/2"
=C	>,38':(*::<><:
<9<%8>	;	27	9D,?2C8r^   r  c                   \   e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&d% Z'd& Z(d' Z)d( Z*d) Z+d* Z,d+ Z-d, Z.d- Z/d. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4 Z6d5 Z7d6 Z8d7 Z9d8 Z:y9):GenericTestsc                 t   t         t        t        f   }| j                  |j                  d       | j                  t              5  |t            d d d        | j                  t              5  |t        t        f    d d d        t         t        t        f   }| j                  |j                  t        f       |t            | j                  t              5  |t        t        f    d d d        t         t        t        f   }| j                  t              5  t        |t                d d d        | j                   |       t                t        d      }| j                  t        t        |   t        z     j                  |f       y # 1 sw Y   ;xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w)Nrk   r   )r  r   r   r   r  r   r   r  r   rT   r   r   r   r  r{  )rW   r  r  SM1r   s        r\   r9  zGenericTests.test_basics  sT   #s(#))2.y) 	cF	y) 	c3hK	"c'"))B51	#y) 	c3hK	CH%y) 	+sM*	+ce]3CLd1go.==tD	 		 	
	 		+ 	+s0   
F,FF"F.FF"F+.F7c                    t        d      }t        d      }| j                  t              5  t        |   |    d d d        | j                  t              5  t        |   |    d d d        | j                  t              5   G d dt        |   t        |         }d d d        | j                  t              5  t	        g t
        t                  d d d        | j                  t              5  t        t        t
        t                  d d d        | j                  t              5   G d dt              }d d d        | j                  t              5   G d dt        |   t        |         }d d d        | j                  t              5   G d	 d
t
        |   t        |         }d d d        | j                  t              5  t        d    d d d         G d dt        |         }| j                  t              5  |d    d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   dxY w# 1 sw Y   8xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)Nr   r  c                       e Zd Zy)+GenericTests.test_generic_errors.<locals>.CNr|   rk   r^   r\   rB  r  &  r   r^   rB  c                       e Zd Zy)4GenericTests.test_generic_errors.<locals>.NewGenericNr|   rk   r^   r\   
NewGenericr  ,  r   r^   r  c                       e Zd Zy)3GenericTests.test_generic_errors.<locals>.MyGenericNr|   rk   r^   r\   	MyGenericr  .  r   r^   r  c                       e Zd Zy)4GenericTests.test_generic_errors.<locals>.MyGeneric2Nr|   rk   r^   r\   
MyGeneric2r  0  r   r^   r  rk   c                       e Zd Zy)+GenericTests.test_generic_errors.<locals>.DNr|   rk   r^   r\   rE  r  3  r   r^   rE  )	r   r   r   r#   r   r   r   rT   r  )rW   r   r  rB  r  r  r  rE  s           r\   test_generic_errorsz GenericTests.test_generic_errors  s   CLCLy) 	AJqM	y) 	AJqM	y) 	10GAJ
0	1y) 	&r49%	&y) 	(tT#Y'	(y) 	+*W*	+y) 	98GAJ
8	9y) 	76T!Wgaj6	7y) 	BK	!
!y) 	bE	 	'	 		 		1 	1	& 	&	( 	(	+ 	+	9 	9	7 	7	 		 	sw   HH H%8H2-H?&III%
I1<I=HH"%H/2H<?I	II"%I.1I:=Jc                    t        d      }t        d      }| j                  t              5  t        ||f    d d d        | j                  t              5  t        |||f    d d d        y # 1 sw Y   4xY w# 1 sw Y   y xY w)Nr   r  )r   r   r   r#   )rW   r   r  s      r\   	test_initzGenericTests.test_init7  sx    CLCLy) 	AqDM	y) 	Aq!G	 		 		 	s   A+A7+A47B c                     G d dt         j                  t                 } G d d|      }| j                  |j                  d       | j                  t              5  |j                   d d d        d|_        d|_         G d d	|      } G d
 d|t                 }| j                  |j                  d       | j                  |j                  d       | j                  |j                  d       y # 1 sw Y   xY w)Nc                        e Zd Z fdZ xZS )*GenericTests.test_init_subclass.<locals>.Xc                 2    t        |   di | d| _        y )Nr   rk   )r   __init_subclass__r  )rX   r   r   s     r\   r  z<GenericTests.test_init_subclass.<locals>.X.__init_subclass__A  s    )3F3r^   rh   ri   rj   r  r   r   s   @r\   r  r  @  s     r^   r  c                       e Zd Zy)*GenericTests.test_init_subclass.<locals>.YNr|   rk   r^   r\   r  r  D  r  r^   r  r   rn   r   c                       e Zd Zy)*GenericTests.test_init_subclass.<locals>.ZNr|   rk   r^   r\   Zr  K  r  r^   r  c                       e Zd Zy)*GenericTests.test_init_subclass.<locals>.WNr|   rk   r^   r\   r  r  M  r  r^   r  )rc   r#   r   r   r  r   r  r   )rW   r  r  r  r  s        r\   test_init_subclasszGenericTests.test_init_subclass?  s    	q! 		 	$~. 	FF		 		# 	#$$	 	s   C22C;c                     | j                  t        t              dt         d       | j                  t        t              dt         d       y )Nr   z.SimpleMapping'>z.MySimpleMapping'>)r   r   r  rh   r  r   s    r\   r   zGenericTests.test_reprS  sH    m,#H:-=>	@o.#H:-?@	Br^   c                    t        d      }t        d      } G d dt        |         }|t        ||f      }| j                  ||t        ||f             | j	                  ||t        ||f             ||t
        f   }| j                  |||t
        f          | j	                  |||t
        f          | j	                  |||t        f          |t           }| j                  ||t                  | j	                  ||t
                  | j	                  |||          | j                  t        |      j                  d             y )Nr   r  c                       e Zd Zy)'GenericTests.test_chain_repr.<locals>.CNr|   rk   r^   r\   rB  r  ]  r  r^   rB  z.C[typing.Tuple[str, int]])	r   r#   r   r   r   r   r   r   r  )rW   r   r  rB  r  r  r  s          r\   test_chain_reprzGenericTests.test_chain_reprY  s'   CLCL	
 	 eAqDkNAeAqDkN+Aqq!t~.afIAafI&AqCy)AqCy)cFAcF#Aqv&Aqt$A(* 	+r^   c                    t        d      }t        dd      }t        d      }| j                  t        t              d       | j                  t        t        |         d       | j                  t        t        |         d       | j                  t        t        |   |   t                 d	       | j                  t        t        t                 d	       y )
Nr   UTr  r  ztyping.Listztyping.List[~T]ztyping.List[+U]ztyping.List[int])r   r   r   r   r   )rW   r   r  r  s       r\   test_new_reprzGenericTests.test_new_reprq  s    CLC4(CLd]3d1g(9:d1g(9:d1gajo.0BCd3i*<=r^   c                 p   t        d      }t        d      }| j                  t        t        j                  ||f   ||f         d       | j                  t        t
        t        ||f      t        |f         d       | j                  t        t
        t        ||f      t
        t                    d       y )Nr   TSztyping.Mapping[~TS, ~T]z"typing.List[typing.Tuple[int, ~T]]z=typing.List[typing.Tuple[typing.List[int], typing.List[int]]])r   r   r   rc   r  r   r   r   )rW   r   r  s      r\   test_new_repr_complexz"GenericTests.test_new_repr_complex|  s    CLT]fnnQU3BE:;=VWd5B<0a89=	?eAqDk"49-.K	
r^   c                 ,   t        d      }| j                  t        t        |         d       | j                  t        t        j
                  |         d        G d dt        j                  t        t        f         }t        |j                         y )Nr   ztyping.Generic[~T]ztyping.Protocol[~T]c                       e Zd Zy)*GenericTests.test_new_repr_bare.<locals>.CNr|   rk   r^   r\   rB  r    r   r^   rB  )	r   r   r   r#   rc   r'   r    r   __mro__rW   r   rB  s      r\   test_new_repr_barezGenericTests.test_new_repr_bare  sd    CLgaj)+?@fooa013HI+CH%+QYYr^   c                    t        d      } G d dt        |         } |       }d|_        | j                  |j                  ddi        G d d|t
                 } |       }d|_        | j                  |j                  d	di       y )
Nr   c                       e Zd Zy)!GenericTests.test_dict.<locals>.BNr|   rk   r^   r\   r   r    r  r^   r   r   rk  c                       e Zd Zy)!GenericTests.test_dict.<locals>.CNr|   rk   r^   r\   rB  r    r  r^   rB  r  r*  )r   r#   rk  r   r  r   r*  )rW   r   r   r   rB  r  s         r\   	test_dictzGenericTests.test_dict  s{    CL	
 	 CeR[1	# 	 CeU^4r^   c                 P     d        }| j                   |t                  |       y )Nc                  0    d x} f G fdd
}|      S )r   c                       e Zd ZW  Zd Zy)7GenericTests.test_setattr_exceptions.<locals>.Immutablec                     t        d      )N	immutabler  r  s      r\   __setattr__zCGenericTests.test_setattr_exceptions.<locals>.Immutable.__setattr__  s    ";//r^   N)rh   ri   rj   rv  r  rw  s   r\   	Immutabler    s    0r^   r  rk   r  s     @r\   z!<generic parameters of Immutable>zOGenericTests.test_setattr_exceptions.<locals>.<generic parameters of Immutable>  s     	0 	0 	0r^   )r   r   )rW   r  s     r\   test_setattr_exceptionsz$GenericTests.test_setattr_exceptions  s"    	0 	nin.	:r^   c                    t        d      } G d dt        |         }| j                  |t           j                  d       | j                  ||t              j                  d       d||t              _        | j                  |j                  d       | j                  |t
           j                  d       d|t        t
              _        | j                  |j                  d       | j                  |t        t              j                  d       | j                   |       j                  d       | j                   |t        t
                     j                  d        G d d||         }| j                  |t           j                  d       | j                  |j                  d       d	|_        d
|t           _        | j                  |j                  d       | j                  |t           j                  d       | j                  |j                  d
       | j                  |t
           j                  d	       y )Nr   c                       e Zd ZdZy)<GenericTests.test_subscripted_generics_as_proxies.<locals>.CdefNrz  rk   r^   r\   rB  r    s    Ar^   rB  r  changednewc                       e Zd Zy)<GenericTests.test_subscripted_generics_as_proxies.<locals>.DNr|   rk   r^   r\   rE  r	    r  r^   rE  zfrom derived zzfrom derived x)	r   r#   r   r   r   r   r   rQ  r   rW   r   rB  rE  s       r\   $test_subscripted_generics_as_proxiesz1GenericTests.test_subscripted_generics_as_proxies  s   CL	
 	35)1S6e,!C&	i(39-$s)e$5:%0	*5:**E2	! 	39-e$##i(35)./3#34r^   c                 4   t        d      } G d dt        j                  j                  t        |         }|j                  t               | j                  d|       |t            | j                  d|       |j                          |j                          y )Nr   c                       e Zd Zy).GenericTests.test_abc_registry_kept.<locals>.CNr|   rk   r^   r\   rB  r	    r   r^   rB  rn   )
r   r  r  r  r#   r  r   r   r{  _abc_caches_clearr  s      r\   test_abc_registry_keptz#GenericTests.test_abc_registry_kept  sm    CL9''9	

3a#	#a#		r^   c                      G d dt         t        t        f         }| j                  i |       | j                  t        |       y )Nc                       e Zd Zy)5GenericTests.test_false_subclasses.<locals>.MyMappingNr|   rk   r^   r\   	MyMappingr	    r   r^   r	  )r!   r   r   r`   r&  )rW   r	  s     r\   test_false_subclassesz"GenericTests.test_false_subclasses  s3    7sCx07  Y/  y1r^   c                 T    G d dt         t        t        f         } |       j                          | j                   |       t        j
                  j                          | j                   |       t                | j                   |       t               | j                  i |       y )Nc                   *    e Zd Zd Zd Zd Zd Zd Zy)'GenericTests.test_abc_bases.<locals>.MMc                      y rb   rk   rW   r  s     r\   r  z3GenericTests.test_abc_bases.<locals>.MM.__getitem__  r3  r^   c                      y rb   rk   rW   r  r  s      r\   r  z3GenericTests.test_abc_bases.<locals>.MM.__setitem__  r  r^   c                      y rb   rk   r	  s     r\   __delitem__z3GenericTests.test_abc_bases.<locals>.MM.__delitem__  r  r^   c                     t        d      S r  iterr   s    r\   rM  z0GenericTests.test_abc_bases.<locals>.MM.__iter__      Bxr^   c                      yrb  rk   r   s    r\   __len__z/GenericTests.test_abc_bases.<locals>.MM.__len__  r  r^   Nrh   ri   rj   r  r  r	  rM  r	  rk   r^   r\   MMr	         r^   r	  )r!   r   updater   r  r  r   r   )rW   r	  s     r\   test_abc_baseszGenericTests.test_abc_bases  st    
	S) 
	 	bdKOO$B$BCbdN3  t,  R(r^   c                 L    G d dt         t        t        f   t        j                  j                         } G d dt        j                  j                   t         t        t        f         }| j	                  |j
                  t        j                  j                   t        f       y )Nc                       e Zd Zy)-GenericTests.test_multiple_bases.<locals>.MM1Nr|   rk   r^   r\   MM1r%	    r  r^   r&	  c                       e Zd Zy)-GenericTests.test_multiple_bases.<locals>.MM2Nr|   rk   r^   r\   MM2r(	    r  r^   r)	  )r!   r   r  r  r   	__bases__r#   )rW   r&	  r)	  s      r\   test_multiple_basesz GenericTests.test_multiple_bases  sg    	.c*KOO,J,J 		+//00.c2J 	)G)G(QRr^   c                     t        d      } G d dt        j                  t        |f         }| j	                  |j
                  t        j                  t        |f   f       y )Nr   c                       e Zd Zy)'GenericTests.test_orig_bases.<locals>.CNr|   rk   r^   r\   rB  r.	    r   r^   rB  )r   rc   r    r   r   __orig_bases__r  s      r\   test_orig_baseszGenericTests.test_orig_bases  sF    CL)CF#)))FKKQ,?+ABr^   c                    d }| j                   |ddit        j                  t        t        f                | j                   |ddit        j                  t        t        f                | j                  t              5   |ddit        j                  t        t        f          d d d        d } G d dt        t                 }| j                   | |t                  |t                        | j                   | |t                  |t                        | j                   | |t                  t                     | j                  t              5   |g d|t                  d d d        d } G d	 d
t        t                 }| j                   |g d|             | j                   |ddg|             y # 1 sw Y   xY w# 1 sw Y   dxY w)Nc                     t        |j                        dkD  rt        |j                  r2|j                  \  t	        fd| j                         D              S y )Nr   c              3   X   K   | ]!  \  }}t        |      xr t        |       # y wrb   )r   ).0r  r  r   r   s      r\   	<genexpr>zSGenericTests.test_naive_runtime_checks.<locals>.naive_dict_check.<locals>.<genexpr>  s3      1 q"%;*Q*;;s   '*)r  r  r<  r  allr  )rV  tpr   r   s     @@r\   naive_dict_checkz@GenericTests.test_naive_runtime_checks.<locals>.naive_dict_check  sU    2$$%))){{B  #		   r^   r   rn   c                 D    t        | d      st        | j                  |k(  S )Nr5  )rl  r<  r5  rV  r7	  s     r\   naive_generic_checkzCGenericTests.test_naive_runtime_checks.<locals>.naive_generic_check  s$    3 01))%%++r^   c                       e Zd Zy)4GenericTests.test_naive_runtime_checks.<locals>.NodeNr|   rk   r^   r\   Noder=	  	  r   r^   r>	  rO  c                 ,    t        fd| D              S )Nc              3   j   K   | ]*  }t        |j                  d    j                  d           , yw)r   N)r   r/	  r  )r4	  r   r7	  s     r\   r5	  zXGenericTests.test_naive_runtime_checks.<locals>.naive_list_base_check.<locals>.<genexpr>  s6      % "!R%6%6q%9%B%B1%EF %s   03)r6	  r:	  s    `r\   naive_list_base_checkzEGenericTests.test_naive_runtime_checks.<locals>.naive_list_base_check  s     % #% % %r^   c                       e Zd Zy)1GenericTests.test_naive_runtime_checks.<locals>.CNr|   rk   r^   r\   rB  rC	    r   r^   rB  r  r   )r   rc   r    r   r   r   r   r<  r   r#   r   )rW   r8	  r;	  r>	  rA	  rB  s         r\   test_naive_runtime_checksz&GenericTests.test_naive_runtime_checks  sz   		 	(#q6;;sCx3HIJ)1c(FKKS4IJK23 	<aXv{{36':;	<	,
 	$71:#+IDIKcCD,YT#Y[$s)DE,YT#Y[$?@23 	6	495	6	% 	 S	-i;<.Sz1=>+	< 	<	6 	6s   'GGGGc                    t        d      }t        d      }t        d      } G d dt        |   |   |         } G d d|t        |   |   |         }| j                  |j                  |f       | j                  |j                  |f       | j                  |t           j                  d       | j                  |t           j                  d       | j                  |t           j
                  t        f       | j                  |t           j
                  t        f       | j                  |j                  t        t        f       | j                  |j                  |t        t        f       | j                  |j                  t        |   |   |   f       | j                  |j                  |t        |   |   |   f       y )	Nr   r  r  c                       e Zd Zy).GenericTests.test_multi_subscr_base.<locals>.CNr|   rk   r^   r\   rB  rG	    r   r^   rB  c                       e Zd Zy).GenericTests.test_multi_subscr_base.<locals>.DNr|   rk   r^   r\   rE  rI	    r   r^   rE  rk   )
r   r   r   r  r   r  r*	  r  r#   r/	  )rW   r   r  r  rB  rE  s         r\   test_multi_subscr_basez#GenericTests.test_multi_subscr_base  s^   CLCLCL#Q
1#&471:a=&))A40))A403..33..333&133&1tWo6q$&89))DGAJqM+;<))AtAwqz!}+=>r^   c                 ,   t        d      } G d dt              }| j                  t        |   t        |          | j                  t        |t
        f   |   t        |t
        f          | j                  t        d|f   j                  t        |f       y )Nr   c                       e Zd Zy).GenericTests.test_subscript_meta.<locals>.MetaNr|   rk   r^   r\   MetarM	  +  r   r^   rN	  .)	r   r   r   r5   r   r   r"   r  Ellipsis)rW   r   rN	  s      r\   test_subscript_metaz GenericTests.test_subscript_meta)  su    CL4dT$Z0q#vt,eD#I.>?#t),55$7GHr^   c                 4    G d dt         t                 } G d dt         t                 }| j                  ||       | j                  t        j                  t
           t        j                  t
                  | j                  |j                  |j                         | j                  t        j                  j                  |j                  t
              t        j                  j                  |j                  t
                     | j                  ||j                         | j                  |t        j                         | j                  |t        j                  j                         | j                  |j                  t        j                         | j                  |j                  t        j                  j                         | j                  |t
           |j                  t
                  | j                  |t        t              |j                  t        t                     | j                  |t
           t        j                  t
                  | j                  |t
           t        j                  j                  t
                  | j                  |j                  t           t        j                  t                  | j                  |j                  t        t              t        j                  j                  t        t                     | j                  t        |t
              t        |j                  t
                     | j                  t        |t        t                 t        |j                  t        t                        | j                  t        t
        |t
           f   t        t
        t        j                  t
           f          | j                  t        |t
           |t
           f   t        |t
           t        j                  t
           f          | j                  t        j                  |t
              t        j                  t        j                  j                  t
                     | j                  t!        t        |t
                    j#                  d             | j                  t!        t        |j                  t
                    j#                  d             | j                  t!        t        t        j                  t
                    j#                  d             | j                  t!        t        t        j                  j                  t
                    j#                  d             y )	Nc                       e Zd Zy)+GenericTests.test_generic_hashes.<locals>.ANr|   rk   r^   r\   r   rS	  1      r^   r   c                   (    e Zd Z G d dee         Zy)+GenericTests.test_generic_hashes.<locals>.Bc                       e Zd Zy)-GenericTests.test_generic_hashes.<locals>.B.ANr|   rk   r^   r\   r   rX	  5      r^   r   N)rh   ri   rj   r#   r   r   rk   r^   r\   r   rV	  4  s    GAJ r^   r   z<locals>.A[str]]z<locals>.B.A[str]]zmod_generics_cache.A[str]]zmod_generics_cache.B.A[str]])r#   r   r   rM   r   r   r   r   r   r   r   r   r   rc   	FrozenSetr   r   r  r   s      r\   test_generic_hashesz GenericTests.test_generic_hashes0  s   	
 		
 	 	A+--c24F4H4H4MNacc"+--//C9+--//C9	; 	Aqss#A1334A133556ACC!3!5!56ACC!3!5!5!7!78AcFACCH-Ad3iL!##d3i.9AcF$6$8$8$=>AcF$6$8$8$:$:3$?@ACCH&8&:&:3&?@ACCS	N,>,@,@,B,B49,MNE!C&M5S?;E!DI,/qss49~1FGE#qv+.c;M;O;OPS;T6T0UVE!C&!C&.1!!C&*<*>*>s*C"CD	FF,,QsV4",,-?-A-A-C-CC-HI	K 	U1S6]+445GHIU133s8_-667KLMU#5#7#7#<=>!">?	AU#5#7#7#9#9##>?@!"@A	Cr^   c                    t        d      }t        d      }| j                  t        ||f   t           t        t        t        f          | j                  t        j
                  t        ||f      |   t        j
                  t        ||f             | j                  t              5  t        |t        f   d    d d d        | j                  t        |t        f   t           t               | j                  t        ||f   t        t        t        t        f   f   t        t        t        f           G d d      } G d d|      }| j                  t        ||f   t        ||f      t        ||f          | j                  t        |g|f   t           t        t        gt        f          | j                  t        dt        |   f   t           t        dt        t           f          y # 1 sw Y   2xY w)	Nr   r  rk   c                       e Zd Zy)9GenericTests.test_extended_generic_rules_eq.<locals>.BaseNr|   rk   r^   r\   Baser^	  d  r   r^   r_	  c                       e Zd Zy)<GenericTests.test_extended_generic_rules_eq.<locals>.DerivedNr|   rk   r^   r\   Derivedra	  e  r   r^   rb	  .)r   r   r   r   rc   r  r   r   r   r   r"   r   r   )rW   r   r  r_	  rb	  s        r\   test_extended_generic_rules_eqz+GenericTests.test_extended_generic_rules_eqZ  s   CLCLq!tS)5c?;q!t5a8&//%PQSTPT+:VWy) 	!S&M"	 	q#vs+S1q!tS%S/%9:E#s(OL d q$wdGm(<=uT7]?ST1#q&)"-xb/AB#tAw,/4hsDI~6NO	 	s   (G++G5c                     t        d      }| j                  t        t        t        t
        f         j                  dd      d       | j                  t        t        t        t        t           f         j                  dd      d       | j                  t        t
        dt        |   f   t                 j                  dd      d       | j                  t        t
        g t        |   f   t                 j                  dd      d       y )	Nr   ztyping.r   zUnion[Tuple, Callable]zUnion[Tuple, Tuple[int]].zCallable[..., Optional[int]]zCallable[[], List[int]])
r   r   r   r   r   r"   r  r   r   r   rw  s     r\    test_extended_generic_rules_reprz-GenericTests.test_extended_generic_rules_reprj  s    CLeE8O45==iL1	3eE5:$567??	2N3	5hsHQK'78=>FFyRTU7	9hr47{3C89AA)RP2	4r^   c                 X   dt         t         d      fd}dt        t        t        d            fd}dt        t        d         t        z  fd} G d d      }| j	                  t        |t               t                     dt         t         |      i       | j	                  t        |t               t                     dt        t        |      i       | j	                  t        |t               t                     dt        |t        z     t        z  i       t        d      }t        |d	f   }d|fd
}| j                  t        |t               t                     d   |       t        d	t         |   f   }d|fd}	| j                  t        |	t               t                     d   |       y )Nr   CCc                      y rb   rk   r   s    r\   foobarz5GenericTests.test_generic_forward_ref.<locals>.foobarv  s    r^   c                      y rb   rk   r   s    r\   foobar2z6GenericTests.test_generic_forward_ref.<locals>.foobar2w  r  r^   zCC | intc                      y rb   rk   r   s    r\   foobar3z6GenericTests.test_generic_forward_ref.<locals>.foobar3x  r  r^   c                       e Zd Zy)1GenericTests.test_generic_forward_ref.<locals>.CCNr|   rk   r^   r\   rg	  ro	  y  r   r^   r   .c                      y rb   rk   r   s    r\   barfooz5GenericTests.test_generic_forward_ref.<locals>.barfoo  r  r^   c                      y rb   rk   r   s    r\   barfoo2z6GenericTests.test_generic_forward_ref.<locals>.barfoo2  r  r^   )r   r  rA   r   r   r+   r  r  r   r   r   r"   )
rW   ri	  rk	  rm	  rg	  r   ATrq	  CTrs	  s
             r\   test_generic_forward_refz%GenericTests.test_generic_forward_refu  sS   ,d4:&,9tDD!1239?tJz23c9?679fh7$tBx.!	
 	7GIvx8$tBx.!	
 	7GIvx8$rCx.3&'	

 CL1c6]bnVWYA#FKc47l#rnWgiB3GLr^   c           
          G d d      }| j                  t        |t               t                     dt        |   i        G d d      }| j                  t        |t               t                     dt
        |t        t        t        |         f   i       i }t        t        j                  d      |       |d   }| j                  |j                  d   d       | j                  t        |t               t                     dt        t        |      i       t        d	   }d
|fd}| j                  t        |t               t                     d
t        t        t        d	            i       y )Nc                       e Zd ZU ed   ed<   y)8GenericTests.test_generic_pep585_forward_ref.<locals>.C1r&  r  Nrh   ri   rj   r  r   rk   r^   r\   r&  ry	    s    DzMr^   r&  r  c                   4    e Zd ZU edeeed         f   ed<   y)8GenericTests.test_generic_pep585_forward_ref.<locals>.C2r&  r'  r  N)rh   ri   rj   r&  r  r   r   rk   r^   r\   r'  r|	    s     D$tDJ/0011r^   r'  zf
        from __future__ import annotations
        class C3:
            a: List[list["C2"]]
        r(  zList[list['C2']]r  r   c                      y rb   rk   r   s    r\   rf   z7GenericTests.test_generic_pep585_forward_ref.<locals>.f  r  r^   )r   r+   r  r  r  r&  r   rz  textwrapdedentr   rA   )rW   r&  r'  scoper(  r  rf   s          r\   test_generic_pep585_forward_refz,GenericTests.test_generic_pep585_forward_ref  s<   	 	2wy&(3$r(O	

	2 	22wy&(3$r4T"X//01	
 X__   		
 4[++C02DE2wy&(3$tBx.!	
 I1gi2$tJsO,-.	
r^   c                    t        t        j                        }t        j                  j                  }| j	                  |d   |d          | j                  |d   j                  d   t        |d             | j	                  |d   j                  d   |d          t        t        j                        }| j                  |j                         h d       | j                  t        |j                               t        t        j                  j                        z  t                      t        t        j                        }t        j                  j                  }| j                  |j                         h d       | j	                  |d   |d          | j                  |d   t        |d             | j	                  |d   j                  |d          | j	                  |d	   j                  |d          y )
Nr   r   r   rn   rQ  r   >   r   r   rQ  >   r   r   rQ  zzr   r	  )r+   rL   r   rv  r   r   r  r   r   rQ  rY  valuesgeneric_functionr  )rW   hints_for_AA_type_paramshints_for_Bhints_for_generic_functionfunc_t_paramss         r\   +test_pep695_generic_with_future_annotationsz8GenericTests.test_pep695_generic_with_future_annotations  s   $]__5%77k#&a(89S)2215vmA>N7OPk#&//2M!4DE$]__5))+_=""$%MOO,K,K(LLE	

 &4M4R4R%S"%66FF&++-/N	
 	05}Q7GH3C8&qAQ:RS05@@-PQBRS06AA=QRCSTr^   c                     G d dt         t        t        f         } G d dt         t        df         } G d dt        j                  t                 }| j                  |j                  t        t        f       | j                  |t        t        f   j                  t        t        f       | j                  |t        t        f   j                  |       | j                  |j                  t        f       | j                  t        |t                 j                  d      d	   d
       | j                  |j                  t        f       | j                   |       t        j                  j                         | j!                  |t        j                  j                         | j                   |       t"               | j!                  |t"               | j%                  t&              5  t)        t         t        df   t        j*                         d d d        | j%                  t&              5  t)        t         t        df   t        j,                         d d d        y # 1 sw Y   OxY w# 1 sw Y   y xY w)Nc                       e Zd Zy)@GenericTests.test_extended_generic_rules_subclassing.<locals>.T1Nr|   rk   r^   r\   r"  r	    r   r^   r"  c                       e Zd Zy)@GenericTests.test_extended_generic_rules_subclassing.<locals>.T2Nr|   rk   r^   r\   r#  r	    r   r^   r#  .c                       e Zd Zd Zy)@GenericTests.test_extended_generic_rules_subclassing.<locals>.C1c                      y)NFrk   )rW   items     r\   __contains__zMGenericTests.test_extended_generic_rules_subclassing.<locals>.C1.__contains__  s    r^   N)rh   ri   rj   r	  rk   r^   r\   r&  r	    r  r^   r&  .zC1[int])r   r   r   rc   	Containerr   r  r   r   r  r  r   splitr   r  r  r]   r  r   r   rT   Sequencer  )rW   r"  r#  r&  s       r\   'test_extended_generic_rules_subclassingz4GenericTests.test_extended_generic_rules_subclassing  s   #q"u#$q#v$	!!!$ 	 	**QG4CH..c
;CF..3**QD1 	bg,,S1"5yA**QD1bdKOO$=$=>b+//";";<bdE*b%(y) 	9uS#X8	9y) 	9uS#X8	9 	9	9 	9	9 	9s   ,(I"1(I."I+.I7c                    | j                  t              5  t        t            d d d        | j                  t              5  t        t
            d d d        | j                  t              5  t        t        t               d d d        | j                  t              5  t        t        t               d d d        y # 1 sw Y   xY w# 1 sw Y   zxY w# 1 sw Y   TxY w# 1 sw Y   y xY wrb   )r   r   r   r   r   r   r$   r   r   s    r\   test_fail_with_bare_unionz&GenericTests.test_fail_with_bare_union  s    y) 	K	y) 	(O	y) 	$Xc]#	$y) 	 #	  	 	 		 		$ 	$	  	 s/   B<C,CC <CCC C)c                 ~   t        d      }| j                  t              5  t        t            d d d        | j                  t              5  t
        t        |       d d d        | j                  t              5  t        t        j                      d d d        y # 1 sw Y   mxY w# 1 sw Y   KxY w# 1 sw Y   y xY wr  )r   r   r   r   r#   r   rc   r'   rw  s     r\   test_fail_with_bare_genericz(GenericTests.test_fail_with_bare_generic  s    CLy) 	M	y) 	'!*	y) 	"!	" 	"		 		 		" 	"s#   BB':B3B$'B03B<c                    t        d      }| j                           G d dt        ||f         }| j                   |t                  j
                  |       | j                   |t                  j                  |t                   G d dt        j                  ||f         }| j                   |t                  j
                  |       | j                   |t                  j                  |t                   G d dt        j                  t        |f         }| j                   |t                  j
                  |       | j                   |t                  j                  |t                   G d d	t        j                  t        |f         }| j                   |t                  j
                  |       | j                   |t                  j                  |t                  y )
Nr   c                       e Zd Zy)5GenericTests.test_type_erasure_special.<locals>.MyTupNr|   rk   r^   r\   MyTupr	    r   r^   r	  c                       e Zd Zy)6GenericTests.test_type_erasure_special.<locals>.MyDictNr|   rk   r^   r\   MyDictr	    r   r^   r	  c                       e Zd Zy)5GenericTests.test_type_erasure_special.<locals>.MyDefNr|   rk   r^   r\   MyDefr	    r   r^   r	  c                       e Zd Zy)7GenericTests.test_type_erasure_special.<locals>.MyChainNr|   rk   r^   r\   MyChainr	    r   r^   r	  )r   rg   r   r   r   r   r   r5  rc   r    DefaultDictr   ChainMap)rW   r   r	  r	  r	  r	  s         r\   test_type_erasure_specialz&GenericTests.test_type_erasure_special  s`   CL%E!Q$K%jeCjl,,e4s44eCjA,V[[A&,kfSkm--v655vc{C4F&&sAv.4jeCjl,,e4s44eCjA3fooc1f-3lgcln..866Er^   c                 >   d t         j                  D        }|D ]   }| j                  t        |      d       | j	                  ||       t        |dd       rtt        |t         j                        sZt        |j                  t              r@t        |j                        dk(  r(| j	                  |t           j                  t        f       t        |t              s|j                  D ]/  }| j                  t        |      d       | j	                  ||       1  y )Nc              3   <   K   | ]  }t        t        |        y wrb   )getattrrc   )r4	  els     r\   r5	  z4GenericTests.test_all_repr_eq_any.<locals>.<genexpr>  s     =#=s   r   r  rn   )rc   __all__r   r   r   r	  r   r   r  r  r  r   r  r   r  )rW   objsrV  bases       r\   test_all_repr_eq_anyz!GenericTests.test_all_repr_eq_any  s    =fnn= 	1CS	2.S#&-t4&sFNN;"3#5#5u=C../14  S!2!2SF;#t$KK 1D''T
B7$$T401	1r^   c                 b   t        d      } G d dt        |         } G d d|t                 at               }d|_        d|_        t        t        j                  dz         D ]  }t        j                  ||      }t        j                  |      }| j                  |j                  d       | j                  |j
                  d       | j                  |j                  ddd	        t        t        t        t         t"        t        t        t$        f   t"        t&           t        t        d
f   t        d   t         t$        gt(        f   t*        j,                  t*        j.                  t           g}|D ]`  }t        t        j                  dz         D ]?  }t        j                  ||      }t        j                  |      }| j                  ||       A b t&        t*        j0                  t*        j2                  t&        t           t*        j2                  t*        j4                     t*        j6                  t        t        t$        f      g}	|	D ]`  }t        t        j                  dz         D ]?  }t        j                  ||      }t        j                  |      }| j                  ||       A b y )Nr   c                       e Zd Zy)#GenericTests.test_pickle.<locals>.BNr|   rk   r^   r\   r   r	  "  r  r^   r   c                       e Zd Zy)rB  Nr|   rk   r^   r\   rB  rB  %  r  r^   rB  r   r  rn   r\  .rk   )r   r#   r   rB  rk  r*  rr   rs   rt   rv  ru  r   r  r   r   r   r"   r$   r   r   r  rc   r	  rZ	  r  r5   r  AbstractSet)
rW   r   r   r  rq   rQ  r   r"  r   more_sampless
             r\   r$  zGenericTests.test_pickle  s   CL	
 		# 	 C622Q67 	DEQ&AQAQUUB'QUUE*QZZE)BC	D uhc?HTNE#s(OU2YSE5L)%%v'7'7'<>  	'Av66:; 'LLE*LLO  A&'	'
 foov{{DIFNN3V5G5GcSVh5XZ 	'Av66:; 'LLE*LLO  A&'	'r^   c                     t        d      } G d dt        |         }t        |t        f   t        |t        f   t        d   t
        d|f   t
        t        gt        f   t        t        t        f   ||   |t           |t           t        j                  |   t        j                  t           t        j                  t           t        j                  t        t        f   t        j                  |t        f   t        t           t        t        |      t        d   t        dt        f   t        d   t        j                  dt        f   g}|t        gz   D ]8  }| j                  |t        |             | j                  |t!        |             : y )Nr   c                       e Zd Zy)1GenericTests.test_copy_and_deepcopy.<locals>.NodeNr|   rk   r^   r\   r>	  r	  D  r   r^   r>	  rk   .)r   r   )r   r#   r   r   r   r"   r   rc   r  r    r   r$   r   r  r   r   r   )rW   r   r>	  thingsr  s        r\   test_copy_and_deepcopyz#GenericTests.test_copy_and_deepcopyB  s(   CL#71:#3-q#vb	36"HcUCZ$8S/47DItCy&//RSBT//#&(<fkk#s(>S++af%x}htAw6GxS/49fnnS#X.FH 3% 	-AQQ(Q,	-r^   c                    t        d      at        dt              at        dt        t
              at        d      at        t        t        t        t        t        j                  t        t        j                  t        t        t         t"        fD ]  }| j%                  |      5  | j'                  t)        |      |       | j'                  t+        |      |       t-        t.        j0                  dz         D ];  }| j'                  t/        j2                  t/        j4                  ||            |       = 	 d d d         bbbbt        d      }t        d	t              }t        d
t        t
              }t        d      }||||fD ]S  }| j%                  |      5  | j'                  t)        |      |       | j'                  t+        |      |       d d d        U y # 1 sw Y   XxY w# 1 sw Y   mxY w)Nr  TPBr  TPVPP)r  rn   TLTLBTLVPL)r   r  r   r	  r  r   r	  rE   r	  r   rc   r  r$   r  r   r   r   r"   ru   r   r   r   rr   rs   rt   ru  rv  )rW   r  rq   r	  r	  r	  r	  s          r\   $test_immutability_by_copy_and_picklez1GenericTests.test_immutability_by_copy_and_pickleO  s    T]e3'eUC(t_c3&//eX/ 	KA A& Kd1gq)hqk1-"6#:#:Q#>? KEMM&,,v||Au/E"FJKK K	K S" T]e3'eUC(t_c3# 	.AA& .d1gq)hqk1-. .	.K K. .s   $BG7G*G'	*G3	c                    t        d       G fddt                 } |d      }| j                  t        |      j                  d       | j                  t        |      j                  d       | j                  t        |      |       | j                  t        |      |       d|_        | j                  t        |      j                  d       | j                  t        |      j                  d        |t           d      }| j                  t        |      j                  d       | j                  t        |      j                  d       | j                  t        |      |       | j                  t        |      |       d|_        | j                  t        |      j                  d       | j                  t        |      j                  d       | j                  |j                  |t                  y )Nr   c                        e Zd ZdW  ddfdZy)3GenericTests.test_copy_generic_instances.<locals>.Cr  r   Nc                     || _         y rb   r  r  s     r\   r   z<GenericTests.test_copy_generic_instances.<locals>.C.__init__n  r  r^   r   rt  s   r\   rB  r	  m  s    !Q !4 !r^   rB  r   rn   )	r   r#   r   r   r  r   assertIsNotr   r5  )rW   rB  r  cir   s       @r\   test_copy_generic_instancesz(GenericTests.test_copy_generic_instancesk  sv   CL	!
 	! bEar*!))2.a!$!a(aq)!))1-QsVBZb+"**B/b2&"r*b*"**A.**AcF3r^   c           	         t        d      }t        t        |t        f   t        d|f   t
        t        t        f   t        t        t              t        j                  t        t        f   t        j                  t           t        j                  d   g}|D ],  }| j                   t        j                   |             |       . y )Nr   .whatever)r   r   r   r   r"   r   r   r   rc   r  r   r?   r  r  r   r  r  )rW   r   r	  r  s       r\   test_weakref_allzGenericTests.test_weakref_all  s    CLuQV}hsAv&6c3h49%v~~c3h'?,,u%vz'BD  	2A^W[[^-q1	2r^   c                 $   t        d      } G d dt        |         } |       } |t                  }d|_        d|_        | j	                  t
              5  d|_        d d d        | j	                  t
              5  d|_        d d d        d|d   fd}| j                  t        |t               t                     d   ||          | j                  t        |t                 t        |t                        y # 1 sw Y   xY w# 1 sw Y   xY w)Nr   c                       e Zd ZdZy)0GenericTests.test_parameterized_slots.<locals>.C)potatoNr  rk   r^   r\   rB  r	    s    #Ir^   rB  r   r   c                      y rb   rk   r   s    r\   rk  z2GenericTests.test_parameterized_slots.<locals>.foo  r  r^   )r   r#   r   r	  r   r  tomator   r+   r  r  r   r   )rW   r   rB  r  c_intrk  s         r\   test_parameterized_slotsz%GenericTests.test_parameterized_slots  s    CL	$
 	$ C#~. 	AH	~. 	EL	 	 1S6WYA#F!Mafx#'78	 		 	s   C:;D:DDc                 H   t        d      } G d dt        |         } |       } |t                  }d|_        d|_        | j	                  t
              5  d|_        d d d        | j	                  t
              5  d|_        d d d        y # 1 sw Y   /xY w# 1 sw Y   y xY w)Nr   c                       e Zd ZddiZy)5GenericTests.test_parameterized_slots_dict.<locals>.Dbananar   Nr  rk   r^   r\   rE  r	    s    !2Ir^   rE  yesr  )r   r#   r   r	  r   r  ri	  )rW   r   rE  r  d_ints        r\   test_parameterized_slots_dictz*GenericTests.test_parameterized_slots_dict  s    CL	'
 	' C#~. 	AH	~. 	 EL	  	 	 		  	 s   B;BBB!c                     | j                  t              5  t        t        t        f   } G d dt
        |         }d d d        y # 1 sw Y   y xY w)Nc                       e Zd Zy)#GenericTests.test_errors.<locals>.CNr|   rk   r^   r\   rB  r	    r   r^   rB  )r   r   r  r  r   r#   )rW   r   rB  s      r\   r   zGenericTests.test_errors  sC    y) 	b#g&AGAJ 	 	 	s   &AAc                     G d dt         t                 }| j                  |j                  t               | j                  |j
                  d       |t           }| j                  |j                  t               | j                  t        |      j                  d      d   d        G d d|t                 }| j                  |j                  t               | j                  |j
                  d	       y )
Nc                       e Zd Zy)#GenericTests.test_repr_2.<locals>.CNr|   rk   r^   r\   rB  r	    r  r^   rB  r	  r	  r	  zC[int]c                       e Zd Zy)#GenericTests.test_repr_2.<locals>.YNr|   rk   r^   r\   r  r	    r  r^   r  r	  )	r#   r   r   ri   rh   rj   r   r   r	  )rW   rB  r  r  s       r\   test_repr_2zGenericTests.test_repr_2  s    	
 	 	x0>	@cFx0as+B/:	# 	 	x0>	@r^   c                 d   t        d      }t        d      }t        d      }t        d      }t        d      } G d dt        ||f         } G d d	t        |||f         } G d
 dt        g ||         }|||f   d|t        ||f   |f   d|g t
        f   d|t        gt
        f   d|t        t        gt
        f   d|t        t        t           gt
        f   d|t        g ||   |f   d||||f   d|t        gt        gt
        f   d|t        t        gt        t        gt
        f   d|g ||   d|t        t        t        t           g f   d|t        t        t        t           gf   d|t        g ||   t        f   t        t        t
        t        gf   di}	|	j                         D ]s  \  }
}| j                  |
|      5  | j                  t        |
      dt        j                  |j                          dt        j                  |       d       d d d        u y # 1 sw Y   xY w)Nr   r"  r  r8  r  c                       e Zd Zy),GenericTests.test_repr_3.<locals>.MyCallableNr|   rk   r^   r\   
MyCallabler	    r  r^   r	  c                       e Zd Zy),GenericTests.test_repr_3.<locals>.DoubleSpecNr|   rk   r^   r\   
DoubleSpecr	    r  r^   r	  c                       e Zd Zy)%GenericTests.test_repr_3.<locals>.TsPNr|   rk   r^   r\   TsPr	    r  r^   r	  zMyCallable[~P, ~T]z+MyCallable[typing.Concatenate[~T1, ~P], ~T]zMyCallable[[], bool]zMyCallable[[int], bool]zMyCallable[[int, str], bool]z"MyCallable[[int, list[int]], bool]z9MyCallable[typing.Concatenate[typing.Unpack[Ts], ~P], ~T]zDoubleSpec[~P2, ~P, ~T]zDoubleSpec[[int], [str], bool]z(DoubleSpec[[int, int], [str, str], bool]zTsP[typing.Unpack[Ts], ~P]zTsP[int, str, list[int], []]zTsP[int, [str, list[int]]]z(MyCallable[[int, str, bool, float], int])rV  expected_repr^z.*\.$)r   rE   r   r#   rF   r,  r   r   r  r{  r  ru   assertRegexr   r   r   ri   )rW   r   r"  r  r8  r  r	  r	  r	  object_to_expected_reprrV  r	  s               r\   test_repr_3zGenericTests.test_repr_3  sM   CLT]cNt_$	A 		B* 		'&2&q&/ 	 q!t6J{2q5)1,-6cr4x 6Lud{#6OSz4'(6TT#Y'-.6Z{6B66*A-.6qr1ax 6OuseT)*6VSzC:t346`QK6RS$s)R'(6Tc49%%&6R {6B66*C/0cD%=1HI6`'#
, #:"?"?"A 	C#]C   I:#8#89:$ryy?W>XXYZ 	 s   AH&&H/	c                     | j                  t        t               | j                  t        t           t        t                  | j                  t        t           t        t
                  y rb   )r   r#   r   r   r   r   r   s    r\   	test_eq_1zGenericTests.test_eq_1  sB    '*WQZ0GBK5r^   c                 $    G d dt         t                 } G d dt         t                 }| j                  ||       | j                  ||       | j                  |t           |t                  | j                  |t           |t                  y )Nc                       e Zd Zy)!GenericTests.test_eq_2.<locals>.ANr|   rk   r^   r\   r   r
    r  r^   r   c                       e Zd Zy)!GenericTests.test_eq_2.<locals>.BNr|   rk   r^   r\   r   r
    r  r^   r   )r#   r   r   r   r   s      r\   	test_eq_2zGenericTests.test_eq_2  st    	
 		
 	 	AAq!1qt$AaD!A$'r^   c           	      D    G d dt         t        t        f         } G d dt         t        t        f         } G d d|t        t        f   t         t        t        t        f   |t        t        f         }| j	                  |j
                  t        t        t        f       y )Nc                       e Zd Zy)1GenericTests.test_multiple_inheritance.<locals>.ANr|   rk   r^   r\   r   r
    r  r^   r   c                       e Zd Zy)1GenericTests.test_multiple_inheritance.<locals>.BNr|   rk   r^   r\   r   r

  
  r  r^   r   c                       e Zd Zy)1GenericTests.test_multiple_inheritance.<locals>.CNr|   rk   r^   r\   rB  r
    r  r^   rB  )r#   r   r   r   r   r  )rW   r   r   rB  s       r\   test_multiple_inheritancez&GenericTests.test_multiple_inheritance  ss    	2 		A 		!R%'"a),aAh 	 	))B2;7r^   c                     t        d      } G d dt        |         } G d dt        t           |      }| j	                  |j
                  |t        |t        t        f       y )Nr  c                       e Zd Zy)9GenericTests.test_multiple_inheritance_special.<locals>.BNr|   rk   r^   r\   r   r
    r   r^   r   c                       e Zd Zy)9GenericTests.test_multiple_inheritance_special.<locals>.CNr|   rk   r^   r\   rB  r
    r   r^   rB  )r   r#   r   r   r   r  r  r  )rW   r  r   rB  s       r\   !test_multiple_inheritance_specialz.GenericTests.test_multiple_inheritance_special  sD    CL 
 "S	1"Qa&$ABr^   c                 @    G d dt                G fdd       G d dt        t                 }| j                        5   G d d|      }d d d        | j                        5   G d	 d
|t                 }d d d        y # 1 sw Y   6xY w# 1 sw Y   y xY w)Nc                       e Zd Zy)DGenericTests.test_init_subclass_super_called.<locals>.FinalExceptionNr|   rk   r^   r\   FinalExceptionr
    r  r^   r
  c                   &     e Zd Zd fdZ xZS );GenericTests.test_init_subclass_super_called.<locals>.Finalc                 x    | j                   D ]  }|ust        |      s |       t        |   di | y r  )r*	  rT   r   r  )rX   r   r	  r%   r
  r   s      r\   r  zMGenericTests.test_init_subclass_super_called.<locals>.Final.__init_subclass__  sD    MM 3D5(Ze-D,T223 )3F3r^   r  r  )r   r%   r
  s   @r\   r%   r
    s    4 4r^   r%   c                       e Zd Zy):GenericTests.test_init_subclass_super_called.<locals>.TestNr|   rk   r^   r\   r  r
  "  r  r^   r  c                       e Zd Zy)>GenericTests.test_init_subclass_super_called.<locals>.SubclassNr|   rk   r^   r\   Subclassr
  %  r   r^   r
  c                       e Zd Zy)?GenericTests.test_init_subclass_super_called.<locals>.Subclass2Nr|   rk   r^   r\   	Subclass2r!
  (  r   r^   r"
  )r  r#   r   r   r   )rW   r  r
  r"
  r%   r
  s       @@r\   test_init_subclass_super_calledz,GenericTests.test_init_subclass_super_called  s    	Y 		4 	4	71:u 	~. 	4 	 ~. 	DI 	 		 		 	s   B,BBBc                 6   t         } G d d|t                 }|t        j                  t              } G d d|      } |       }|j                  g        |j                  d       |j                  d       | j                  |j                         ddg       y )Nc                   .    e Zd ZdZdefdZd ZdefdZy))GenericTests.test_nested.<locals>.VisitorNr  c                     || _         y rb   r  rW   r  s     r\   rY  z-GenericTests.test_nested.<locals>.Visitor.set3  r   r^   c                     | j                   S rb   r  r   s    r\   r  z-GenericTests.test_nested.<locals>.Visitor.get6      vvr^   r   c                     | j                   S rb   r  r   s    r\   visitz/GenericTests.test_nested.<locals>.Visitor.visit9  r*
  r^   )rh   ri   rj   r  r   rY  r  r,
  rk   r^   r\   Visitorr&
  /  s$    AQ q r^   r-
  c                       e Zd ZdefdZy)0GenericTests.test_nested.<locals>.IntListVisitorr   c                 :    | j                   j                  |       y rb   )r  r  r   s     r\   r  z7GenericTests.test_nested.<locals>.IntListVisitor.append@  s    a r^   N)rh   ri   rj   r   r  rk   r^   r\   IntListVisitorr/
  >  s    ! !r^   r1
  rn   r   )	r#   r   rc   r   r   rY  r  r   r  )rW   r  r-
  r  r1
  r  s         r\   test_nestedzGenericTests.test_nested+  s}    	ad 	 FKK$%	!Q 	!
 	b			1b'*r^   c                 l     t        d       G fddt                 df fd} |d       y )Nr   c                   *    e Zd Z	 	 ddW  ddddfdZy),GenericTests.test_type_erasure.<locals>.NodeNr  leftNode[T]rightc                 .    || _         || _        || _        y rb   r  r6
  r8
  )rW   r  r6
  r8
  s       r\   r   z5GenericTests.test_type_erasure.<locals>.Node.__init__M  s     #
 	"
r^   NNr   rt  s   r\   r>	  r5
  L  s%    +/,0#a #(# )#r^   r>	  r   c                     |       }    |       } t            |       }j                  t        |             j                  t        |             j                  t        |             j                  |j                  |        j                  |j                  |        j                  |j                  |        y rb   )r   r   r   r   r  )r   r  r   r  r>	  r   rW   s       r\   rk  z+GenericTests.test_type_erasure.<locals>.fooT  s    QAQ
AS	!AMM$q'4(MM$q'4(MM$q'4(QWWa(QWWa(QWWa(r^   r   r   r#   )rW   rk  r>	  r   s   ` @@r\   r6  zGenericTests.test_type_erasureI  s1    CL	#71: 	#		)1 		) 	Br^   c                    t        d      } G d dt        |         } G d d|      }| j                  |j                  d       | j	                  t
              5  |t            d d d        | j	                  t
              5  |t            d d d        | j	                  t
              5  ||    d d d        y # 1 sw Y   TxY w# 1 sw Y   9xY w# 1 sw Y   y xY w)Nr   c                       e Zd Zy))GenericTests.test_implicit_any.<locals>.CNr|   rk   r^   r\   rB  r@
  d  r  r^   rB  c                       e Zd Zy))GenericTests.test_implicit_any.<locals>.DNr|   rk   r^   r\   rE  rB
  g  r  r^   rE  rk   )r   r#   r   r  r   r   r   r   r	  s       r\   test_implicit_anyzGenericTests.test_implicit_anya  s    CL	
 		 	 	))2.y) 	cF	y) 	cF	y) 	aD	 			 		 		 	s$   
B7
C(C7C CCc                      G d dt         t                 } G d d      } G d d||      } |d      }| j                  |j                  d       y )Nc                       e Zd Zy)*GenericTests.test_new_with_args.<locals>.ANr|   rk   r^   r\   r   rF
  u  r  r^   r   c                        e Zd Z fdZ xZS )*GenericTests.test_new_with_args.<locals>.Bc                 4    t         |   |       }||_        |S rb   )r   r  r   rX   r   rV  r   s      r\   r  z2GenericTests.test_new_with_args.<locals>.B.__new__y  s    goc*
r^   r  r   s   @r\   r   rH
  x       r^   r   c                       e Zd Zy)*GenericTests.test_new_with_args.<locals>.CNr|   rk   r^   r\   rB  rM
    r  r^   rB  rk  )r#   r   r   r   rW   r   r   rB  r  s        r\   test_new_with_argszGenericTests.test_new_with_argss  sI    	
 		 		1 	 eH&r^   c                      G d d      } G d dt         t           |      } |d      }| j                  |j                  d       | j                  |j                  d       y )Nc                        e Zd Z fdZ xZS )+GenericTests.test_new_with_args2.<locals>.Ac                 0    || _         t        | 	          y rb   )from_ar   r   rW   r   r   s     r\   r   z4GenericTests.test_new_with_args2.<locals>.A.__init__  s    ! "r^   r   r   s   @r\   r   rR
    s    # #r^   r   c                        e Zd Z fdZ xZS )+GenericTests.test_new_with_args2.<locals>.Cc                 2    || _         t        | 	  |       y rb   )from_cr   r   rU
  s     r\   r   z4GenericTests.test_new_with_args2.<locals>.C.__init__  s    ! %r^   r   r   s   @r\   rB  rW
    s    & &r^   rB  rk  )r#   r   r   rT
  rY
  )rW   r   rB  r  s       r\   test_new_with_args2z GenericTests.test_new_with_args2  sQ    	# 	#	&
A 	& eH5)5)r^   c                 x    G d dt         t                 }| j                  t              5   |d       d d d         G d d      } G d d||      } |d      }| j	                  |j
                  d       | j	                  |j                  d       | j	                  |j                  d	       y # 1 sw Y   |xY w)
Nc                       e Zd Zy)(GenericTests.test_new_no_args.<locals>.ANr|   rk   r^   r\   r   r]
    r  r^   r   rk  c                        e Zd Z fdZ xZS )(GenericTests.test_new_no_args.<locals>.Bc                 4    t         |   |       }d|_        |S )Nr   )r   r  from_b)rX   rV  r   s     r\   r  z0GenericTests.test_new_no_args.<locals>.B.__new__      goc* 

r^   r  r   s   @r\   r   r_
    rK
  r^   r   c                   $     e Zd Zd Z fdZ xZS )(GenericTests.test_new_no_args.<locals>.Cc                     || _         y rb   r   r  s     r\   r   z1GenericTests.test_new_no_args.<locals>.C.__init__  s	    r^   c                 4    t         |   |       }d|_        |S )Nr  )r   r  rY
  rJ
  s      r\   r  z0GenericTests.test_new_no_args.<locals>.C.__new__  rb
  r^   )rh   ri   rj   r   r  r   r   s   @r\   rB  rd
    s     r^   rB  r   r  )r#   r   r   r   r   r   ra
  rY
  rN
  s        r\   test_new_no_argszGenericTests.test_new_no_args  s    	
 	 y) 	eH		 		1 	 eH&3'3'1	 	s   	B00B9c           
         t         t           t        t           t        t        t        f   t
        t           t        d   t        t        t        d      f   t        t           fD ]a  }| j                  |      5  | j                  t        dt        j                  d|       d      5   G d d|      }d d d        d d d        c y # 1 sw Y   xY w# 1 sw Y   zxY w)	Nr  r  )rZ   r	  r   r	  c                       e Zd Zy)4GenericTests.test_subclass_special_form.<locals>.FooNr|   rk   r^   r\   r   rj
        r^   r   )r$   r   r%   r   r{  r   r   rF   rE   rI   ru   r   r   r   r   )rW   rV  r   s      r\   test_subclass_special_formz'GenericTests.test_subclass_special_form  s    SM#J#u*SMDMYs^+,cN
 	C #& ++!Qryy3CC71K'L&MQ#O c  	  s$   91C*C	6C	CCC	c                 ~    t        dd      } G d dt        |         }t        d      } G d d|t        |         }y )	Nr  Tr  c                       e Zd Zy)2GenericTests.test_complex_subclasses.<locals>.BaseNr|   rk   r^   r\   r_	  ro
    rT	  r^   r_	  r   c                       e Zd Zy)1GenericTests.test_complex_subclasses.<locals>.SubNr|   rk   r^   r\   r   rq
    rT	  r^   r   r=
  )rW   r  r_	  r   r   s        r\   test_complex_subclassesz$GenericTests.test_complex_subclasses  s;    v.	74= 	 CL	$
 	r^   c           	         | j                  t        t           j                  t        f       | j                  t        t        t              j                  t        f        G d d      }t        t        fD ]  }|t
        t        t        t        t        j                  t        j                  fD ]I  }| j                  ||      5  | j                  t        d      5  ||   t            d d d        d d d        K  | j                  t         |          j                  t        f       | j                  t         |          j                  t        f       y # 1 sw Y   pxY w# 1 sw Y   xY w)Nc                       e Zd ZefZy)0GenericTests.test_parameter_detection.<locals>.AN)rh   ri   rj   r   r  rk   r^   r\   r   ru
    s	    TNr^   r   )r  subz.* is not a generic class)r   r   r   r  r  r   r   r   rE   r  r  	UnionTyperu   r   r   r   )rW   r   r  r   s       r\   test_parameter_detectionz%GenericTests.test_parameter_detection  s!   a//!6d1g55t<	" 	"  	"Ag|Y@R@RTYTcTcd "\\!\3 "//	;VW "!S	"" ""	" 	ac11A48ac11A48" "" "s$   E#E	(E#E E##E,c           
         t        d       G d dt                 } G fdd      }t        ||t        t        t         t
        t        t        j                  t        j                  f
D ]l  }t        t        fD ]  }| j                  ||      5  | j                  ||f   t           ||t        f          | j                  ||f   t           |t        |f          ||   }| j                  t              5  |t            d d d        d d d         t         t"        j$                  j                   fD ]  }| j                  ||      5  | j                  ||gf   t           ||gt        f          | j                  |g|f   t           |t        g|f          ||g|f   }| j                  t              5  |t            d d d        d d d         o y # 1 sw Y   xY w# 1 sw Y   wxY w# 1 sw Y   0xY w# 1 sw Y   xY w)Nr   c                       e Zd Zy)2GenericTests.test_non_generic_subscript.<locals>.GNr|   rk   r^   r\   r  r{
    r  r^   r  c                       e Zd ZW  fZy)2GenericTests.test_non_generic_subscript.<locals>.AN)rh   ri   rj   r  rt  s   r\   r   r}
    s
    TNr^   r   )r  rv
  )callablerv
  )r   r#   r   r   r  r   rE   r  r  rw
  r   r  ru   r   r   r   r"   r  r  )rW   r  r   r   r  r  r  r   s          @r\   test_non_generic_subscriptz'GenericTests.test_non_generic_subscript  s   CL	
 		" 	" q!T4<$$eoo7 	A E\ \\q\1 $$Qq!tWS\1QV9=$$Qq!tWS\1S!V9=!A**95 #	  {777 \\1!\4 $$QsAvYs^QsCx[A$$QsAvYs^Quax[A1#q&	A**95 #	 	 	  	 sJ   A)G(:
G	G(A0H<
G5	HG%!G((G25G>:HH
N);rh   ri   rj   r9  r  r  r  r   r  r  r  r  r  r  r	  r		  r	  r"	  r+	  r0	  rD	  rJ	  rP	  r[	  rc	  re	  rv	  r	  r	  r	  r	  r	  r	  r	  r$  r	  r	  r	  r	  r	  r	  r   r	  r	  r	  r
  r
  r
  r#
  r2
  r6  rC
  rO
  rZ
  rg
  rl
  rr
  rx
  r
  rk   r^   r\   r  r  	  s+   E&2%(B+0	>

5";562
)&SC
"?H?"I(CTP 	4M4%
NU09: "F"1"'H-.84029& @$+Z6
(8C&+<0$'&*&(>"
9"r^   r  c                   *    e Zd Zd Zd Zd Zd Zd Zy)ClassVarTestsc                     | j                  t              5  t        t        t        f    d d d        | j                  t              5  t        t           t            d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wrb   )r   r   r$   r   r   r   s    r\   r9  zClassVarTests.test_basics  se    y) 	S#X	y) 	SM#	 		 		 	s   A%A1%A.1A:c                     | j                  t        t              d       t        t           }| j                  t        |      d       t        t           }| j                  t        |      dt
        z         y )Nztyping.ClassVartyping.ClassVar[int]ztyping.ClassVar[%s.Employee])r   r   r$   r   r{   rh   rW   cvs     r\   r   zClassVarTests.test_repr
  sY    h):;c]b#9:hb#AH#LMr^   c           	      $   | j                  t        t              5   G d dt        t                    }d d d        | j                  t        t              5   G d dt        t        t
                       }d d d        | j                  t        d      5   G d dt              }d d d        | j                  t        d      5   G d	 d
t        t
                 }d d d        y # 1 sw Y   xY w# 1 sw Y   yxY w# 1 sw Y   WxY w# 1 sw Y   y xY w)Nc                       e Zd Zy)-ClassVarTests.test_cannot_subclass.<locals>.CNr|   rk   r^   r\   rB  r
    r   r^   rB  c                       e Zd Zy)-ClassVarTests.test_cannot_subclass.<locals>.DNr|   rk   r^   r\   rE  r
    r   r^   rE  z Cannot subclass typing\.ClassVarc                       e Zd Zy)-ClassVarTests.test_cannot_subclass.<locals>.ENr|   rk   r^   r\   r  r
    r   r^   r  z'Cannot subclass typing\.ClassVar\[int\]c                       e Zd Zy)-ClassVarTests.test_cannot_subclass.<locals>.FNr|   rk   r^   r\   r  r
    r   r^   r  )r   r   r   r   r$   r   rW   rB  rE  r  r  s        r\   r   z"ClassVarTests.test_cannot_subclass  s    ##I/CD 	DN 	 ##I/CD 	D#' 	 ##I$GI 	H 	 ##I$NP 	HSM 	 		 		 		 		 	/   C" C.C:D"C+.C7:DDc                    | j                  t              5  t                d d d        | j                  t              5   t        t                      d d d        | j                  t              5   t        t        t        t
                            d d d        y # 1 sw Y   |xY w# 1 sw Y   VxY w# 1 sw Y   y xY wrb   )r   r   r$   r   r   r   r   s    r\   rI  zClassVarTests.test_cannot_init!      y) 	J	y) 	DN	y) 	,)D(3-()+	, 	,		 		 		, 	,"   BB(0#B4B%(B14B=c                    | j                  t              5  t        dt        t                  d d d        | j                  t              5  t        t        t               d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wrK  )r   r   r   r$   r   rT   r   s    r\   rL  z ClassVarTests.test_no_isinstance)  e    y) 	)q(3-(	)y) 	&sH%	& 	&	) 	)	& 	&   A)A5)A25A>Nrh   ri   rj   r9  r   r   rI  rL  rk   r^   r\   r
  r
    s    N ,&r^   r
  c                   *    e Zd Zd Zd Zd Zd Zd Zy)
FinalTestsc                    t         t            | j                  t              5  t         t        t        f    d d d        | j                  t              5  t         t           t            d d d        | j                  t              5  t
        t         t               d d d        y # 1 sw Y   nxY w# 1 sw Y   HxY w# 1 sw Y   y xY wrb   )r%   r   r   r   r   r   r   s    r\   r9  zFinalTests.test_basics1  s    c
y) 	#s(O	y) 	#JsO	y) 	!U3Z 	! 	!		 		 		! 	!s#   B$B0B<$B-0B9<Cc                 N   | j                  t        t              d       t        t           }| j                  t        |      d       t        t           }| j                  t        |      dt
        z         t        t        t              }| j                  t        |      d       y )Nztyping.Finalztyping.Final[int]ztyping.Final[%s.Employee]ztyping.Final[tuple[int]])r   r   r%   r   r{   rh   r  r
  s     r\   r   zFinalTests.test_repr:  sz    en53Zb#678_b#>#IJ5:b#=>r^   c           	      $   | j                  t        t              5   G d dt        t                    }d d d        | j                  t        t              5   G d dt        t        t
                       }d d d        | j                  t        d      5   G d dt              }d d d        | j                  t        d      5   G d	 d
t        t
                 }d d d        y # 1 sw Y   xY w# 1 sw Y   yxY w# 1 sw Y   WxY w# 1 sw Y   y xY w)Nc                       e Zd Zy)*FinalTests.test_cannot_subclass.<locals>.CNr|   rk   r^   r\   rB  r
  E  r   r^   rB  c                       e Zd Zy)*FinalTests.test_cannot_subclass.<locals>.DNr|   rk   r^   r\   rE  r
  H  r   r^   rE  zCannot subclass typing\.Finalc                       e Zd Zy)*FinalTests.test_cannot_subclass.<locals>.ENr|   rk   r^   r\   r  r
  L  r   r^   r  z$Cannot subclass typing\.Final\[int\]c                       e Zd Zy)*FinalTests.test_cannot_subclass.<locals>.FNr|   rk   r^   r\   r  r
  P  r   r^   r  )r   r   r   r   r%   r   r
  s        r\   r   zFinalTests.test_cannot_subclassC  s    ##I/CD 	DK 	 ##I/CD 	Ds$ 	 ##I02 	E 	 ##I79 	E#J 	 		 		 		 		 	r
  c                    | j                  t              5  t                d d d        | j                  t              5   t        t                      d d d        | j                  t              5   t        t        t        t
                            d d d        y # 1 sw Y   |xY w# 1 sw Y   VxY w# 1 sw Y   y xY wrb   )r   r   r%   r   r   r   r   s    r\   rI  zFinalTests.test_cannot_initS  s    y) 	G	y) 	DKM	y) 	)&Dx}%&(	) 	)		 		 		) 	)r
  c                    | j                  t              5  t        dt        t                  d d d        | j                  t              5  t        t        t               d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wrK  )r   r   r   r%   r   rT   r   s    r\   rL  zFinalTests.test_no_isinstance[  se    y) 	&q%*%	&y) 	#sE"	# 	#	& 	&	# 	#r
  Nr
  rk   r^   r\   r
  r
  /  s    !? )#r^   r
  c                       e Zd Zd Zd Zy)FinalDecoratorTestsc                 @    d }| j                  |t        |             y )Nc                      y rb   rk   r   s    r\   funcz7FinalDecoratorTests.test_final_unmodified.<locals>.funcd  r  r^   )r   r&   rW   r
  s     r\   test_final_unmodifiedz)FinalDecoratorTests.test_final_unmodifiedc  s    dE$K(r^   c                    t         d        }t          G d d             }| j                  d|j                         | j                  d|j                          G d d      }t         |d               }| j                  ||       | j                  dt	        |d	              G d
 dt
              }t          G d d|             }| j                  |j                  d       t        t               | j                  dt	        t        d	              G d d      }| j                  dt        j                  |d      j                         | j                  dt        j                  |d      j                         | j                  d|j                  j                  j                         | j                  d|j                  j                         y )Nc                       y rb   rk   rk   r^   r\   r
  z3FinalDecoratorTests.test_dunder_final.<locals>.funch      r^   c                       e Zd Zy)2FinalDecoratorTests.test_dunder_final.<locals>.ClsNr|   rk   r^   r\   Clsr
  j  s    r^   r
  Tc                       e Zd ZdZd Zd Zy)6FinalDecoratorTests.test_dunder_final.<locals>.Wrapperr
  c                     || _         y rb   r
  r
  s     r\   r   z?FinalDecoratorTests.test_dunder_final.<locals>.Wrapper.__init__q  r  r^   c                 &     | j                   |i |S rb   r
  r   s      r\   r2  z?FinalDecoratorTests.test_dunder_final.<locals>.Wrapper.__call__s  s     tyy$1&11r^   N)rh   ri   rj   r  r   r2  rk   r^   r\   Wrapperr
  o  s    !I!2r^   r
  c                       y rb   rk   rk   r^   r\   wrappedz6FinalDecoratorTests.test_dunder_final.<locals>.wrappedx  s    r^   F	__final__c                       e Zd Zed        Zy)3FinalDecoratorTests.test_dunder_final.<locals>.Metac                      y)Ncan't set merk   r   s    r\   r
  z=FinalDecoratorTests.test_dunder_final.<locals>.Meta.__final__  s    (6r^   N)rh   ri   rj   rQ  r
  rk   r^   r\   rN	  r
  ~  s    6 6r^   rN	  c                       e Zd Zy)7FinalDecoratorTests.test_dunder_final.<locals>.WithMetaNr|   rk   r^   r\   WithMetar
    s    (+r^   r
  r  r
  c                   ~    e Zd Zeed               Zeed               Zeed               Z	e e
       d               Zy)6FinalDecoratorTests.test_dunder_final.<locals>.Methodsc                      y rb   rk   r  s    r\   	clsmethodz@FinalDecoratorTests.test_dunder_final.<locals>.Methods.clsmethod  s     #r^   c                       y rb   rk   rk   r^   r\   stmethodz?FinalDecoratorTests.test_dunder_final.<locals>.Methods.stmethod      r^   c                      y rb   rk   r   s    r\   propz;FinalDecoratorTests.test_dunder_final.<locals>.Methods.prop  r
  r^   c                      y rb   rk   r   s    r\   cachedz=FinalDecoratorTests.test_dunder_final.<locals>.Methods.cached  s    !r^   N)rh   ri   rj   r&   re  r
  staticmethodr
  rQ  r
  r   r
  rk   r^   r\   Methodsr
    s^    #  #     [!  !r^   r
  r
  r
  )r&   r   r
  r   rl  r   r   r   inspectgetattr_staticr
  fgetr
  )rW   r
  r
  r
  r
  rN	  r
  r
  s           r\   test_dunder_finalz%FinalDecoratorTests.test_dunder_finalg  sp   	 
	 
dDNN+dCMM*	2 	2 
	 
 
gw/eWWk:;	74 	7 
++ 
+++^< 	c
eWS+67	" 	"* 	""7K8BB	
 	""7J7AA	
 	dGLL--778dGNN445r^   N)rh   ri   rj   r
  r
  rk   r^   r\   r
  r
  b  s    )B6r^   r
  c                   $    e Zd Zd Zd Zd Zd Zy)OverrideDecoratorTestsc                     G d d      } G d d|      }| j                  ||        |       }| j                  |j                         d       | j                  d|j                  j                         | j                  d|j                  j                         | j                  |j                         d       | j                  d|j
                  j                         | j                  |j                         d       | j                  dt        |j                  d             | j                  |j                         d       | j                  d|j                  j                         | j                  |j                         d       | j                  dt        |j                  d             | j                  dt        |j                  d             | j                  dt        |j
                  d             | j                  dt        |j                  d             | j                  dt        |j                  d             | j                  dt        |j                  d             y )	Nc                   R    e Zd Zd Zed        Zed        Zed        Zed        Z	y)2OverrideDecoratorTests.test_override.<locals>.Basec                      y rb   rk   r   s    r\   normal_methodz@OverrideDecoratorTests.test_override.<locals>.Base.normal_method  r/  r^   c                      y rb   rk   r  s    r\   class_method_good_orderzJOverrideDecoratorTests.test_override.<locals>.Base.class_method_good_order  s    .1r^   c                      y rb   rk   r  s    r\   class_method_bad_orderzIOverrideDecoratorTests.test_override.<locals>.Base.class_method_bad_order  s    -0r^   c                       y rb   rk   rk   r^   r\   static_method_good_orderzKOverrideDecoratorTests.test_override.<locals>.Base.static_method_good_order  s    ,/r^   c                       y rb   rk   rk   r^   r\   static_method_bad_orderzJOverrideDecoratorTests.test_override.<locals>.Base.static_method_bad_order  s    +.r^   N)
rh   ri   rj   r
  re  r
  r
  r
  r
  r
  rk   r^   r\   r_	  r
    s=    (1 10 0/ /. .r^   r_	  c                       e Zd Zed        Zeed               Zeed               Zeed               Z	eed               Z
y)5OverrideDecoratorTests.test_override.<locals>.Derivedc                      yr   rk   r   s    r\   r
  zCOverrideDecoratorTests.test_override.<locals>.Derived.normal_method  rO  r^   c                      yr   rk   r  s    r\   r
  zMOverrideDecoratorTests.test_override.<locals>.Derived.class_method_good_order       r^   c                      yr   rk   r  s    r\   r
  zLOverrideDecoratorTests.test_override.<locals>.Derived.class_method_bad_order  r
  r^   c                       yr   rk   rk   r^   r\   r
  zNOverrideDecoratorTests.test_override.<locals>.Derived.static_method_good_order  r
  r^   c                       yr   rk   rk   r^   r\   r
  zMOverrideDecoratorTests.test_override.<locals>.Derived.static_method_bad_order  r
  r^   N)rh   ri   rj   r.   r
  re  r
  r
  r
  r
  r
  rk   r^   r\   rb	  r
    s               r^   rb	  r   TF__override__)
r]   r   r
  r   r
  r
  r
  rl  r
  r
  )rW   r_	  rb	  r  s       r\   test_overridez$OverrideDecoratorTests.test_override  s   		/ 		/	d 	. 	gt,9//126dG11>>?dH22??@88:B?dG;;HHI7792>eWW%C%C^TU99;R@dG<<IIJ88:B?eWW%D%DnUV 	eWT%7%7HIeWT%A%A>RSeWT%@%@.QReWT%B%BNSTeWT%A%A>RSr^   c                     G d d      } G d d|      } |       }| j                  |j                  d       | j                  |j                  j                  j                         | j                  |j
                  d       | j                  t        |j
                  d             | j                  t        |j
                  j                  d             y )Nc                   8    e Zd Zedefd       Zedefd       Zy)2OverrideDecoratorTests.test_property.<locals>.Baser   c                      yrK  rk   r   s    r\   correctz:OverrideDecoratorTests.test_property.<locals>.Base.correct      r^   c                      yrK  rk   r   s    r\   wrongz8OverrideDecoratorTests.test_property.<locals>.Base.wrong  r
  r^   N)rh   ri   rj   rQ  r   r
  r
  rk   r^   r\   r_	  r
    s4      s  r^   r_	  c                   L    e Zd Zeedefd              Zeedefd              Zy)3OverrideDecoratorTests.test_property.<locals>.Childr   c                      yNr   rk   r   s    r\   r
  z;OverrideDecoratorTests.test_property.<locals>.Child.correct       r^   c                      yr
  rk   r   s    r\   r
  z9OverrideDecoratorTests.test_property.<locals>.Child.wrong  r
  r^   N)rh   ri   rj   rQ  r.   r   r
  r
  rk   r^   r\   Childr
    sD       s   r^   r
  r   r
  )	r   r
  r   r
  r
  r
  r   rl  fset)rW   r_	  r
  r  s       r\   test_propertyz$OverrideDecoratorTests.test_property  s    	 		D 	 7))1-**778+n=>!1!1>BCr^   c                      G d d       G fdd      }| j                  |j                  d       | j                  t        |j                  d             y )Nc                       e Zd ZdZd ZddZy)>OverrideDecoratorTests.test_silent_failure.<locals>.CustomPropr
  c                     || _         y rb   r  )rW   r
  s     r\   r   zGOverrideDecoratorTests.test_silent_failure.<locals>.CustomProp.__init__  r  r^   Nc                 $    | j                  |      S rb   r  rU  s      r\   rX  zFOverrideDecoratorTests.test_silent_failure.<locals>.CustomProp.__get__  s    yy~%r^   rb   )rh   ri   rj   r  r   rX  rk   r^   r\   
CustomPropr    s    !I!&r^   r  c                   *    e Zd ZeW  d               Zy)@OverrideDecoratorTests.test_silent_failure.<locals>.WithOverridec                      yrK  rk   r   s    r\   r   zEOverrideDecoratorTests.test_silent_failure.<locals>.WithOverride.some
  r
  r^   N)rh   ri   rj   r.   r   )r  s   r\   WithOverrider  	  s      r^   r
  rn   r
  )r   r   r   rl  )rW   r
  r  s     @r\   test_silent_failurez*OverrideDecoratorTests.test_silent_failure  sJ    	& 	&	 	 	**A.!2!2NCDr^   c                 J   d  G fdd      } |       }| j                  |j                  d      d       | j                  |j                  j                         | j                  |j	                  d      d       | j                  |j                  j                         y )Nc                 .     t                fd       }|S )Nc                       | i |S rb   rk   )r   r   rf   s     r\   rw   zTOverrideDecoratorTests.test_multiple_decorators.<locals>.with_wraps.<locals>.wrapper  s    $)&))r^   rx   )rf   rw   s   ` r\   
with_wrapszCOverrideDecoratorTests.test_multiple_decorators.<locals>.with_wraps  s    1X* *Nr^   c                   Z    e Zd ZeW  dedefd              ZW  ededefd              Zy)EOverrideDecoratorTests.test_multiple_decorators.<locals>.WithOverrider  r   c                     |dz   S rK  rk   r(
  s     r\   on_topzLOverrideDecoratorTests.test_multiple_decorators.<locals>.WithOverride.on_top       1ur^   c                     |dz   S r
  rk   r(
  s     r\   	on_bottomzOOverrideDecoratorTests.test_multiple_decorators.<locals>.WithOverride.on_bottom  r  r^   N)rh   ri   rj   r.   r   r  r  )r  s   r\   r
  r    sS        3 3   r^   r
  rn   r   rP  )r   r  r   r
  r  )rW   r
  r  r  s      @r\   test_multiple_decoratorsz/OverrideDecoratorTests.test_multiple_decorators  s}    		 	  >+Q/445++A.2**778r^   N)rh   ri   rj   r
  r
  r  r  rk   r^   r\   r
  r
    s    8TtD4E"9r^   r
  c                       e Zd Zd Zd Zy)	CastTestsc                 0   | j                  t        t        d      d       | j                  t        t        d      d       | j	                  t        t        t        d            t               | j                  t        t        d      d       | j                  t        t        d      d       | j                  t        t        t        t        f   d      d       | j                  t        t        d      d       | j                  t        d d      d       y r   )r   r)   r   r{  r   r   r   r  r   r   r   r   s    r\   r9  zCastTests.test_basics,  s    c2+eR"-d4r?+S1c2+dB,eCJ/4b9fb)2.dB,r^   c                 4    t        dd       t        dd       y Nr   hello)r)   r   s    r\   r   zCastTests.test_errors6  s    RWbr^   Nrh   ri   rj   r9  r   rk   r^   r\   r  r  *  s    -r^   r  c                       e Zd Zd Zd Zy)AssertTypeTestsc                    d}| j                  t        |t              |       | j                  t        |t        t        z        |       | j                  t        |t
              |       | j                  t        |d       |       y r   )r   r(   r   r   r{  r   r  s     r\   r9  zAssertTypeTests.test_basics>  s_    k#s+S1k#sU{3S9k#v.4k#t,c2r^   c                 x    d}| j                  t        |d      |       | j                  t        |d      |       y r  )r   r(   r  s     r\   r   zAssertTypeTests.test_errorsE  s1    k#r*C0k#w/5r^   Nr  rk   r^   r\   r   r   <  s    36r^   r   )ann_module8c                   8    e Zd Zej                  j
                  Zy)NoTypeCheck_OuterN)rh   ri   rj   r#  r%  Innerrk   r^   r\   r%  r%  O  s    ))//Er^   r%  c                   $    e Zd Zej                  Zy)NoTypeCheck_WithFunctionN)rh   ri   rj   r#  NoTypeCheck_functionrk   r^   r\   r(  r(  S  s    &;;r^   r(  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&y%)&ForwardRefTestsc                 ~    G d dt         t                 }|t           }t        |j                  t               t                     }| j                  |d   t        |t                     | j                  |d   |t                  | j                  |d   t               | j                  d|       t        |j                  t               t                     }| j                  |d   t        |t                     t        |j                  t               t                     }| j                  |d   |t                  y )Nc                   P    e Zd ZdefdZ	 	 	 ddddddefd	Zd
ed   fdZdddZ	y))ForwardRefTests.test_basics.<locals>.Noder  c                 .    || _         d x| _        | _        y rb   r:
  )rW   r  s     r\   r   z2ForwardRefTests.test_basics.<locals>.Node.__init__^  s    "
)--	DJr^   Nr6
  zOptional[Node[T]]r8
  r7
  stuffc                      || _         || _        y rb   )r6
  r8
  )rW   r6
  r8
  r0  blahs        r\   add_bothz2ForwardRefTests.test_basics.<locals>.Node.add_bothb  s    
 !	"
r^   nodec                 (    | j                  |d        y rb   r3  rW   r4  s     r\   add_leftz2ForwardRefTests.test_basics.<locals>.Node.add_leftj      dD)r^   c                 (    | j                  d |       y rb   r6  r7  s     r\   	add_rightz3ForwardRefTests.test_basics.<locals>.Node.add_rightm  r9  r^   )NNNrb   )r4  r7
  )
rh   ri   rj   r   r   r   r3  r   r8  r;  rk   r^   r\   r>	  r.  \  sN    .a . -1&*"	#2# )# !$#*Xi%8 **r^   r>	  r6
  r8
  r0  r2  r4  )r#   r   r   r+   r3  r  r  r   r   rN  r8  r;  )rW   r>	  r  
both_hints
left_hintsright_hintss         r\   r9  zForwardRefTests.test_basicsZ  s    	*71: 	*( I#AJJ	68D
F+Xd1g->?G,d1g6G,c2,#AJJ	68D
F+Xd1g->?$Q[[')VXFV,d1g6r^   c                     t        j                  d      }| j                  t              5  t	        d|       d d d        y # 1 sw Y   y xY w)Nr   r   )rc   rA   r   r   r   rW   frs     r\   #test_forwardref_instance_type_errorz3ForwardRefTests.test_forwardref_instance_type_error}  s?    u%y) 	r2	 	 	s   AA
c                     t        j                  d      }| j                  t              5  t	        t
        |       d d d        y # 1 sw Y   y xY w)Nr   )rc   rA   r   r   rT   r   r@  s     r\   #test_forwardref_subclass_type_errorz3ForwardRefTests.test_forwardref_subclass_type_error  s?    u%y) 	 sB	  	  	 s   AAc                     | j                  t              5  t        j                  d       d d d        y # 1 sw Y   y xY wrK  )r   r   rc   rA   r   s    r\   test_forwardref_only_str_argz,ForwardRefTests.test_forwardref_only_str_arg  s3    y) 	!a 	! 	! 	!s   5>c                    t        j                  d      }| j                  |t        j                  d             | j                  t        d   t        t
                  | j                  |t        j                  dt                     t        j                  dt              }| j                  |t        j                  dt                     | j                  |t        j                  dd             y )Nr   module__other_name__)rc   rA   r   r   r   r   rh   )rW   rA  frms      r\   test_forward_equalityz%ForwardRefTests.test_forward_equality  s    u%V..u56DKc3B 1 1% IJh7f//hGHC!2!25AQ!RSr^   c                    t        j                  d      }t        j                  d      }t        j                  d      }t        j                  d      } G d d      }d|d|fd}| j                  t        |t	               t                     ||d       | j                  ||       | j                  ||       | j                  ||       | j                  t        |   t        |          | j                  t        |   t        |          | j                  t        |   t        |          | j                  t        ||f   t        |          | j                  t        ||t        f   t        |t        f          y )NrB  c                       e Zd Zy)4ForwardRefTests.test_forward_equality_gth.<locals>.CNr|   rk   r^   r\   rB  rO    r  r^   r  r   c                      y rb   rk   r  r   s     r\   rk  z6ForwardRefTests.test_forward_equality_gth.<locals>.foo  r  r^   rQ  )
rc   rA   r   r+   r  r  r   r   r   r   )rW   rG  c1_gthrH  c2_gthrB  rk  s          r\   test_forward_equality_gthz)ForwardRefTests.test_forward_equality_gth  s<   s#""3's#""3'	 		6 	f 	 	WYAQRCSTR V$(b4<0DHd1g.DL$q'2r6z*E"I6r63/r3w@r^   c           	         t        j                  d      }t        j                  d      }t        j                  d      }t        j                  d      }d|d|fd}t        |t               t	                      | j                  t        |      t        |             | j                  t        |      t        |             | j                  t        |      t        |             t        j                  dt              }t        j                  dd      }| j                  t        |      t        |             | j                  t        |      t        |             | j                  t        |      t        |             | j                  t        |      t        t        j                  dt                           y )Nr   r  r   c                      y rb   rk   rQ  s     r\   rk  z7ForwardRefTests.test_forward_equality_hash.<locals>.foo  r  r^   rH  rJ  )	rc   rA   r+   r  r  r   r  rh   r   )rW   rG  rR  rH  rS  rk  c3c4s           r\   test_forward_equality_hashz*ForwardRefTests.test_forward_equality_hash  s@   u%""5)u%""5)	6 	f 	sGIvx0b48,ftF|4b4<0uX6u-=>DHd2h/DHd6l3DHd2h/b4(9(9%(Q#RSr^   c                      G d d      }d }d }| j                   |        |              | j                   |        |              y )Nc                       e Zd Zy):ForwardRefTests.test_forward_equality_namespace.<locals>.ANr|   rk   r^   r\   r   r\    r  r^   r   c                  v    t        j                  d      } d| fd}t        |t               t	                      | S )Nr   r   c                      y rb   rk   r   s    r\   r  zPForwardRefTests.test_forward_equality_namespace.<locals>.namespace1.<locals>.fun  r  r^   rc   rA   r+   r  r  )r  r  s     r\   
namespace1zCForwardRefTests.test_forward_equality_namespace.<locals>.namespace1  s3    !!#&Aq 3	684Hr^   c                      t        j                  d      }  G d d      }d| fd}t        |t               t	                      | S )Nr   c                       e Zd Zy)NForwardRefTests.test_forward_equality_namespace.<locals>.namespace2.<locals>.ANr|   rk   r^   r\   r   rc    r   r^   r   c                      y rb   rk   r   s    r\   r  zPForwardRefTests.test_forward_equality_namespace.<locals>.namespace2.<locals>.fun  r  r^   r_  )r  r   r  s      r\   
namespace2zCForwardRefTests.test_forward_equality_namespace.<locals>.namespace2  s?    !!#&A q  3	684Hr^   )r   r   )rW   r   r`  re  s       r\   test_forward_equality_namespacez/ForwardRefTests.test_forward_equality_namespace  s@    	 				 	z|4JL*,7r^   c           	          | j                  t        t        d         d       | j                  t        t        t        dd               d       y )Nr   ztyping.List[ForwardRef('int')]modrH  z,typing.List[ForwardRef('int', module='mod')])r   r   r   rA   r   s    r\   test_forward_reprz!ForwardRefTests.test_forward_repr  sA    d5k*,LMd:eE#BCDG	Ir^   c                 N   dt         d   fd}| j                  t        |t               t	                     dt         t
           i       dt        t        d         t        z  fd}| j                  t        |t               t	                     dt        t
           t        z  i       y )Nr  r   c                      y rb   rk   r  s    r\   rk  z/ForwardRefTests.test_union_forward.<locals>.foo  r  r^   c                      y rb   rk   r  s    r\   rk  z/ForwardRefTests.test_union_forward.<locals>.foo  r  r^   )	r   r   r+   r  r  r   r  rA   r   rW   rk  s     r\   test_union_forwardz"ForwardRefTests.test_union_forward  s    	5: 	 	WYAuQx	*	5C)C/ 	 	WYAuQx#~.	0r^   c                 2   dt         d   fd}| j                  t        |t               t	                     dt         t
           i       dt        t        d         fd}| j                  t        |t               t	                     dt        t
           i       y )Nr  r   c                      y rb   rk   r  s    r\   rk  z/ForwardRefTests.test_tuple_forward.<locals>.foo  r  r^   c                      y rb   rk   r  s    r\   rk  z/ForwardRefTests.test_tuple_forward.<locals>.foo  r  r^   )r   r   r+   r  r  r   r  rA   rm  s     r\   test_tuple_forwardz"ForwardRefTests.test_tuple_forward  s{    	5: 	 	WYAuQx	*	5C) 	 	WYAuQx	*r^   c                     dd}| j                  t        |t               t                     dt        t
           i       y )Nr  c                      y rb   rk   r  s    r\   rk  z0ForwardRefTests.test_double_forward.<locals>.foo  r  r^   )r  zList['int'])r   r+   r  r  r   r   rm  s     r\   test_double_forwardz#ForwardRefTests.test_double_forward  s0    	WYAtCy)	+r^   c                     d }d }d } |       } |       }| j                  ||       | j                  t        |||       y )Nc                  z    t        j                  d      } | }d| fd}t        |t               t	                     }| S )Nr   r   c                      y rb   rk   r   s    r\   r  zPForwardRefTests.test_forward_recursion_actually.<locals>.namespace1.<locals>.fun  rL  r^   r_  r  r   r  rets       r\   r`  zCForwardRefTests.test_forward_recursion_actually.<locals>.namespace1  6    !!#&AAq gi:CHr^   c                  z    t        j                  d      } | }d| fd}t        |t               t	                     }| S )Nr   r   c                      y rb   rk   r   s    r\   r  zPForwardRefTests.test_forward_recursion_actually.<locals>.namespace2.<locals>.fun
  rL  r^   r_  ry  s       r\   re  zCForwardRefTests.test_forward_recursion_actually.<locals>.namespace2  r{  r^   c                     | |k(  S rb   rk   )o1o2s     r\   cmpz<ForwardRefTests.test_forward_recursion_actually.<locals>.cmp  s    8Or^   )r	  r   RecursionError)rW   r`  re  r  r1r2s         r\   test_forward_recursion_actuallyz/ForwardRefTests.test_forward_recursion_actually  sE    			 \\R .#r26r^   c                    t         d   t        t        f    G fdd      } G fdd      } G fdd      } G fdd	      }| j                  t	        |t               t                     t	        |t               t                            | j                  t	        |t               t                     d
t         t        t        t         t        t        t         d   f      f      i       | j                  t	        |t               t                     d
t        t        t         t        t        t         d   f      f   i       | j                  t	        |t               t                     d
t        t         t        t        t         t        t        t         d   f      f      t         t        t        t         d   f      f   i       | j                  t	        |t               t                     d
t        t        t         t        t        t         d   f      t         t        t        t         t        t        t         d   f      f      f   i       y )NValuec                   "    e Zd ZU eW     ed<   y)7ForwardRefTests.test_union_forward_recursion.<locals>.Crk  N)rh   ri   rj   r   r   )r  s   r\   rB  r    s    er^   rB  c                   (    e Zd ZU eW  W f   ed<   y)7ForwardRefTests.test_union_forward_recursion.<locals>.Drk  N)rh   ri   rj   r   r   r  	ValueLists   r\   rE  r    s    ui'((r^   rE  c                   .    e Zd ZU eeW     W f   ed<   y)7ForwardRefTests.test_union_forward_recursion.<locals>.Erk  Nrh   ri   rj   r   r   r   r  s   r\   r  r    s    tE{I-..r^   r  c                   2    e Zd ZU eW  eW     W f   ed<   y)7ForwardRefTests.test_union_forward_recursion.<locals>.Frk  Nr  r  s   r\   r  r  !  s    ud5k9455r^   r  rk  )r   r   r   r   r+   r  r  )rW   rB  rE  r  r  r  r  s        @@r\   test_union_forward_recursionz,ForwardRefTests.test_union_forward_recursion  s   M	c9n%	 		) 	)	/ 	/	6 	6 	79fh?PQSZS\^d^fAgh79fh?eCeCg<N6O1P,P&Q!RS	U79fh?sDsDM7I1J,K'K!LM	O79fh?!%T%T']8J2K-L(L"MN!%T'](:";<=" 	 	79fh? !%T'](:";<!%T%T']8J2K-L(L"MNO" 	r^   c                     dt         dgdf   fd}| j                  t        |t               t	                     dt         t
        gt
        f   i       y )Nr  r   c                      y rb   rk   r  s    r\   rk  z2ForwardRefTests.test_callable_forward.<locals>.foo9  r  r^   )r"   r   r+   r  r  r   rm  s     r\   test_callable_forwardz%ForwardRefTests.test_callable_forward7  sK    	8SE3J' 	 	WYAxQ/0	2r^   c                     dd}| j                  t        |t               t                     dt        dt
        f   i       y )Nr  c                      y rb   rk   r  s    r\   rk  z@ForwardRefTests.test_callable_with_ellipsis_forward.<locals>.fooA  r  r^   .)r  zCallable[..., T])r   r+   r  r  r"   r   rm  s     r\   #test_callable_with_ellipsis_forwardz3ForwardRefTests.test_callable_with_ellipsis_forward?  s7    	 	WYAxQ/0	2r^   c                     G d d      } G d d      }| j                  t        |t                     d   t        t                  | j                  t        |t                     d   t
        t                  | j                  t        |t                     d   t               | j                  t        |t                     d   t
               | j                  t              5  t        |t                     f d d d        y # 1 sw Y   y xY w)	Nc                   R    e Zd ZU dZed   ed<   dZed   ed<   dZded<   dZded	<   y
)5ForwardRefTests.test_special_forms_forward.<locals>.CrT  )ClassVar[int])rP  rU  r  )
Final[int]constr   r$   r   r%   r   N)	rh   ri   rj   r  r@   r   r   r   r   rk   r^   r\   rB  r  I  s5    45Ay01523Ay./3AzAwNr^   rB  c                   "    e Zd ZU dZed   ed<   y)6ForwardRefTests.test_special_forms_forward.<locals>.CFrT  r  r   N)rh   ri   rj   r   r   r   rk   r^   r\   CFr  O  s    $%AtL!%r^   r  r  r   r   r   )r   r+   r  r$   r   r%   r   r   )rW   rB  r  s      r\   test_special_forms_forwardz*ForwardRefTests.test_special_forms_forwardG  s    	 		& 	& 	795c:HSMJ795c:E#JG795c:HE795c:EBy) 	+2wy)*	+ 	+ 	+s   $DDc                 j    | j                  t              5  t        d    d d d        y # 1 sw Y   y xY w)Nz/T)r   SyntaxErrorr#   r   s    r\   test_syntax_errorz!ForwardRefTests.test_syntax_errorY  s,    {+ 	DM	 	 	r  c                 v    dd}| j                  t              5  t        |       d d d        y # 1 sw Y   y xY w)Nc                      y rb   rk   r  s    r\   rk  z6ForwardRefTests.test_delayed_syntax_error.<locals>.foo`  r  r^   )r  zNode[T)r   r  r+   rm  s     r\   test_delayed_syntax_errorz)ForwardRefTests.test_delayed_syntax_error^  s4    	 {+ 	 3	  	  	 s   /8c                 6   t         j                  t         j                  t         j                  t         j                  fD ]@  }| j                  |      5  | j                  t              5  |d    d d d        d d d        B y # 1 sw Y   xY w# 1 sw Y   YxY w)N)formr   )rc   r   Setr5   Dequeru   r   r  )rW   r  s     r\   test_syntax_error_empty_stringz.ForwardRefTests.test_syntax_error_empty_stringf  s|    [[&**fkk6<<H 	D4( &&{3 H 	  s$   B*B0BBBB	c                     dd}| j                  t              5  t        |t                      d d d        y # 1 sw Y   y xY w)Nc                      y rb   rk   r  s    r\   rk  z,ForwardRefTests.test_name_error.<locals>.foon  r  r^   )r  zNoode[T])r   	NameErrorr+   r  rm  s     r\   test_name_errorzForwardRefTests.test_name_errorl  s8    	 y) 	*3)	* 	* 	*s	   8Ac                 `    t         dddi fd       }t        |      }| j                  |i        y )Nr  	whateversr   c                      y rb   rk   r  s    r\   rk  z/ForwardRefTests.test_no_type_check.<locals>.foov      r^   )r2   r+   r   )rW   rk  ths      r\   test_no_type_checkz"ForwardRefTests.test_no_type_checkt  s>    		; 	2 	 
	 C R r^   c                     t          G d d             }t        |j                        }| j                  |i        t         |       j                        }| j                  |i        y )Nc                       e Zd Zdddi fdZy)3ForwardRefTests.test_no_type_check_class.<locals>.Cr  r  r   c                      y rb   rk   r  s    r\   rk  z7ForwardRefTests.test_no_type_check_class.<locals>.C.foo  r  r^   Nrh   ri   rj   rk  rk   r^   r\   rB  r        { r r^   rB  )r2   r+   rk  r   )rW   rB  cthiths       r\   test_no_type_check_classz(ForwardRefTests.test_no_type_check_class}  sY    		 	 
	 QUU#b!QSWW%b!r^   c                     G d d      t          G fdd             }| j                  t        j                        dt        i        G d d|      }| j                  t        |j
                        dt        i       y )Nc                       e Zd ZdefdZy)6ForwardRefTests.test_no_type_check_no_bases.<locals>.Cr   c                      y rb   rk   r   s     r\   r  z;ForwardRefTests.test_no_type_check_no_bases.<locals>.C.meth  s    Cr^   Nr  rk   r^   r\   rB  r    s
    'c'r^   rB  c                       e Zd ZW  Zy)6ForwardRefTests.test_no_type_check_no_bases.<locals>.DN)rh   ri   rj   r  rB  s   r\   rE  r    s    Ar^   rE  r   c                       e Zd ZdefdZy):ForwardRefTests.test_no_type_check_no_bases.<locals>.Childr   c                      y rb   rk   r   s     r\   rk  z>ForwardRefTests.test_no_type_check_no_bases.<locals>.Child.foo  r+  r^   N)rh   ri   rj   r   rk  rk   r^   r\   r
  r    s
    &S&r^   r
  )r2   r   r+   r  r   rk  )rW   rE  r
  rB  s      @r\   test_no_type_check_no_basesz+ForwardRefTests.test_no_type_check_no_bases  sp    	( 	(		 	 
	 	/#s<	'A 	' 			2S#J?r^   c                 t    G d d      } G d d      }t          G d d             }||j                  |j                  j                  |j                  fD ]S  }| j	                  |      5  | j                  |j                         | j                  t        |      i        d d d        U ||fD ]b  }| j	                  |      5  | j                  t              5  |j                   d d d        | j                  t        |      i        d d d        d y # 1 sw Y   xY w# 1 sw Y   ;xY w# 1 sw Y   xY w)	Nc                       e Zd ZU eed<   y)>ForwardRefTests.test_no_type_check_nested_types.<locals>.Otherr  Nr  rk   r^   r\   r  r    rm  r^   r  c                       e Zd ZU eed<   y):ForwardRefTests.test_no_type_check_nested_types.<locals>.Br  Nr  rk   r^   r\   r   r    rm  r^   r   c                   D    e Zd ZU eed<    G d d      Z G d d      ZeZy):ForwardRefTests.test_no_type_check_nested_types.<locals>.Ar  c                   ,    e Zd ZU eed<    G d d      Zy)<ForwardRefTests.test_no_type_check_nested_types.<locals>.A.Br   c                       e Zd ZU eed<   y)>ForwardRefTests.test_no_type_check_nested_types.<locals>.A.B.Cr  Nr  rk   r^   r\   rB  r    s    Fr^   rB  N)rh   ri   rj   r   r   rB  rk   r^   r\   r   r    s     r^   r   c                       e Zd ZU eed<   y)<ForwardRefTests.test_no_type_check_nested_types.<locals>.A.Dr  Nr  rk   r^   r\   rE  r        r^   rE  N)rh   ri   rj   r   r   r   rE  r  rk   r^   r\   r   r    s"    F   Er^   r   )rH  )not_modified)r2   r   rB  rE  ru   r   __no_type_check__r   r+   r   r  r   )rW   r  r   r   rH  r  s         r\   test_no_type_check_nested_typesz/ForwardRefTests.test_no_type_check_nested_types  s+   	 		 				 		 
		 acceeQSS) 	<EE* < 7 78  !6;< <	<
 #AJ 	FL<8 F&&~6 3 223##N<$@"EF F	F	< <3 3F Fs0   +7DD.D"(#D.D	"D+'D..D7	c                 R   t          G d d             }| j                  |j                  j                         | j	                  t        |j                        i        | j                  |j                  j                         | j	                  t        |j                        i        y )Nc                   @    e Zd Zededefd       Zededefd       Zy)IForwardRefTests.test_no_type_check_class_and_static_methods.<locals>.Somer   r   c                      y rb   rk   r   s    r\   stzLForwardRefTests.test_no_type_check_class_and_static_methods.<locals>.Some.st  s    #&r^   r   c                      y rb   rk   )rX   r   s     r\   clzLForwardRefTests.test_no_type_check_class_and_static_methods.<locals>.Some.cl  s    (+r^   N)rh   ri   rj   r
  r   r  re  r  rk   r^   r\   Somer    s2    &c&c& &+3+3+ +r^   r  )r2   r   r  r  r   r+   r  )rW   r  s     r\   +test_no_type_check_class_and_static_methodsz;ForwardRefTests.test_no_type_check_class_and_static_methods  sy    		, 	, 
	, 	1120"51120"5r^   c                 ,   | j                  t        j                         | j                  t              5  t
        j                  j                   d d d        | j                  t              5  t
        j                  j                  j                   d d d        | j                  t        j                         | j                  t              5  t
        j                  j                   d d d        y # 1 sw Y   xY w# 1 sw Y   mxY w# 1 sw Y   y xY wrb   )	r   r%  r  r   r  r#  r&  r(  r)  r   s    r\   test_no_type_check_other_modulez/ForwardRefTests.test_no_type_check_other_module  s    );;<~. 	<));;	<~. 	B))//AA	B 	0BBC~. 	?,,>>	? 	?	< 	<	B 	B	? 	?s#   C2-%C>D
2C;>D
Dc                    dt         dt         fdt         G fdd             }| j                  t              5  j                   d d d        | j                  t              t         t         d       y # 1 sw Y   0xY w)Nr   r   c                       y rb   rk   r  s    r\   r   zBForwardRefTests.test_no_type_check_foreign_functions.<locals>.some  s    r^   c                   8    e Zd ZW  Z eW        Z eW        Zy)?ForwardRefTests.test_no_type_check_foreign_functions.<locals>.AN)rh   ri   rj   
some_aliasre  
some_classr
  some_static)r   s   r\   r   r    s    J$T*J&t,Kr^   r   )r   r   )r   r2   r   r  r  r   r+   )rW   r   r   s     @r\   $test_no_type_check_foreign_functionsz4ForwardRefTests.test_no_type_check_foreign_functions  sw    	 	 	 
	- 	- 
	-
 ~. 	#""	#-s/KL	# 	#s   A88Bc                     t          G d d             }| j                  |j                  j                         | j	                  t        |j                        i        y )Nc                   *    e Zd ZU d Zeegef   ed<   y)4ForwardRefTests.test_no_type_check_lambda.<locals>.Ac                     | S rb   rk   r   s    r\   r0  z=ForwardRefTests.test_no_type_check_lambda.<locals>.A.<lambda>  s    C r^   r*  N)rh   ri   rj   r*  r"   r   r   rk   r^   r\   r   r    s     )8C3%*%7r^   r   )r2   r   r*  r  r   r+   r  s     r\   test_no_type_check_lambdaz)ForwardRefTests.test_no_type_check_lambda  sJ    		8 	8 
	8 	//0.3r^   c                 "    t        t               y rb   )r2   r&  r   s    r\   test_no_type_check_TypeErrorz,ForwardRefTests.test_no_type_check_TypeError  s     	dr^   c                      G d d      } G d d      } G d d      } G d d      }d	t         j                  t           i}||||fD ]  }| j                  t	        |      |        y )
Nc                   6    e Zd ZU dZej
                  e   ed<   y)CForwardRefTests.test_no_type_check_forward_ref_as_string.<locals>.C   rk  N)rh   ri   rj   rk  rc   r$   r   r   rk   r^   r\   rB  r    s    ()C%)r^   rB  c                   "    e Zd ZU dZee   ed<   y)CForwardRefTests.test_no_type_check_forward_ref_as_string.<locals>.Dr  rk  N)rh   ri   rj   rk  r$   r   r   rk   r^   r\   rE  r    s    !"C#"r^   rE  c                       e Zd ZU dZded<   y)CForwardRefTests.test_no_type_check_forward_ref_as_string.<locals>.Er  r
  rk  Nrh   ri   rj   rk  r   rk   r^   r\   r  r    s    *+C'+r^   r  c                       e Zd ZU dZded<   y)CForwardRefTests.test_no_type_check_forward_ref_as_string.<locals>.Fr  r  rk  Nr   rk   r^   r\   r  r    s    #$C$r^   r  rk  )rc   r$   r   r   r+   )rW   rB  rE  r  r  expected_resultclazzs          r\   (test_no_type_check_forward_ref_as_stringz8ForwardRefTests.test_no_type_check_forward_ref_as_string  sm    	* 	*	# 	#	, 	,	% 	% !&//#"67Aq\ 	EE^E2OD	Er^   c                      G d d      } G d d      }||fD ]+  }| j                  t              5  t        |       d d d        - y # 1 sw Y   8xY w)Nc                       e Zd ZU dZded<   y)GForwardRefTests.test_nested_classvar_fails_forward_ref_check.<locals>.Er  z%typing.ClassVar[typing.ClassVar[int]]rk  Nr   rk   r^   r\   r  r    s    ;<C8<r^   r  c                   "    e Zd ZU dZed   ed<   y)GForwardRefTests.test_nested_classvar_fails_forward_ref_check.<locals>.Fr  r  rk  N)rh   ri   rj   rk  r$   r   rk   r^   r\   r  r
    s    -.C/*.r^   r  )r   r   r+   )rW   r  r  r  s       r\   ,test_nested_classvar_fails_forward_ref_checkz<ForwardRefTests.test_nested_classvar_fails_forward_ref_check  s[    	= 	=	/ 	/ V 	&E""9- &u%& &	&& &s   AA	c                    t         d        }| j                  |j                  d       |dddi fd       }| G d d             }| j                  |j                  d	       t        |      }| j                  |i        t        |j                        }| j                  |i        t         |       j                        }| j                  |i        y )
Nc                     | S rb   rk   r
  s    r\   magic_decoratorz@ForwardRefTests.test_meta_no_type_check.<locals>.magic_decorator  s    Kr^   r  r  r  r   c                      y rb   rk   r  s    r\   rk  z4ForwardRefTests.test_meta_no_type_check.<locals>.foo  r  r^   c                       e Zd Zdddi fdZy)2ForwardRefTests.test_meta_no_type_check.<locals>.Cr  r  r   c                      y rb   rk   r  s    r\   rk  z6ForwardRefTests.test_meta_no_type_check.<locals>.C.foo  r  r^   Nr  rk   r^   r\   rB  r    r  r^   rB  rk  )r3   r   rh   r+   rk  )rW   r  rk  rB  r  r  r  s          r\   test_meta_no_type_checkz'ForwardRefTests.test_meta_no_type_check  s    	 	 
!	 	113DE		; 	2 	 
	 
	 	 
	 	u-C R QUU#b!QSWW%b!r^   c                     d}i }t        ||       t        |d   j                        }| j                  ||d   |d   d       y )Nz^class C:
    def foo(self, a: 'C') -> 'D': pass
class D:
    def bar(self, b: 'D') -> C: pass
rB  rE  )r  r   )rz  r+   rk  r   )rW   r  r|  hintss       r\   test_default_globalsz$ForwardRefTests.test_default_globals  sH    9
 T2r#w{{+bgC ABr^   c                 :   | j                  t        t        t                     d   t        t                  | j                  t        t        t                     d   t        t                  | j                  t        t        t                     d   t               y )Nr  )r   r  Loopr  r%   r   r   r   s    r\   test_final_forward_refz&ForwardRefTests.test_final_forward_ref'  sd    T79-f5uT{CCgi08%*ECgi08%@r^   c                     t        d      }| j                  |dz  t        |df          | j                  d|z  t        d|f          y r  )rA   r   r   r  s     r\   r  zForwardRefTests.test_or,  sC    sOS%3-0q%Q-0r^   N)'rh   ri   rj   r9  rB  rD  rF  rL  rT  rY  rf  ri  rn  rr  ru  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rk   r^   r\   r+  r+  X  s    !7F
 
!TA*T,80I
0*+72@22+$
 *!
"@ F:6	?M4
E&"2	CA
1r^   r+  c                     d| z  |z   S )NrP  rk   r  s     r\   cached_funcr  3  s    q519r^   c                   2    e Zd Zed        Zed        Zd Zy)MethodHolderc                      y rb   rk   r  s    r\   r
  zMethodHolder.clsmethod9  s    r^   c                       y rb   rk   rk   r^   r\   r
  zMethodHolder.stmethod;  r
  r^   c                      y rb   rk   r   s    r\   r  zMethodHolder.method=  s    cr^   N)rh   ri   rj   re  r
  r
  r
  r  rk   r^   r\   r  r  8  s!      r^   r  c                   `    e Zd Zd Zd Zed        Zd Z ed e	d             d        Z
d Zy	)
OverloadTestsc                 ~    | j                  t              5  t        d        } |        d d d        y # 1 sw Y   y xY w)Nc                       y rb   rk   rk   r^   r\   r2  z/OverloadTests.test_overload_fails.<locals>.blahE  s    r^   )r   r<  r   rW   r2  s     r\   test_overload_failsz!OverloadTests.test_overload_failsB  s?    23 	  F	 	 	r   c                 0    t         d        }d } |        y )Nc                       y rb   rk   rk   r^   r\   r2  z2OverloadTests.test_overload_succeeds.<locals>.blahL  r  r^   c                       y rb   rk   rk   r^   r\   r2  z2OverloadTests.test_overload_succeeds.<locals>.blahP  r  r^   r   r&  s     r\   test_overload_succeedsz$OverloadTests.test_overload_succeedsK  s     		 
		 	r^   c                 z   t        dt        d             5  | j                  t        j                  i        t        t               t        t               | j                  t        j                  t              g        | j                  t        j                  t              g        d d d        y # 1 sw Y   y xY w)Ntyping._overload_registryc                       t        t              S rb   r   r&  rk   r^   r\   r0  zCOverloadTests.test_overload_on_compiled_functions.<locals>.<lambda>X  s    {4'8 r^   )	r
   r   r   rc   _overload_registryr   sumprintr   r   s    r\   #test_overload_on_compiled_functionsz1OverloadTests.test_overload_on_compiled_functionsU  s    .89; 	> V66; SMUO V11#6;V11%8"=	> 	> 	>s   BB11B:c                 T    d }|}t        |       d }|}t        |       d }|||gfS )Nc                       y rb   rk   rk   r^   r\   r2  z,OverloadTests.set_up_overloads.<locals>.blahe  r  r^   c                       y rb   rk   rk   r^   r\   r2  z,OverloadTests.set_up_overloads.<locals>.blahk  r  r^   c                       y rb   rk   rk   r^   r\   r2  z,OverloadTests.set_up_overloads.<locals>.blahq  r  r^   r+  )rW   r2  	overload1	overload2s       r\   set_up_overloadszOverloadTests.set_up_overloadsd  s?    	 		 		 i+++r^   r.  c                       t        t              S rb   r0  rk   r^   r\   r0  zOverloadTests.<lambda>x  s    K- r^   c                    | j                  t        j                  i        | j                         \  }}| j	                  t        j                  i        | j                  t        t        |            |       d }t        |       |}d }| j                  t        t        |            |g       d }| j                  t        t        |            g        t                | j                  t        j                  i        | j                  t        |      g        d }| j                  t        |      g        | j                  t        j                  i        y )Nc                       y rb   rk   rk   r^   r\   some_other_funcz=OverloadTests.test_overload_registry.<locals>.some_other_func  r  r^   c                       y rb   rk   rk   r^   r\   r?  z=OverloadTests.test_overload_registry.<locals>.some_other_func  r  r^   c                       y rb   rk   rk   r^   r\   not_overloadedz<OverloadTests.test_overload_registry.<locals>.not_overloaded  s    dr^   c                       y rb   rk   rk   r^   r\   the_only_onez:OverloadTests.test_overload_registry.<locals>.the_only_one  r  r^   )	r   rc   r1  r;  r   r  r   r   r   )rW   impl	overloadsr?  other_overloadrB  rD  s          r\   test_overload_registryz$OverloadTests.test_overload_registryw  s    	22B7//1iF55r:mD12I>#!(#mO<=?OP"mN;<bA 	22B7t,b1 	!|4b922B7r^   c                     t        d      D ]9  }| j                         \  }}| j                  t        t	        |            |       ; y r
  )rr   r;  r   r  r   )rW   _rE  rF  s       r\   test_overload_registry_repeatedz-OverloadTests.test_overload_registry_repeated  sC    q 	CA"335OD)T-"56	B	Cr^   N)rh   ri   rj   r'  r,  rK   r4  r;  r
   r   rH  rK  rk   r^   r\   r#  r#  @  sP     > >,& &-.08088Cr^   r#  )
ann_moduleann_module2ann_module3ann_module5ann_module6T_ac                   8    e Zd Zd Zdej
                  e   fdZy)AwaitableWrapperc                     || _         y rb   r  rW   r  s     r\   r   zAwaitableWrapper.__init__  	    
r^   r   c              #   *   K   d  | j                   S wrb   rU  r   s    r\   	__await__zAwaitableWrapper.__await__  s     zzs   N)rh   ri   rj   r   rc   IteratorrQ  rY  rk   r^   r\   rS  rS    s    6??3/ r^   rS  c                   d    e Zd Zdej                  e   fdZdej                  e   fdZdefdZ	y)AsyncIteratorWrapperr  c                     || _         y rb   rU  rV  s     r\   r   zAsyncIteratorWrapper.__init__  rW  r^   r   c                     | S rb   rk   r   s    r\   	__aiter__zAsyncIteratorWrapper.__aiter__  s    r^   c                 J   K   | j                    d {   }|r|S t        7 wrb   )r  StopAsyncIteration)rW   datas     r\   	__anext__zAsyncIteratorWrapper.__anext__  s%     ZZK$$	  s   #!#N)
rh   ri   rj   rc   r  rQ  r   AsyncIteratorr_  rc  rk   r^   r\   r\  r\    s:    fooc2 6//4 % %r^   r\  c                       e Zd ZdefdZd Zy)ACMr   c                    K   ywr   rk   r   s    r\   
__aenter__zACM.__aenter__  s	        c                    K   y wrb   rk   )rW   etyper  tbs       r\   	__aexit__zACM.__aexit__  s	     ri  N)rh   ri   rj   r   rh  rm  rk   r^   r\   rf  rf    s    # r^   rf  c                       e Zd ZU eed<   y)r   r   N)rh   ri   rj   r{  r   rk   r^   r\   r   r     s    Hr^   r   c                   <    e Zd ZU dZeed       ed<   eed<   eed<   y)r   Nr   r   r   )rh   ri   rj   r   r$   r   r   r   rk   r^   r\   r   r     s    !%Ax%
F
Fr^   r   c                   ,    e Zd ZU  e       Zed    ed<   y)CSubrQ  N)rh   ri   rj   r   rQ  r$   r   rk   r^   r\   rq  rq    s    #Axr^   rq  c                   (    e Zd ZU g Zeee      ed<   y)r  lstN)rh   ri   rj   rs  r$   r   r   r   rk   r^   r\   r  r    s    C$q'	r^   r  c                       e Zd ZU ed    ed<   y)r  r  N)rh   ri   rj   r%   r   rk   r^   r\   r  r    s    
-r^   r  c                   "    e Zd ZU d ed<   ded<   y)NoneAndForwardparentNmeaningrs  rk   r^   r\   rv  rv    s    Mr^   rv  c                   "    e Zd ZU eed<   eed<   y)CoolEmployeer  coolNrh   ri   rj   r   r   r   rk   r^   r\   rz  rz    s    
I
Ir^   rz  c                   &    e Zd ZU eed<   dZeed<   y)CoolEmployeeWithDefaultr  r   r{  N)rh   ri   rj   r   r   r{  r   rk   r^   r\   r~  r~    s    
ID#Mr^   r~  c                       e Zd ZU eed<   d Zy)XMethr   c                      d| j                   z  S r
  r   r   s    r\   doublezXMeth.double  s    466zr^   N)rh   ri   rj   r   r   r  rk   r^   r\   r  r    s    
Fr^   r  c                   2    e Zd ZU eed<   dZeed<   d Zd Zy)XReprr   rn   r   c                 8    | j                    d| j                   S )Nz -> r  r   s    r\   __str__zXRepr.__str__  s    &&dffX&&r^   c                      yrb  rk   rW   rc  s     r\   __add__zXRepr.__add__  s    r^   N)rh   ri   rj   r   r   r   r  r  rk   r^   r\   r  r    s    
FAsJ'r^   r  Labelr  c                   "    e Zd ZU eed<   eed<   y)Point2Dr   r   Nr  rk   r^   r\   r  r    r  r^   r  c                   "    e Zd ZU eed<   eed<   y)Point2DGenericr  r   Nrh   ri   rj   r   r   rk   r^   r\   r  r    s    DDr^   r  c                       e Zd ZU eed<   y)r   r   Nr  rk   r^   r\   r   r     r  r^   r   Ftotalc                       e Zd ZU eed<   y)
BarGenericr   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd Zy)LabelPoint2DNr|   rk   r^   r\   r  r    r   r^   r  c                   "    e Zd ZU eed<   eed<   y)Options	log_levellog_pathNr  rk   r^   r\   r  r    s    NMr^   r  c                   (    e Zd ZU eed<   ee   ed<   y)
TotalMovietitleri  N)rh   ri   rj   r   r   r7   r   rk   r^   r\   r  r    s    J
c
r^   r  c                   (    e Zd ZU ee   ed<   eed<   y)NontotalMovier  ri  N)rh   ri   rj   r8   r   r   r   rk   r^   r\   r  r    s    C=
Ir^   r  c                       e Zd ZU ee   ed<   y)ParentNontotalMovier  Nrh   ri   rj   r8   r   r   rk   r^   r\   r  r    s    C=r^   r  c                       e Zd ZU ee   ed<   y)ChildTotalMovieri  Nrh   ri   rj   r7   r   r   rk   r^   r\   r  r  
  s    
c
r^   r  c                   2    e Zd ZU eeee   df   df   ed<   y)ParentDeeplyAnnotatedMovieri	  another levelr  N)rh   ri   rj   r@   r8   r   r   rk   r^   r\   r  r    s     Yx}h67HIIr^   r  c                   (    e Zd ZU eeedf      ed<   y)ChildDeeplyAnnotatedMovie  ri  N)rh   ri   rj   r7   r@   r   r   rk   r^   r\   r  r    s    
iT	*
++r^   r  c                   B    e Zd ZU eee   df   ed<   eeedf      ed<   y)AnnotatedMovieri	  r  r  ri  N	rh   ri   rj   r@   r8   r   r   r7   r   rk   r^   r\   r  r    s*    Xc]H,--
iT	*
++r^   r  c                   L    e Zd ZU eeee   df   df   ed<   eeedf      ed<   y)DeeplyAnnotatedMovieri	  r  r  r  ri  Nr  rk   r^   r\   r  r    s4    Yx}h67HII
iT	*
++r^   r  c                   .    e Zd ZU ed   ed<   ed   ed<   y)WeirdlyQuotedMovie)z"Annotated[Required[str], "foobar"]r  r  zAnnotated[int, 2000]ri  N)rh   ri   rj   r@   r   r7   rk   r^   r\   r  r    s    JKK
,
--r^   r  c                   "    e Zd ZU ded<   ded<   y)HasForeignBaseClassr  
some_xreprzmod_generics_cache.Aother_aNrs  rk   r^   r\   r  r    s    ##r^   r  amc                 x   K   | 4 d {   }|cd d d       d {    S 7 7 # 1 d {  7  sw Y   y xY wwrb   rk   )r  r   s     r\   g_withr  #  s=       Q      s0   :!:%:#::7.7:r   c                   v    e Zd Zej                  dd       Zej                  ej                  dd              Zy)ForRefExamplec                      y rb   rk   r   s    r\   r
  zForRefExample.func0  s    r^   c                      y rb   rk   r   s    r\   nestedzForRefExample.nested4  s     	r^   N)rW   r  )rh   ri   rj   rL  decr
  r  rk   r^   r\   r  r  /  s<    ^^  ^^^^  r^   r  c                       e Zd Zd Zd Z ed      d        Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)GetTypeHintTestsc                 B   | j                  t              5  t        d       d d d        | j                  t              5  t        d       d d d        | j                  t              5  t        d        d d d        y # 1 sw Y   \xY w# 1 sw Y   ?xY w# 1 sw Y   y xY w)N{   r  )r   r   r  r   s    r\   (test_get_type_hints_from_various_objectsz9GetTypeHintTests.test_get_type_hints_from_various_objects;  s    y) 	H	y) 	J	y) 	I	 			 		 		 	s"   A=B	(B=B	BBc                    dt         t        t        f   t        t        t        t        z  d}| j	                  t        t              |       | j	                  t        t              i        | j	                  t        t              i        y )Nr   )rn   rf   r   r   r  )	r   r   r   r{  r   r  rL  rM  rN  )rW   ann_module_type_hintss     r\   test_get_type_hints_modulesz,GetTypeHintTests.test_get_type_hints_modulesD  sa    $%E#s(O#CVY\aVa bZ*?@[)2.[)2.r^   z	known bugc                     t         t        j                     t         t        j                     d}| j	                  t        t              |       y )N)	default_a	default_b)r   rM   r   r   r   r  )rW   	mgc_hintss     r\   &test_get_type_hints_modules_forwardrefz7GetTypeHintTests.test_get_type_hints_modules_forwardrefJ  s@    
 #++=+?+?"@"*+=+?+?"@B	/0)<r^   c                    | j                  t        t        j                        dt        t        j                     i       | j                  t        t        j                        t               | j                  t        t        j                        dt        d       | j                  t        t        j                        t        t        t        t        j                     d       | j                  t        t        j                        dt        i       | j                  t        t        j                        dt        t        j                     i       | j                  t        t        j                        t        t        d       | j                  t        t        j                         dt        i       | j                  t        t"              t"        t        d       d       | j                  t        t$              t&        t(        j*                  t(        j,                  d	       | j                  t        t&        j.                        t        t        d       | j                  t        t(        j,                        t(        j,                  j*                  t(        j,                  j*                  t(        j*                  d
       y )Nr   r  )123r  )r  r  r   rQ  r  r   )rw  rx  )r  r  some_b)my_inner_a1my_inner_a2
my_outer_a)r   r  rL  rB  r   r   j_classr&  r  r   rE  r   r  r   h_classr  rk  rv  r  r  rM   r   r   r  r   s    r\   test_get_type_hints_classesz,GetTypeHintTests.test_get_type_hints_classesS  s   Z\\*x
56	8c*"4"45t<Z\\*Cd,CDZ\\*"8JLL3IJ	LZ\\*S#J7Z//0x
56	8Z\\*#C,@AZ^^,sCj9^,$2tDzJ	L01(-:L:N:N$6$8$8:	; 	U]]+"-	//112);)=)=)?)?);)=)=)?)?(:(<(<>	?r^   c                 Z     G d d      }| j                  t        |      dt        i       y )Nc                       e Zd ZU dZeed<   y)ZGetTypeHintTests.test_get_type_hints_classes_no_implicit_optional.<locals>.WithNoneDefaultNfield)rh   ri   rj   r  r   r   rk   r^   r\   WithNoneDefaultr  l  s    E3r^   r  r  )r   r  r   )rW   r  s     r\   0test_get_type_hints_classes_no_implicit_optionalzAGetTypeHintTests.test_get_type_hints_classes_no_implicit_optionalk  s'    	 	 	_-~>r^   c                    t          G d d             }| j                  |j                         | j                  |j                  j                  j                         | j                  t        t        j                  j                        i         G d dt        t                 }t          G d d|             }| j                  t        |j                        dt        i       y )Nc                        e Zd Z G d d      Zy)>GetTypeHintTests.test_respect_no_type_check.<locals>.NoTpCheckc                       e Zd ZddZy)BGetTypeHintTests.test_respect_no_type_check.<locals>.NoTpCheck.Innc                      y rb   rk   r   s     r\   r   zKGetTypeHintTests.test_respect_no_type_check.<locals>.NoTpCheck.Inn.__init__u  rc  r^   N)r   z
not a typer   rk   r^   r\   Innr  t  s    8r^   r  N)rh   ri   rj   r  rk   r^   r\   	NoTpCheckr  r  s    9 9r^   r  c                       e Zd ZdefdZy):GetTypeHintTests.test_respect_no_type_check.<locals>.ABaser   c                      y rb   rk   r   s    r\   r  z?GetTypeHintTests.test_respect_no_type_check.<locals>.ABase.methz  s    cr^   Nr  rk   r^   r\   ABaser  y  s
    !!r^   r  c                       e Zd Zy)8GetTypeHintTests.test_respect_no_type_check.<locals>.DerNr|   rk   r^   r\   Derr  {  s    r^   r  r   )r2   r   r  r  r   r   r  rM  NTCr  r#   r   r   )rW   r  r  r  s       r\   test_respect_no_type_checkz+GetTypeHintTests.test_respect_no_type_checkq  s    		9 	9 
	9 		334	..@@A[__112B7	"GAJ 	"	% 
UZZ3*5r^   c                    | j                  t        t              i        | j                  t        t              i        | j                  t        t              i        | j                  t        t
              i        | j                  t        t        j                        i        | j                  t        t               j                        i        | j                  t        t        j                        i        y rb   )
r   r  r   r   rZ  r  r  r  r   joinr   s    r\    test_get_type_hints_for_builtinsz1GetTypeHintTests.test_get_type_hints_for_builtins  s    S2&TB'S2&S2&V^^,b1VX--.3SXX+r^   c                     d }d|j                   d<   | j                  t        |      dt        i       dd}| j                  t        |      dt	        d       i       y )Nc                      y rb   rk   r  s     r\   testfz6GetTypeHintTests.test_previous_behavior.<locals>.testf  ry  r^   r   r   c                      y rb   rk   r   s    r\   testgz6GetTypeHintTests.test_previous_behavior.<locals>.testg  r  r^   )r   N)r   r   r  r   r   )rW   r  r  s      r\   test_previous_behaviorz'GetTypeHintTests.test_previous_behavior  sM    %*c"Uc3Z0Uc4:%67r^   c                      G d d      } G d d      } |       }ddi|_         | j                  t        |t                     d|i       y )Nc                       e Zd Zy)KGetTypeHintTests.test_get_type_hints_for_object_with_annotations.<locals>.ANr|   rk   r^   r\   r   r    r   r^   r   c                       e Zd Zy)KGetTypeHintTests.test_get_type_hints_for_object_with_annotations.<locals>.BNr|   rk   r^   r\   r   r    r   r^   r   r   )r   r   r  r  )rW   r   r   r   s       r\   /test_get_type_hints_for_object_with_annotationsz@GetTypeHintTests.test_get_type_hints_for_object_with_annotations  s<    C #JQ)C84r^   c           	      L   | j                  t        t        j                  t        j                        dt
        j                  t        j                     i       | j                  t        t        t                     t        t        t        t              t        d       | j                  t        t        t                     t        t           t        t        t        t        t              d       | j                  t        t              dt        t        t              i       y )Nvar)r   r   r   )rQ  r   r   r   rs  )r   r  rM  CVr  rc   r$   r   r  r   r   rq  r  r   r   r   s    r\   test_get_type_hints_ClassVarz-GetTypeHintTests.test_get_type_hints_ClassVar  s    [^^[-A-AB!@A	CQ	*"(1+)>SI	KT79-'~Cc'46	7 	Q%$q'):!;<r^   c                     dt         i}| j                  t        t         j                        |       | j                  t        t         j                        |       y )NrW   )r  r   r  r
  r  )rW   expectss     r\   ,test_get_type_hints_wrapped_decoratored_funcz=GetTypeHintTests.test_get_type_hints_wrapped_decoratored_func  sB    =)]//0':]112G<r^   c                 <   dt         d   fd}t        t        df   }| j                  t	        |t               t                     dt         t           i       | j                  t	        |t               t               d      dt         t        t        df      i       dt        t        d         fd}t        t        df   }| j                  t	        |t               t                     dt        t           i       | j                  t	        |t               t               d      dt        t        t        df      i       t        t        t        df   d	f   }d|fd
}| j                  t	        |t               t                     d   t        t        d	f          | j                  t	        |t               t               d      d   |       t        t        t        df   d	f   }d|fd}| j                  t	        |t               t                     d   t        t        d	f          | j                  t	        |t               t               d      d   |       dt        j                  d	t        t         t           df   f   dt        j                  t        t        t        df   f   fd}| j                  t	        |t               t                     t        j                  d	t         t           f   t        j                  t        t        f   d       t        j                  d	t         t           f   }d|fd}| j                  t	        |t               t               d      d   |       t        j                  t        t         z  df   }d|fd}	| j                  t	        |	t               t                     dt        t         z  i       | j                  t	        |	t               t               d      dt        j                  t        t         z  df   i       y )Nr   r  c                      y rb   rk   r   s    r\   ri	  z>GetTypeHintTests.test_get_type_hints_annotated.<locals>.foobar  s    #r^   rn   r  Tinclude_extrasc                      y rb   rk   r   s    r\   ri	  z>GetTypeHintTests.test_get_type_hints_annotated.<locals>.foobar  r_  r^   )rn   r   .c                      y rb   rk   r   s    r\   rq	  z>GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo  r  r^   c                      y rb   rk   r   s    r\   rq	  z>GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo  r  r^   r  r   mutablec                      y rb   rk   r  s     r\   rs	  z?GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo2  s    DGr^   r  c                      y rb   rk   r   s    r\   barfoo3z?GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo3  r  r^   c                      y rb   rk   r   s    r\   barfoo4z?GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo4  r  r^   )r   r@   r   r   r+   r  r  r  rA   r   r   r  rc   r"   r   r   r{  )
rW   ri	  r  BArq	  rs	  BA2r  BA3r  s
             r\   test_get_type_hints_annotatedz.GetTypeHintTests.test_get_type_hints_annotated  sN   %d3i%c7l#679fh7$s)	
 	679fhtL$yg./0	

 	2d:c?+1c7l#679fh7$s)	
 	679fhtL$yg./0	

 9QY',-b	68DSI5QRTWQW=Y679fhtLSQ	

 9QY',-b	68DSI5QRTWQW=Y679fhtLSQ	

	HvsId1gw6F,G'GH 	H||C1i<)@$@A	H7GIvx8//#tAw,/fll366JK	

 ooc47l+ s 7GIvxMcR	
 sU{G34 s 7GIvx8#+	
 	7GIvxM&""3;#789	
r^   c           	         dt         t        t        t        df      z  fd}| j	                  t        |      dt         t        t           z  i       | j	                  t        |d      dt         t        t        t        df      z  i       y )Nr   metac                      y rb   rk   r   s    r\   
with_unionzKGetTypeHintTests.test_get_type_hints_annotated_in_union.<locals>.with_union  s    sr^   Tr  )r   r  r@   r   r   r+   )rW   r  s     r\   &test_get_type_hints_annotated_in_unionz7GetTypeHintTests.test_get_type_hints_annotated_in_union  sr    B#YsF{%; <<B
3c3c?5KL:d;#YsF{3445	
r^   c                    t         t        df    G fddt        t                 }| j                  t	        |j
                  t               t                     |t           |t           d       | j                  t	        |j
                  t               t               d      |t              |t           d       | j                  t	        |j                  t               t                     |t           |t           d       y )NConstc                   .    e Zd ZddZdW  d   ddfdZy)BGetTypeHintTests.test_get_type_hints_annotated_refs.<locals>.MySetrc  r   MySet[T]c                      y rb   rk   r  s     r\   __ior__zJGetTypeHintTests.test_get_type_hints_annotated_refs.<locals>.MySet.__ior__      r^   c                      y rb   rk   r  s     r\   __iand__zKGetTypeHintTests.test_get_type_hints_annotated_refs.<locals>.MySet.__iand__  r!  r^   N)rc  zConst[MySet[T]]r   r  )rh   ri   rj   r   r#  )r  s   r\   MySetr    s     eJ&7 J r^   r$  )rc  r   Tr  )	r@   r   r#   r   r+   r#  r  r  r   )rW   r$  r  s     @r\   "test_get_type_hints_annotated_refsz3GetTypeHintTests.test_get_type_hints_annotated_refs  s    !W*%	GAJ 	 	5>>79fh?Ah%(3	

 	5>>79fhtTE!Hoq:	

 	5==')VX>Ah%(3	
r^   c                     ddt         t        df   fd}| j                  t        |      dt        i       | j                  t        |d      dt         t        df   i       y )Nr   rb  c                      y rb   rk   r   s    r\   annotated_with_none_defaultzeGetTypeHintTests.test_get_type_hints_annotated_with_none_default.<locals>.annotated_with_none_default  s    3r^   Tr  rb   )r@   r   r   r+   )rW   r(  s     r\   /test_get_type_hints_annotated_with_none_defaultz@GetTypeHintTests.test_get_type_hints_annotated_with_none_default	  s]    N9S&[+AN67#J	
 	6tL)CK()	
r^   c                 Z     G d d      }| j                  t        |      dt        i       y )Nc                       e Zd ZU eZded<   y)IGetTypeHintTests.test_get_type_hints_classes_str_annotations.<locals>.Foor   r   N)rh   ri   rj   r   r   r   rk   r^   r\   r   r,    s    AFr^   r   r   )r   r+   r   r  s     r\   +test_get_type_hints_classes_str_annotationsz<GetTypeHintTests.test_get_type_hints_classes_str_annotations  s'    	 	 	,sCj9r^   c                      G d d      }d|_         | j                  dt        j                         | j	                  t        |      i        y )Nc                       e Zd Zy)BGetTypeHintTests.test_get_type_hints_bad_module.<locals>.BadModuleNr|   rk   r^   r\   	BadModuler0    r  r^   r1  bad)ri   rN  sysmodulesr   r+   )rW   r1  s     r\   test_get_type_hints_bad_modulez/GetTypeHintTests.test_get_type_hints_bad_module  s=    	 	$	,	2B7r^   c                      G d d      } G d d|      }dx|_         |_         | j                  dt        j                         | j	                  t        |      t        t        d       y )Nc                       e Zd ZU eed<   y)JGetTypeHintTests.test_get_type_hints_annotated_bad_module.<locals>.BadBaserk  N)rh   ri   rj   r  r   rk   r^   r\   BadBaser8  &  s    Jr^   r9  c                       e Zd ZU eed<   y)JGetTypeHintTests.test_get_type_hints_annotated_bad_module.<locals>.BadTyper*  Nrz	  rk   r^   r\   BadTyper;  (  s    Ir^   r<  r2  r\  )ri   rN  r3  r4  r   r+   r  r  )rW   r9  r<  s      r\   (test_get_type_hints_annotated_bad_modulez9GetTypeHintTests.test_get_type_hints_annotated_bad_module$  sV    	 		g 	277W/,0%2MNr^   c                     t        t              }| j                  |dt        t           i       t        t        j
                        }| j                  |dt        i       y )Nr  r  )r+   rO  r   r%   r   MyClass)rW   r  s     r\   test_forward_ref_and_finalz+GetTypeHintTests.test_forward_ref_and_final.  sJ    {+s 45{223% 01r^   c                 x    | j                  t        d      5  t        t               d d d        y # 1 sw Y   y xY w)Nz4typing.ClassVar\[int\] is not valid as type argument)r   r   r+   rP  r   s    r\   test_top_level_class_varz)GetTypeHintTests.test_top_level_class_var6  s5    ##C
 	( ;'		( 	( 	(   09c           	          | j                  t        t              t        t        d       | j                  t        t        d      t        t
        t           d       | j                  t        t              t        t        d       | j                  t        t        d      t        t        t           df   t
        t        t        df      d       | j                  t        t              t        t        d       | j                  t        t        d      t        t        t           ddf   t
        t        t        df      d       | j                  t        t              t        t        d       | j                  t        t        d      t        t        t           ddf   t
        t        t        df      d       | j                  t        t        j                        dt        i       | j                  t        t        j                  d      dt        t        t           ddd	f   i       | j                  t        t              t        t        d       | j                  t        t        d      t        t           t
        t           d       | j                  t        t              t        t        d       | j                  t        t        d      t        t        t           ddf   t
        t        t        df      d       y )
N)r  ri  Tr  ri	  r  r  r  r   r  )r   r+   r  r   r   r7   r  r@   r8   r  r  rN   VeryAnnotatedr  r  r   s    r\   test_get_type_hints_typeddictz.GetTypeHintTests.test_get_type_hints_typeddict>  sh   
3sC5PQ
4H$K
 	
 	73PS9TUtLx}h67	#t) 45O
 	
 	(<=VY?Z[(<TRx}hGH	#t) 45U
 	
 	(:;sTW=XY(:4Px}hGH	#t) 45S
 	
 	(:(H(HICQT:V(:(H(HY]^8C=#sC78a
 	 	8CQT:UVMc]K,<P
 	 	(ABc[^D_`(ARVWx}hGH	#t) 45Z
 	r^   c                    t        d      }dt        j                  j                  t        gt        f   fd}dt        j                  j                  dt        f   fd}dt        j                  j                  |t        f   fd}| j                  t        |      dt        j                  j                  t        gt        f   i       | j                  t        |      dt        j                  j                  dt        f   i       | j                  t        |      dt        j                  j                  |t        f   i       y )Nr  r   c                      y rb   rk   r   s    r\   rf   zHGetTypeHintTests.test_get_type_hints_collections_abc_callable.<locals>.fj  s    r^   .c                      y rb   rk   r   s    r\   r  zHGetTypeHintTests.test_get_type_hints_collections_abc_callable.<locals>.gk  r  r^   c                      y rb   rk   r   s    r\   r  zHGetTypeHintTests.test_get_type_hints_collections_abc_callable.<locals>.hl  s    Cr^   )rE   r  r  r"   r   r   r+   )rW   r  rf   r  r  s        r\   ,test_get_type_hints_collections_abc_callablez=GetTypeHintTests.test_get_type_hints_collections_abc_callableg  s    cN;))3%*5;9))#s(397))!S&17*S+//2J2JC5RU:2V,WX*S+//2J2J3PS82T,UV*S+//2J2J1c62R,STr^   N)rh   ri   rj   r  r  r	   r  r  r  r  r  r  r  r  r  r  r  r%  r)  r-  r5  r=  r@  rB  rF  rK  rk   r^   r\   r  r  :  s    / 
+= =?0?6,85==
=
~

6

:8O2('R	Ur^   r  c                       e Zd Zd Zd Zy)GetUtilitiesTestCasec                 d   t        d      }t        d      }t        d      } G d dt        |         }| j	                  t        |t                 |       | j	                  t        ||         |       | j	                  t        t              d        | j	                  t        t        t                 t               | j	                  t        t        t        t        f         t               | j	                  t        t        d         t               | j	                  t        t        t        t                    t               | j	                  t        t              t               | j	                  t        t        |         t               | j	                  t        t        t        ||f      t                 t               | j	                  t        t        |df         t               | j	                  t        t              t               | j	                  t        t              t                | j	                  t        t"              t$        j&                  j"                         | j	                  t        t        t                 t               | j	                  t        t              d        | j	                  t        t        t        z        t(        j*                         | j	                  t        |j,                        |       | j	                  t        |j.                        |       | j	                  t        t0        t                 t0               | j	                  t        t2        t                 t2               | j	                  t        g |d         t4               | j	                  t        t4        |         t4               | j	                  t        g t         g |   d         t                | j	                  t        t4        t        t4        |               t4               y )	Nr   r  r  c                       e Zd Zy)/GetUtilitiesTestCase.test_get_origin.<locals>.CNr|   rk   r^   r\   rB  rP  x  r   r^   rB  r   +   r  r   )r   r   rE   r#   r   r,   r   r$   r   r   r   r%   r   r   r  r@   r  r"   r  r  r  rw
  r   r   r8   r7   r   )rW   r   r  r  rB  s        r\   r   z$GetUtilitiesTestCase.test_get_origint  s   CL$cN!
!j3(!,j1&*jot,j#/:jsCx159j17;jtCy!12E:j)73j,g6jeAqDk!23!78$?j1g:!67Cj&-j'/j*KOO,D,DEjc+T2j&-j,eoo>j(!,j*A.j#/:jS!12K@j2+V4j,f5j5":!23U;jfRj(9!:;VDr^   c           
      (   t        d      } G d dt        |         }| j                  t        |t                 t        f       | j                  t        ||         |f       | j                  t        t
        j                  t                 t        f       | j                  t        t
        j                  |         |f       | j                  t        t        t                 t        f       | j                  t        t        |         |f       | j                  t        |      d       | j                  t        t              d       | j                  t        t              d       | j                  t        t              d       | j                  t        t              d       | j                  t        t        t                 t        f       | j                  t        t        t        t        f         t        t        f       | j                  t        t        d         d       | j                  t        t        t         t                    t         t           f       | j                  t        t"        t                 t        t%        d       f       | j                  t        t        t        d f         t        t%        d       f       | j                  t        t        t        t&        |t        f   f   t                 t        t&        t        t        f   f       | j                  t        t
        j(                  t        t&        ||f   f   t"        t                    t        t&        t"        t           t"        t           f   f       | j                  t        t*        g |f   t                 g t        f       | j                  t        t*        dt        f         dt        f       | j                  t        t*        t        gt        f         t        gt        f       | j                  t        t        t        t*        t&        |df   gt        f   f         t        t*        t&        |df   gt        f   f       | j                  t        t&        t        df         t        df       | j                  t        t&        d         d       | j                  t        t,        |ddd	gf         |ddd	gf       | j                  t        t               d       | j                  t        t&              d       | j                  t        t*              d       | j                  t        t.        t                 t        f       | j                  t        t.              d       | j                  t        t0        j2                  j*                  t        gt        f         t        gt        f       | j                  t        t0        j2                  j*                  dt        f         dt        f       | j                  t        t0        j2                  j*                  g t        f         g t        f       | j                  t        t0        j2                  j*                  t        gt        f         t        t*        t        gt        f                t5        d
      }| j                  t        |      d       | j                  t        |j6                        d       | j                  t        |j8                        d       | j                  t        t*        |t        f         |t        f       | j                  t        t0        j2                  j*                  |t        f         |t        f       | j                  t        t*        t:        t        |f   t        f         t:        t        |f   t        f       | j                  t        t0        j2                  j*                  t:        t        |f   t        f         t:        t        |f   t        f       | j                  t        t:        t        t        |f         t        t        |f       | j                  t        t.        t        z        t.        t        f       | j                  t        t<        t                 t        f       | j                  t        t>        t                 t        f       | j                  t        t@              d       | j                  t        tB        t                 t        f       tE        d      }| j                  t        |      d       | j                  t        g |d         |f       | j                  t        tF        |         |f       | j                  t        tH        g |         g |       | j                  t        tH        tF        |            tF        |   f       | j                  t        g tH        g |   d         g |       | j                  t        tF        tH        tF        |               tH        tF        |      f       y )Nr   c                       e Zd Zy)-GetUtilitiesTestCase.test_get_args.<locals>.CNr|   rk   r^   r\   rB  rU    r   r^   rB  rk   rQ  .oner   threer  r  r   )%r   r#   r   r-   r   rc   r/  r  r   rB   rC   r$   r   r   r   r%   r   r   r   r   r    r"   r@   r  r  r  rE   r   r   rF   r8   r7   rD   rI   r   r   r  )rW   r   rB  r  r  s        r\   test_get_argsz"GetUtilitiesTestCase.test_get_args  s   CL!
!!C&)C62!A$!.&"4"4S"9:SFC&"4"4Q"781$?."56?."34qd;!b)#+#+$,-0"5(3-03&9%S/2S#J?'&/2H=%S	"23d3i\B(3-03T
2CD%T	"23c4:5FG%U1c6](:";C"@AuS#X/	1&++c5A;.>"?"NOuXc]HSM%ABC	E(2q5/#"67"cC(38"45SzB(C5#:"673%F%XuQV}os6J-K(K"LMxq#v(<=>	@%S/2S#J?%),b1)Aua',B"CDq%QRU\T]F^_$,%"-(+R0$s),sf5$,+//":":C5#:"FG3%QTV+//":":38"DESzR+//":":2s7"CDr3iP+//":":C5#:"FG!(C5#:"67	9cN!b)!&&)2.!((+R0(1c6"23aX>+//":":1c6"BCaXN(;sAv+>+C"DE%c1f-s3	5+//":":;sAv;NPS;S"TU%c1f-s3	5+c3k":;c3]K$*-c{;(3-03&9+c"23cV<),b1)C.1C6:$"r*&B&),re4&*-u5%*-vv6%r
"34vbzmD.E#2#J."34ff=&vbz):";<uVBZ?P>RSr^   N)rh   ri   rj   r   rX  rk   r^   r\   rM  rM  s  s    E>ATr^   rM  c                   D   e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&d% Z'd& Z(d' Z)d( Z*d) Z+d* Z,d+ Z-d, Z.d- Z/d. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4 Z6y5)6CollectionsAbcTestsc                     | j                  dt        j                         | j                  g t        j                         y r   )r   rc   Hashabler   r   s    r\   test_hashablez!CollectionsAbcTests.test_hashable  *    b&//2  V__5r^   c                    | j                  g t        j                         | j                  g t        j                         | j                  g t        j                         | j                  dt        j                         | j	                  t
        t        j                         | j	                  t
        t        j                         y r   )r   rc   r  r   r]   r  r   s    r\   test_iterablez!CollectionsAbcTests.test_iterable  s|    b&//2 	b&//2b&//2  V__5dFOO4dFOO4r^   c                     t        g       }| j                  |t        j                         | j	                  dt        j                         y r   )r	  r   rc   rZ  r   )rW   its     r\   test_iteratorz!CollectionsAbcTests.test_iterator  s3    "Xb&//2  V__5r^   c                     dt         j                  t           fd} |       }| j                  |t         j                         | j	                  |t         j                         |j                  d        y )Nr   c                  4   K   t        d       d {   S 7 wr   )rS  rk   r^   r\   rk  z/CollectionsAbcTests.test_awaitable.<locals>.foo  s     )"----s   )rc   	Awaitabler   r   r   sendrW   rk  r  s      r\   test_awaitablez"CollectionsAbcTests.test_awaitable  sW    	.6++C0 	.Ea!1!12  f&6&67	tr^   c                 p   d } |       }| j                  |t        j                         | j                  t              5  t        |t        j                  t                  d d d        | j                  |t        j                         	 |j                  d        y # 1 sw Y   <xY w# t        $ r Y y w xY w)Nc                     K   y wrb   rk   rk   r^   r\   rk  z/CollectionsAbcTests.test_coroutine.<locals>.foo  s	     ri  )
r   rc   	Coroutiner   r   r   r   r   rg  StopIterationrh  s      r\   test_coroutinez"CollectionsAbcTests.test_coroutine  s    	Ea!1!12y) 	1q&**3/0	1  f&6&67	FF4L		1 	1
  		s    "BB) B&)	B54B5c                     t        d      }t        |      }| j                  |t        j                         | j                  |t        j                         | j                  dt        j                         y Nr  r   )rr   r\  r   rc   AsyncIterabler   rW   base_itrb  s      r\   test_async_iterablez'CollectionsAbcTests.test_async_iterable  sW    )!'*b&"6"67b&"6"67  V%9%9:r^   c                     t        d      }t        |      }| j                  |t        j                         | j                  dt        j                         y rp  )rr   r\  r   rc   rd  r   rr  s      r\   test_async_iteratorz'CollectionsAbcTests.test_async_iterator	  sA    )!'*b&"6"67  V%9%9:r^   c                     | j                  g t        j                         | j                  dt        j                         y r   )r   rc   rz  r   r   s    r\   
test_sizedzCollectionsAbcTests.test_sized  s*    b&,,/  V\\2r^   c                     | j                  g t        j                         | j                  dt        j                         y r   )r   rc   r	  r   r   s    r\   test_containerz"CollectionsAbcTests.test_container  s.    b&"2"23  V%5%56r^   c                 ,   | j                  t               t        j                         | j                  t	               t        j                         | j                  t        t        j                         | j                  dt        j                         y r   )r   r  rc   
Collectionr  r]   r&  r   r   s    r\   test_collectionz#CollectionsAbcTests.test_collection  s^    egv'8'89ik6+<+<=dF$5$56  V%6%67r^   c                     | j                  t               t        j                         | j	                  dt        j                         y r   )r   rY  rc   r	  r   r   s    r\   test_abstractsetz$CollectionsAbcTests.test_abstractset  s0    ceV%7%78  V%7%78r^   c                     | j                  t               t        j                         | j	                  t               t        j                         y rb   )r   rY  rc   
MutableSetr   r  r   s    r\   test_mutablesetz#CollectionsAbcTests.test_mutableset!  s2    ceV%6%67  f.?.?@r^   c                     | j                  i t        j                         | j                  dt        j                         y r   )r   rc   r  r   r   s    r\   test_mappingz CollectionsAbcTests.test_mapping%  s*    b&..1  V^^4r^   c                     | j                  i t        j                         | j                  dt        j                         y r   )r   rc   r!   r   r   s    r\   test_mutablemappingz'CollectionsAbcTests.test_mutablemapping)  s.    b&"7"78  V%:%:;r^   c                     | j                  g t        j                         | j                  dt        j                         y r   )r   rc   r	  r   r   s    r\   test_sequencez!CollectionsAbcTests.test_sequence-  r^  r^   c                     | j                  g t        j                         | j                  dt        j                         y r  )r   rc   MutableSequencer   r   s    r\   test_mutablesequencez(CollectionsAbcTests.test_mutablesequence1  s.    b&"8"89  V%;%;<r^   c                 h   | j                  t              5  | j                  dt        j                         d d d        | j                  t              5  | j                  t        d      t        j                         d d d        | j                  t              5   G d dt        j                        }d d d        | j                  t              5   G d dt        j                  t        j                        }d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   hxY w# 1 sw Y   y xY w)Nr^   c                       e Zd Zy)0CollectionsAbcTests.test_bytestring.<locals>.FooNr|   rk   r^   r\   r   r  ;  r   r^   r   c                       e Zd Zy)0CollectionsAbcTests.test_bytestring.<locals>.BarNr|   rk   r^   r\   r   r  =  r   r^   r   )assertWarnsDeprecationWarningr   rc   
ByteString	bytearrayrf  rm  s      r\   test_bytestringz#CollectionsAbcTests.test_bytestring5  s    01 	:!!#v'8'89	:01 	E!!)C.&2C2CD	E01 	.-f''-	.01 	@?f'')9)9?	@ 	@	: 	:	E 	E	. 	.	@ 	@s/   !D*DD)D(DDD%(D1c                 L    | j                  t        t        j                         y rb   )r]   r  rc   r   r   s    r\   	test_listzCollectionsAbcTests.test_list?      dFKK0r^   c                     | j                  t        j                  t        j                          G d dt        j                  t
                 }| j                   |       t        j                         y )Nc                       e Zd Zy)/CollectionsAbcTests.test_deque.<locals>.MyDequeNr|   rk   r^   r\   MyDequer  D  r   r^   r  )r]   r  dequerc   r  r   r   )rW   r  s     r\   
test_dequezCollectionsAbcTests.test_dequeB  sE    k//>-fll3'-gi):):;r^   c                 `    | j                  t        j                  t        j                         y rb   )r]   r  Counterrc   r   s    r\   test_counterz CollectionsAbcTests.test_counterG  s    k116>>Br^   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rb   )r]   rY  rc   r  r`   r  r   s    r\   test_setzCollectionsAbcTests.test_setJ  s*    c6::.  FJJ7r^   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rb   )r]   r  rc   rZ	  r`   rY  r   s    r\   test_frozensetz"CollectionsAbcTests.test_frozensetN  s.    i)9)9:  f&6&67r^   c                 L    | j                  t        t        j                         y rb   )r]   r&  rc   r    r   s    r\   r  zCollectionsAbcTests.test_dictR  r  r^   c                    t        d      }t        d      }| j                  t        ||f   t        t        f   t        t        t        f          | j                  t        |t        f   t           t        t        t        f          | j                  t        t        |f   t           t        t        t        f          | j                  t        |t
        |   f   t        t        f   t        t        t
        t           f          | j                  t        |t
        t           f   t           t        t        t
        t           f          | j                  t        |t        |   f   t        t        f   t        t        t        t           f          | j                  t        |t        t           f   t           t        t        t        t           f          y )Nr  r  )r   r   r    r   r   r   r  )rW   r  r  s      r\   test_dict_subscribez'CollectionsAbcTests.test_dict_subscribeU  sK   CLCLadCH-tCH~>afc*DcN;c1fc*DcN;aaj)#s(3T#tCy.5IJacl+C0$sDI~2FGaaj)#s(3T#tCy.5IJacl+C0$sDI~2FGr^   c                    | j                  t              5  t        j                          d d d        | j                  t              5  t        j                  t                   d d d        | j                  t              5  t        j                  t
                   d d d        y # 1 sw Y   |xY w# 1 sw Y   OxY w# 1 sw Y   y xY wrb   )r   r   rc   r   r   r   r   s    r\   test_no_list_instantiationz.CollectionsAbcTests.test_no_list_instantiation`  s    y) 	KKM	y) 	KKN	y) 	KK	 			 		 		 	#   B&B2B>&B/2B;>Cc                     G d dt         j                  t                 } |       }| j                  ||       | j                  |t         j                         | j                  |t               | j                  t        |       y )Nc                       e Zd Zy)6CollectionsAbcTests.test_list_subclass.<locals>.MyListNr|   rk   r^   r\   MyListr  j  r  r^   r  )rc   r   r   r   r	  r]   r  r`   )rW   r  r  s      r\   test_list_subclassz&CollectionsAbcTests.test_list_subclassh  sd    	V[[% 	 Ha(a1fd+  v.r^   c                    | j                  t              5  t        j                          d d d        | j                  t              5  t        j                  t        t
        f           d d d        | j                  t              5  t        j                  t        t        f           d d d        y # 1 sw Y   xY w# 1 sw Y   UxY w# 1 sw Y   y xY wrb   )r   r   rc   r    r   r   r   r   r   s    r\   test_no_dict_instantiationz.CollectionsAbcTests.test_no_dict_instantiationt  s    y) 	KKM	y) 	"KKB!	"y) 	$KKS!#	$ 	$		 		" 	"	$ 	$#   B2"B>"C
2B;>C
Cc                     G d dt         j                  t        t        f         } |       }| j	                  ||       | j	                  |t         j
                         | j                  |t               | j                  t        |       y )Nc                       e Zd Zy)6CollectionsAbcTests.test_dict_subclass.<locals>.MyDictNr|   rk   r^   r\   r	  r  ~  r  r^   r	  )	rc   r    r   r   r   r!   r]   r&  r`   )rW   r	  r  s      r\   test_dict_subclassz&CollectionsAbcTests.test_dict_subclass|  sj    	V[[c* 	 Ha(a!6!67fd+  v.r^   c                    | j                  t        t        j                               t        j
                         | j                  t        t        j                  t        t        f                t        j
                         | j                  t        t        j                  t        t        f                t        j
                         y rb   )
r   r   rc   r	  r  r   r   r   r   r   r   s    r\   test_defaultdict_instantiationz2CollectionsAbcTests.test_defaultdict_instantiation  z    d6--/0+2I2IJd6--b"f578+:Q:QRd6--c3h79:K<S<STr^   c                     G d dt         j                  t        t        f         } |       }| j	                  ||       | j                  |t        j                         | j                  t        j                  |       y )Nc                       e Zd Zy)@CollectionsAbcTests.test_defaultdict_subclass.<locals>.MyDefDictNr|   rk   r^   r\   	MyDefDictr    r  r^   r  )	rc   r	  r   r   r   r]   r  r   r`   )rW   r  dds      r\   test_defaultdict_subclassz-CollectionsAbcTests.test_defaultdict_subclass  b    	**384 	 [b),i)@)@A  !8!8)Dr^   c                    | j                  t        t        j                               t        j                         | j                  t        t        j                  t
        t        f                t        j                         | j                  t        t        j                  t        t        f                t        j                         y rb   )	r   r   rc   OrderedDictr  r   r   r   r   r   s    r\   test_ordereddict_instantiationz2CollectionsAbcTests.test_ordereddict_instantiation  r  r^   c                     G d dt         j                  t        t        f         } |       }| j	                  ||       | j                  |t        j                         | j                  t        j                  |       y )Nc                       e Zd Zy)@CollectionsAbcTests.test_ordereddict_subclass.<locals>.MyOrdDictNr|   rk   r^   r\   	MyOrdDictr    r  r^   r  )rc   r  r   r   r   r]   r  r`   )rW   r  ods      r\   test_ordereddict_subclassz-CollectionsAbcTests.test_ordereddict_subclass  r  r^   c                 @   | j                  t        t        j                               t        j                         | j                  t        t        j                  t
        t        f                t        j                         | j                  t        t        j                  t        t        f                t        j                          G d dt        j                  t
        t        f         }| j                  t         |t        t        f                |       y )Nc                       e Zd Zy);CollectionsAbcTests.test_chainmap_instantiation.<locals>.CMNr|   rk   r^   r\   CMr    r   r^   r  )	r   r   rc   r	  r  r   r   r   r   )rW   r  s     r\   test_chainmap_instantiationz/CollectionsAbcTests.test_chainmap_instantiation  s    d6??,-{/C/CDd6??2r6245{7K7KLd6??384679M9MN.R(.d<2c3h<>*B/r^   c                     G d dt         j                  t        t        f         } |       }| j	                  ||       | j                  |t        j                         | j                  t        j                  |       y )Nc                       e Zd Zy)>CollectionsAbcTests.test_chainmap_subclass.<locals>.MyChainMapNr|   rk   r^   r\   
MyChainMapr    r  r^   r  )rc   r	  r   r   r   r]   r  r`   )rW   r  r!  s      r\   test_chainmap_subclassz*CollectionsAbcTests.test_chainmap_subclass  s`    	c2 	 \b*-j+*>*>?  !5!5zBr^   c                    | j                  t        t        j                               t        j
                         | j                  t        t        j                  t                        t        j
                         | j                  t        t        j                  t                        t        j
                          G d dt        j                  t                 }| j                  t         |t                        |       y )Nc                       e Zd Zy)7CollectionsAbcTests.test_deque_instantiation.<locals>.DNr|   rk   r^   r\   rE  r    r   r^   rE  )r   r   rc   r  r  r  r   r   rW   rE  s     r\   test_deque_instantiationz,CollectionsAbcTests.test_deque_instantiation  s    d6<<>*K,=,=>d6<<?,-{/@/@Ad6<<,./1B1BC%Q%d61S68na(r^   c                    | j                  t        t        j                               t        j                         | j                  t        t        j                  t
                        t        j                         | j                  t        t        j                  t                        t        j                          G d dt        j                  t
                 }| j                  t         |t                        |       y )Nc                       e Zd Zy)9CollectionsAbcTests.test_counter_instantiation.<locals>.CNr|   rk   r^   r\   rB  r    r   r^   rB  )r   r   rc   r  r  r   r   r$  s     r\   test_counter_instantiationz.CollectionsAbcTests.test_counter_instantiation  s    d6>>+,k.A.ABd6>>!,./1D1DEd6>>#.01;3F3FG'q!'d61S68na(r^   c                      G d dt         j                  t                 } |       }| j                  ||       | j                  |t         j                         | j                  |t        j                         y )Nc                       e Zd Zy)JCollectionsAbcTests.test_counter_subclass_instantiation.<locals>.MyCounterNr|   rk   r^   r\   	MyCounterr    r  r^   r  )rc   r  r   r   r  )rW   r  r  s      r\   #test_counter_subclass_instantiationz7CollectionsAbcTests.test_counter_subclass_instantiation  sZ    	s+ 	 Ka+a0a!4!45r^   c                    | j                  t              5  t        j                          d d d        | j                  t              5  t        j                  t                   d d d        | j                  t              5  t        j                  t
                   d d d        y # 1 sw Y   |xY w# 1 sw Y   OxY w# 1 sw Y   y xY wrb   )r   r   rc   r  r   r   r   s    r\   test_no_set_instantiationz-CollectionsAbcTests.test_no_set_instantiation  s    y) 	JJL	y) 	JJqMO	y) 	JJsO	 			 		 		 	r  c                 v     G d dt         j                  t                 } |       }| j                  ||       y )Nc                       e Zd Zy)BCollectionsAbcTests.test_set_subclass_instantiation.<locals>.MySetNr|   rk   r^   r\   r$  r    r  r^   r$  )rc   r  r   r   )rW   r$  r  s      r\   test_set_subclass_instantiationz3CollectionsAbcTests.test_set_subclass_instantiation  s/    	FJJsO 	 Ga'r^   c                    | j                  t              5  t        j                          d d d        | j                  t              5  t        j                  t                   d d d        | j                  t              5  t        j                  t
                   d d d        y # 1 sw Y   |xY w# 1 sw Y   OxY w# 1 sw Y   y xY wrb   )r   r   rc   rZ	  r   r   r   s    r\   test_no_frozenset_instantiationz3CollectionsAbcTests.test_no_frozenset_instantiation  s    y) 		y) 	"Q!	"y) 	$S!#	$ 	$		 		" 	"	$ 	$r  c                 v     G d dt         j                  t                 } |       }| j                  ||       y )Nc                       e Zd Zy)NCollectionsAbcTests.test_frozenset_subclass_instantiation.<locals>.MyFrozenSetNr|   rk   r^   r\   MyFrozenSetr    r  r^   r  )rc   rZ	  r   r   )rW   r  r  s      r\   %test_frozenset_subclass_instantiationz9CollectionsAbcTests.test_frozenset_subclass_instantiation  s2    	&**3/ 	 Ma-r^   c                 X   | j                  t              5  t                d d d        | j                  t              5  t        t                   d d d        | j                  t              5  t        t                   d d d        y # 1 sw Y   hxY w# 1 sw Y   ExY w# 1 sw Y   y xY wrb   )r   r   r   r   r   r   s    r\   test_no_tuple_instantiationz/CollectionsAbcTests.test_no_tuple_instantiation  s    y) 	G	y) 	!HJ	y) 	#JL	 			 		 		 	s"   BB-B BB B)c                 j    d } |       }| j                  t        |      t        j                         y )Nc               3      K   d y wr   rk   rk   r^   r\   rk  z/CollectionsAbcTests.test_generator.<locals>.foo  s     H   )r]   r   rc   	Generatorrh  s      r\   test_generatorz"CollectionsAbcTests.test_generator  s(    	Ed1gv'7'78r^   c                    | j                  t              5  t        j                          d d d        | j                  t              5  t        j                  t        t        t        f           d d d        | j                  t              5  t        j                  t
        t
        t
        f           d d d        y # 1 sw Y   xY w# 1 sw Y   ZxY w# 1 sw Y   y xY wrb   )r   r   rc   r  r   r   r   s    r\   test_no_generator_instantiationz3CollectionsAbcTests.test_no_generator_instantiation   s    y) 		y) 	(Q1W%'	(y) 	.S#s]+-	. 	.		 		( 	(	. 	.s#   B<'C'C<CCCc                 j    d } |       }| j                  t        |      t        j                         y )Nc                    K   d y wr   rk   rk   r^   r\   rf   z3CollectionsAbcTests.test_async_generator.<locals>.f	  s     X   	)r]   r   rc   AsyncGenerator)rW   rf   r  s      r\   test_async_generatorz(CollectionsAbcTests.test_async_generator  s(    	Cd1gv'<'<=r^   c                    | j                  t              5  t        j                          d d d        | j                  t              5  t        j                  t        t        f           d d d        | j                  t              5  t        j                  t
        t
        f           d d d        y # 1 sw Y   xY w# 1 sw Y   UxY w# 1 sw Y   y xY wrb   )r   r   rc   r  r   r   r   s    r\   %test_no_async_generator_instantiationz9CollectionsAbcTests.test_no_async_generator_instantiation  s    y) 	$!!#	$y) 	*!!!Q$')	*y) 	.!!#s(+-	. 	.		$ 	$	* 	*	. 	.r  c                     G d dt         j                        }| j                  t              5   |        d d d         G d d|      }| j	                  t         |             d       | j                  t        |j                               | j                   |       t         j                          G d dt         j                  t        t        f         }| j	                  t         |             d       | j	                  t         |t        t        f                d       | j	                  t         |t        t        f                d       | j                  t        |       | j                  t        |       | j!                  |t         j                         | j!                  |t         j                         | j!                  |t         j                         | j                   |t        t        f          t         j                         | j                   |t        t        f          t"        j$                  j                         | j!                  |t"        j$                  j                         | j!                  |t"        j$                  j                         | j!                  |t"        j$                  j                         | j                  t              5  t'        |t        t        f   t         j                         d d d        | j!                  ||        G d d	t         j(                        }| j                  t*        |        G d
 dt         j,                  t.        t.        t.        f         }d }| j!                  |t         j,                         | j!                  |t         j(                         | j!                  |t"        j$                  j,                         | j!                  |t"        j$                  j(                         | j                  t1        |      |       y # 1 sw Y   xY w# 1 sw Y   6xY w)Nc                       e Zd Zy)1CollectionsAbcTests.test_subclassing.<locals>.MMANr|   rk   r^   r\   MMAr    r  r^   r  c                   *    e Zd Zd Zd Zd Zd Zd Zy)1CollectionsAbcTests.test_subclassing.<locals>.MMCc                      y rb   rk   r	  s     r\   r  z=CollectionsAbcTests.test_subclassing.<locals>.MMC.__getitem__  r3  r^   c                      y rb   rk   r	  s      r\   r  z=CollectionsAbcTests.test_subclassing.<locals>.MMC.__setitem__!  r  r^   c                      y rb   rk   r	  s     r\   r	  z=CollectionsAbcTests.test_subclassing.<locals>.MMC.__delitem__#  r  r^   c                     t        d      S r  r	  r   s    r\   rM  z:CollectionsAbcTests.test_subclassing.<locals>.MMC.__iter__%  r	  r^   c                      yrb  rk   r   s    r\   r	  z9CollectionsAbcTests.test_subclassing.<locals>.MMC.__len__'  r  r^   Nr	  rk   r^   r\   MMCr    r 	  r^   r  r   c                   *    e Zd Zd Zd Zd Zd Zd Zy)1CollectionsAbcTests.test_subclassing.<locals>.MMBc                      y rb   rk   r	  s     r\   r  z=CollectionsAbcTests.test_subclassing.<locals>.MMB.__getitem__/  r3  r^   c                      y rb   rk   r	  s      r\   r  z=CollectionsAbcTests.test_subclassing.<locals>.MMB.__setitem__1  r  r^   c                      y rb   rk   r	  s     r\   r	  z=CollectionsAbcTests.test_subclassing.<locals>.MMB.__delitem__3  r  r^   c                     t        d      S r  r	  r   s    r\   rM  z:CollectionsAbcTests.test_subclassing.<locals>.MMB.__iter__5  r	  r^   c                      yrb  rk   r   s    r\   r	  z9CollectionsAbcTests.test_subclassing.<locals>.MMB.__len__7  r  r^   Nr	  rk   r^   r\   MMBr  .  r 	  r^   r  c                       e Zd Zy)/CollectionsAbcTests.test_subclassing.<locals>.INr|   rk   r^   r\   r  r  P  r   r^   r  c                       e Zd Zy)/CollectionsAbcTests.test_subclassing.<locals>.GNr|   rk   r^   r\   r  r  S  r   r^   r  c               3      K   d y wrb  rk   rk   r^   r\   r  z/CollectionsAbcTests.test_subclassing.<locals>.gT  s
     qr  )rc   r!   r   r   r   r  r   r~
  r!	  r   r  r   r   r   r`   r&  r]   r  r  rT   r  r  r  r   r   )rW   r  r  r  r  r  r  s          r\   test_subclassingz$CollectionsAbcTests.test_subclassing  s   	&'' 	 y) 	E	
	# 
	 	SUQ',-ceV^^4
	&''B/ 
	 	SUQ']Sc]_-q1[SR[]+Q/  s+  s+c6>>2c6>>2c6>>2kc"b&kmV^^<kc"b&km[__-D-DEc;??#:#:;c;??#:#:;c;??#:#:;y) 	6s38}fnn5	6c3'%%  q)5  c3/5a!1!12a1a!:!:;a!9!9:  a!,}	 	b	6 	6s   P/ (P</P9<Qc                 D    G d dt         j                  t        t        f         }d }| j                  |t         j                         | j                  |t         j                         | j                  |t
        j                  j                         | j                  |t
        j                  j                         | j                  t        |      |        |       }| j                  |t         j                         | j                  |t         j                         | j                  |t
        j                  j                         | j                  |t
        j                  j                         | j                  t        |      |       | j                  ||       y )Nc                       e Zd Zd ZddZy)?CollectionsAbcTests.test_subclassing_async_generator.<locals>.Gc                      y rb   rk   rV  s     r\   asendzECollectionsAbcTests.test_subclassing_async_generator.<locals>.G.asend]  r  r^   Nc                      y rb   rk   )rW   typvalrl  s       r\   athrowzFCollectionsAbcTests.test_subclassing_async_generator.<locals>.G.athrow_  r  r^   r;
  )rh   ri   rj   r  r"  rk   r^   r\   r  r  \  s    r^   r  c                    K   d y wrb  rk   rk   r^   r\   r  z?CollectionsAbcTests.test_subclassing_async_generator.<locals>.gb  s
     Qwr  )rc   r  r   r]   rq  r  r  r`   r   r   r   )rW   r  r  r  s       r\    test_subclassing_async_generatorz4CollectionsAbcTests.test_subclassing_async_generator[  s!   	%%c3h/ 	 	a!6!67a!5!56a!?!?@a!>!>?  a!,3h(=(=>h(<(<=h(F(FGh(E(EF  a!,  A&r^   c                      G d dt         j                        } G d d|      } G d d      } G d d      }| j                  ||       | j                  ||       | j                  ||       y )	Nc                       e Zd Zed        Zy)?CollectionsAbcTests.test_subclassing_subclasshook.<locals>.Basec                 $    |j                   dk(  ryy)Nr   TF)rh   rb  s     r\   rK  zPCollectionsAbcTests.test_subclassing_subclasshook.<locals>.Base.__subclasshook__u  s    >>U* r^   Nrd  rk   r^   r\   r_	  r'  t  s    ! !r^   r_	  c                       e Zd Zy)<CollectionsAbcTests.test_subclassing_subclasshook.<locals>.CNr|   rk   r^   r\   rB  r*  |  r   r^   rB  c                       e Zd Zy)>CollectionsAbcTests.test_subclassing_subclasshook.<locals>.FooNr|   rk   r^   r\   r   r,  }  r   r^   r   c                       e Zd Zy)>CollectionsAbcTests.test_subclassing_subclasshook.<locals>.BarNr|   rk   r^   r\   r   r.  ~  r   r^   r   )rc   r  r]   r`   )rW   r_	  rB  r   r   s        r\   test_subclassing_subclasshookz1CollectionsAbcTests.test_subclassing_subclasshookr  sV    	!6?? 	! 	c4(c1%  a(r^   c                     G d dt         j                        } G d d|      } G d d      }|j                  |       | j                  ||       | j	                  ||        G d d      }|j                  |       | j                  ||       | j                  ||        G d	 d
      }t
        j                  j                  j                  |       | j                  |t         j                         y )Nc                       e Zd Zy)8CollectionsAbcTests.test_subclassing_register.<locals>.ANr|   rk   r^   r\   r   r2    r   r^   r   c                       e Zd Zy)8CollectionsAbcTests.test_subclassing_register.<locals>.BNr|   rk   r^   r\   r   r4    r   r^   r   c                       e Zd Zy)8CollectionsAbcTests.test_subclassing_register.<locals>.CNr|   rk   r^   r\   rB  r6    r   r^   rB  c                       e Zd Zy)8CollectionsAbcTests.test_subclassing_register.<locals>.DNr|   rk   r^   r\   rE  r8    r   r^   rE  c                       e Zd Zy)8CollectionsAbcTests.test_subclassing_register.<locals>.MNr|   rk   r^   r\   r  r:    r   r^   r  )	rc   r	  r  r]   r`   r  r  r!   r  )rW   r   r   rB  rE  r  s         r\   test_subclassing_registerz-CollectionsAbcTests.test_subclassing_register  s    &  &	

1a#  A&	

1a#a#&&//2a0r^   c                     G d dt         j                  j                        }| j                  |t        j                         | j                  |t        j
                          G d dt         j                  j                        }| j                  |t        j                         | j                  |t        j
                          G d dt         j                  j
                        }| j                  |t        j
                          G d dt         j                  j                  t        j                  	      } G d
 d      }|j                  |       | j                  |t        j                         y )Nc                       e Zd Zy)7CollectionsAbcTests.test_collections_as_base.<locals>.MNr|   rk   r^   r\   r  r>    r   r^   r  c                       e Zd Zy)7CollectionsAbcTests.test_collections_as_base.<locals>.SNr|   rk   r^   r\   r  r@    r   r^   r  c                       e Zd Zy)7CollectionsAbcTests.test_collections_as_base.<locals>.INr|   rk   r^   r\   r  rB    r   r^   r  c                       e Zd Zy)7CollectionsAbcTests.test_collections_as_base.<locals>.ANr|   rk   r^   r\   r   rD    r   r^   r   r  c                       e Zd Zy)7CollectionsAbcTests.test_collections_as_base.<locals>.BNr|   rk   r^   r\   r   rF    r   r^   r   )	r  r  r  r]   rc   r  r  rM  r  )rW   r  r  r  r   r   s         r\   test_collections_as_basez,CollectionsAbcTests.test_collections_as_base  s    -''-a0a15//5a!7!78a1.((.a1D''3;;D	

1a0r^   c                 \   | j                  t        j                  t        j                  z  t        t        j                  t        j                  f          | j                  t        j
                  t        j                  z  t        t        j
                  t        j                  f          y rb   )r   rc   rz  rf  r   rl  r\  r   s    r\   r  z#CollectionsAbcTests.test_or_and_ror  sk    (8(88%fN^N^@^:_`))FOO;U6CSCSU[UdUdCd=efr^   N)7rh   ri   rj   r]  r`  rc  ri  rn  rt  rv  rx  rz  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r$  r/  r;  rG  r  rk   r^   r\   rZ  rZ    s   6	56
;;3789A5<6=@1<
C881	H
/$
/U
	EU
	E0	C))6($.9.>.C-J'.)"1&1$gr^   rZ  c                       e Zd Zd Zd Zy)OtherABCTestsc                     t         j                  d        } |       }| j                  |t        j                         | j                  dt        j                         y )Nc               3      K   d y wr   rk   rk   r^   r\   managerz2OtherABCTests.test_contextmanager.<locals>.manager       Hr  r   )
contextlibcontextmanagerr   rc   rh  r   )rW   rM  r!  s      r\   test_contextmanagerz!OtherABCTests.test_contextmanager  sO    		"	"	 
#	 Yb&"7"78  V%:%:;r^   c                     G d d      }| j                  t               t        j                         | j	                   |       t        j                         t
        j                  d        } |       }| j	                  |t        j                         | j                  t        j                  t           j                  t        f       | j                  t              5  t        dt        j                  t                  d d d        | j                  t              5  t        j                  t        t        f    d d d        y # 1 sw Y   ExY w# 1 sw Y   y xY w)Nc                       e Zd Zy)7OtherABCTests.test_async_contextmanager.<locals>.NotACMNr|   rk   r^   r\   NotACMrT    r  r^   rU  c               3      K   d y wr   rk   rk   r^   r\   rM  z8OtherABCTests.test_async_contextmanager.<locals>.manager  rN  r  r   )r   rf  rc   AsyncContextManagerr   rO  rP  r   r   r  r   r   r   r   )rW   rU  rM  r!  s       r\   test_async_contextmanagerz'OtherABCTests.test_async_contextmanager  s   	 	ceV%?%?@  6+E+EF		"	"	 
#	 Y  V%?%?@33C8AAC6Jy) 	<r655c:;	<y) 	1&&sCx0	1 	1	< 	<	1 	1s    "EEEEN)rh   ri   rj   rQ  rX  rk   r^   r\   rJ  rJ    s    <1r^   rJ  c                       e Zd Zd Zd Zd Zy)	TypeTestsc                 r     G d d      } G d d|      } G d d|      }dt         |   d|fd	} ||       y )
Nc                       e Zd Zy)'TypeTests.test_type_basic.<locals>.UserNr|   rk   r^   r\   Userr]    r   r^   r^  c                       e Zd Zy),TypeTests.test_type_basic.<locals>.BasicUserNr|   rk   r^   r\   	BasicUserr`    r   r^   ra  c                       e Zd Zy)*TypeTests.test_type_basic.<locals>.ProUserNr|   rk   r^   r\   ProUserrc    r   r^   rd  
user_classr   c                      |        S rb   rk   re  s    r\   new_userz+TypeTests.test_type_basic.<locals>.new_user  
    <r^   r4   )rW   r^  ra  rd  rh  s        r\   test_type_basiczTypeTests.test_type_basic  s9    ##!d!	 d 	  	  	r^   c                      G d d      } G d d|      } G d d|      }t        d|      }d	t        |   d
|fd} ||       y )Nc                       e Zd Zy))TypeTests.test_type_typevar.<locals>.UserNr|   rk   r^   r\   r^  rm    r   r^   r^  c                       e Zd Zy).TypeTests.test_type_typevar.<locals>.BasicUserNr|   rk   r^   r\   ra  ro    r   r^   ra  c                       e Zd Zy),TypeTests.test_type_typevar.<locals>.ProUserNr|   rk   r^   r\   rd  rq    r   r^   rd  r  r  re  r   c                      |        S rb   rk   rg  s    r\   rh  z-TypeTests.test_type_typevar.<locals>.new_user  ri  r^   )r   r5   )rW   r^  ra  rd  r  rh  s         r\   test_type_typevarzTypeTests.test_type_typevar  sE    ##!d!Ct$	 a 	 Q 	  	r^   c                     t         t        t              }d|dt         t           fd}| j                   |t              t               | j                   |d              y )Nr  r   c                     | y  |        S rb   rk   r  s    r\   rk  z)TypeTests.test_type_optional.<locals>.foo  s    ys
r^   )r   r5   BaseExceptionr   KeyboardInterruptassertIsNone)rW   r   rk  s      r\   test_type_optionalzTypeTests.test_type_optional  sT    T-()	1 	-0 	 	c"346GH#d)$r^   N)rh   ri   rj   rj  rs  ry  rk   r^   r\   rZ  rZ    s    	
%r^   rZ  c                       e Zd ZdgZd Zy)TestModules_idfuncc                 z    | j                   D ],  }| j                  t        t        |      j                  d       . y )N_typing)
func_namesr   r	  rc   ri   )rW   fnames     r\   test_c_functionszTestModules.test_c_functions  s4    __ 	KEWVU3>>	J	Kr^   N)rh   ri   rj   r  r  rk   r^   r\   r{  r{    s    JKr^   r{  c                   \    e Zd Zed        Zed        Zd Zd Zd Zd Z	d Z
d Zd	 Zd
 Zy)NewTypeTestsc                     t        j                  dt              at        j                  | j                  dz   t
              | _        y )NUserId	.UserName)rc   NewTyper   r  rj   r   UserNamer  s    r\   
setUpClasszNewTypeTests.setUpClass  s1     #.~~c&6&6&DcJr^   c                 
    b | `y rb   )r  r  r  s    r\   tearDownClasszNewTypeTests.tearDownClass   s     Lr^   c                     | j                  t        d      t               | j                  | j                  d      t               | j                  t        d      dz   d       y )NrU  Joern      )r   r  r   r  r   r   r   s    r\   r  zNewTypeTests.test_basic  sG    fQi-dmmE2C8Q*r^   c                     | j                  t              5  t        t        t               d d d        | j                  t              5   G d dt              }d d d        y # 1 sw Y   7xY w# 1 sw Y   y xY w)Nc                       e Zd Zy)#NewTypeTests.test_errors.<locals>.DNr|   rk   r^   r\   rE  r    r   r^   rE  )r   r   rT   r  r   r  s     r\   r   zNewTypeTests.test_errors  sc    y) 	$vs#	$y) 	F 	 		$ 	$	 	s   A!A-!A*-A6c                    t         | j                  fD ]  }| j                  |      5  | j                  t        |z  t
        j                  t        |f          | j                  |t        z  t
        j                  |t        f          | j                  t        j                  t        |z        t        |f       | j                  t        j                  |t        z        |t        f       d d d         y # 1 sw Y   xY w)Nr  )r   r  ru   r   r  rc   r   r-   )rW   rX   s     r\   r  zNewTypeTests.test_or  s    ' 	OC#& O  #v||FCK/HI  vv||CK/HI  #!>N  v!>fNO O	OO Os   CC88D	c                 J   | j                  t        j                  d       | j                  t        j                  d       | j                  t        j                  t               | j                  t        j
                  t               | j                  }| j                  |j                  d       | j                  |j                  | j                  j                  dz          | j                  |j                  t               | j                  |j
                  t               y )Nr  r  r  )
r   r  rh   rj   ri   __supertype__r   r  r   r   )rW   r  s     r\   test_special_attrszNewTypeTests.test_special_attrs  s    (3,,h7**H5--s3==**J7..44{B	D,,h7//5r^   c                     | j                  t        t              t         d       | j                  t        | j                        t         d| j
                  j                   d       y )Nz.UserIdr	  r  )r   r   r  rh   r  r   rj   r   s    r\   r   zNewTypeTests.test_repr(  sR    f(7';<dmm,$:Qt~~'B'B&C9M	Or^   c                    t        j                  dt              }t        t        j
                  dz         D ]  }| j                  |      5  t	        j                  t        |      }t	        j                  |      }| j                  |t               t	        j                  | j                  |      }t	        j                  |      }| j                  || j                         | j                  t        j                        5  t	        j                  ||       d d d        d d d         y # 1 sw Y   xY w# 1 sw Y   xY w)NUserAgern   rp   )rc   r  r{  rr   rs   rt   ru   rv  r  ru  r   r  r   PicklingError)rW   r  rq   pickledr#  s        r\   r$  zNewTypeTests.test_pickle-  s    ..E2622Q67 	1EE* 
1 ,,vu5g.ff- ,,t}}e<g.fdmm4&&v';';< 1LL%01
1 
1	11 1
1 
1s%   B6D8D,D8,D51D88E	c                      d}t        |i        y )Nz-import typing
NT = typing.NewType('NT', int)
r  r  s     r\   r  z!NewTypeTests.test_missing__name__<  s    3 	T2r^   c                     | j                  t        t        j                  d            5   G d dt              }d d d        y # 1 sw Y   y xY w)NzpCannot subclass an instance of NewType. Perhaps you were looking for: `ProUserId = NewType('ProUserId', UserId)`c                       e Zd Zy)CNewTypeTests.test_error_message_when_subclassing.<locals>.ProUserIdNr|   rk   r^   r\   	ProUserIdr  J  rY	  r^   r  )r   r   r   r   r  )rW   r  s     r\   #test_error_message_when_subclassingz0NewTypeTests.test_error_message_when_subclassingB  sE    ##II=
 	F 	 	 	s   AAN)rh   ri   rj   re  r  r  r  r   r  r  r   r$  r  r  rk   r^   r\   r  r    sT    K K
  
+
O6O
1	r^   r  c                   v    e Zd Z G d de      Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zy)NamedTupleTestsc                   "    e Zd ZU eed<   eed<   y)NamedTupleTests.NestedEmployeer  r{  Nr|  rk   r^   r\   NestedEmployeer  O  s    		r^   r  c                    t        ddt        fdt        fg      }| j                  |t                |dd      } |dd      }| j                  ||       | j                  |t               | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  t        j                  dt        fdt        fg             y )	NEmpr  idr  r   Jimrn   r  r  )r6   r   r   r]   r  r   r   r  r  rh   _fieldsr   r  r  )rW   r  joejims       r\   r9  zNamedTupleTests.test_basicsS  s   &#s <=c5)%nu#c3'c5)5)$5)#u-n5,,$0063-$1MN	Pr^   c                    t        dd      }| j                  |t                | j                  |t               | j                  |j                  d       | j                  |j
                  d       | j                  t         j                  d       | j                  t         j                  d       | j                  t         j                  t        j                  t        t                     y )NTimi(#  rz  r  r{  )rz  r   r  r   r  r{  rh   r  r   r  r  r   r   )rW   tims     r\   test_annotation_usagez%NamedTupleTests.test_annotation_usagec  s    5$'c<0c5)5)4(..?--/?@55$00cD	Fr^   c                    t        d      }| j                  |t                | j                  |t               | j                  |j                  d       | j                  |j
                  d       t        dd      }| j                  |j
                  d       | j                  t         j                  d       | j                  t         j                  d       | j                  t         j                  t        t        t                     | j                  t         j                  t        d             | j                  t              5   G d d	t              }d d d        y # 1 sw Y   y xY w)
NJeller   Sjoerdrn   r~  r  )r{  c                   &    e Zd ZU dZeed<   eed<   y)RNamedTupleTests.test_annotation_usage_with_default.<locals>.NonDefaultAfterDefaultrP  r   r   N)rh   ri   rj   r   r   r   rk   r^   r\   NonDefaultAfterDefaultr  ~  s    3
r^   r  )r~  r   r  r   r  r{  rh   r  r   r&  r   r   _field_defaultsr   r   r6   )rW   jellecooler_employeer  s       r\   "test_annotation_usage_with_defaultz2NamedTupleTests.test_annotation_usage_with_defaultn  s   '0e%<=eU+W-Q'1(A>--q1099;TU088:JK0@@3S1	30@@$A,Oy) 	 	 	 	s   
E##E,c                 4   | j                  t        d      j                         d       | j                  t        d      j                  t        d      d          | j                  t	        t        d            d       | j                  t        dd      t        d      z   d       | j                  t              5   G d dt              }d d d        | j                  t              5   G d	 d
t              }d d d        y # 1 sw Y   7xY w# 1 sw Y   y xY w)Nrn   r   r   r   z42 -> 1rP  c                       e Zd ZU eed<   d Zy)DNamedTupleTests.test_annotation_usage_with_methods.<locals>.XMethBadr   c                      y)Nzno chance for thisrk   r   s    r\   r  zLNamedTupleTests.test_annotation_usage_with_methods.<locals>.XMethBad._fields  s    /r^   N)rh   ri   rj   r   r   r  rk   r^   r\   XMethBadr    s    0r^   r  c                       e Zd ZU eed<   d Zy)ENamedTupleTests.test_annotation_usage_with_methods.<locals>.XMethBad2r   c                      y)Nzno chance for this as wellrk   r   s    r\   _sourcezMNamedTupleTests.test_annotation_usage_with_methods.<locals>.XMethBad2._source  s    7r^   N)rh   ri   rj   r   r   r  rk   r^   r\   	XMethBad2r    s    8r^   r  )	r   r  r  r   r   r  r   r  r6   )rW   r  r  s      r\   "test_annotation_usage_with_methodsz2NamedTupleTests.test_annotation_usage_with_methods  s    q*A.reBil3U2Y3q!uQx/3~. 	00: 0	0 ~. 	88J 8	8 	8	0 	0	8 	8s   <D)DDDc                     G d d      }| j                  t              5   G d dt        |      }d d d        | j                  t              5   G d dt        t              }d d d        | j                  t              5   G d dt        t              }d d d         G d	 d
t              }| j                  t              5   G d dt        |      }d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   _xY w# 1 sw Y   y xY w)Nc                       e Zd Zy)4NamedTupleTests.test_multiple_inheritance.<locals>.ANr|   rk   r^   r\   r   r    r  r^   r   c                       e Zd ZU eed<   y)4NamedTupleTests.test_multiple_inheritance.<locals>.Xr   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd ZU eed<   y)4NamedTupleTests.test_multiple_inheritance.<locals>.Yr   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd ZU eed<   y)4NamedTupleTests.test_multiple_inheritance.<locals>.Zr   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd ZU eed<   y)4NamedTupleTests.test_multiple_inheritance.<locals>.Br   Nr  rk   r^   r\   r   r    rm  r^   r   c                       e Zd ZU eed<   y)4NamedTupleTests.test_multiple_inheritance.<locals>.Cr   Nr  rk   r^   r\   rB  r    r  r^   rB  )r   r   r6   r  )rW   r   r  r  r  r   rB  s          r\   r
  z)NamedTupleTests.test_multiple_inheritance  s    	 	y) 	J 	 y) 	J 	 y) 	J
 		
 	y) 	J 	 		 		 		 	
	 	s/   CC' C3C?C$'C03C<?Dc                     G d dt         t        t                 }| j                  |j                  t
        t        f       | j                  |j                  t         t        t           f       | j                  |j                  |t
        t        t        f        G d dt        t           t               }| j                  |j                  t        t
        f       | j                  |j                  t        t           t         f       | j                  |j                  |t        t
        t        f       ||fD ]|  }| j                  |      5  | j                  |j                  t        f       | j                  |t           j                  t        f       | j                  t        |t                 t        f       |t           }| j                  |j                  |       | j                  |j                  t        f       | j                  t        |      t        f       | j                  |j                  d        |d      }| j                  t!        |      |       | j                  |j"                  d       | j%                  t&              5  |t        t(        f    d d d        d d d         y # 1 sw Y   xY w# 1 sw Y   xY w)Nc                       e Zd ZU eed<   y)'NamedTupleTests.test_generic.<locals>.Xr   Nr  rk   r^   r\   r  r        Dr^   r  c                       e Zd ZU eed<   y)'NamedTupleTests.test_generic.<locals>.Yr   Nr  rk   r^   r\   r  r    r  r^   r  r   rk   rP  )r6   r#   r   r   r*	  r  r/	  r  r  ru   r  r  r-   r   r   r  r   r   r   r   r   )rW   r  r  r  r   r  s         r\   test_genericzNamedTupleTests.test_generic  s   	
GAJ 	ug&67))J
+CDQw$?@	
J 	w&67))GAJ
+CDQ$?@A 	 A1%    !1!1A48  15  !A$!6cFallA.  cV4  !sf5  !1!126aDd1gq)  a(&&y1  c3hK    	       s%   EKJ:&K:K?KK	c                 Z    d        }|j                   \  }| j                  |t               | j                  |j                  d       | j                  |j
                  t        t        f       | j                  |j                  t        t        |   f       | j                  |j                  |t        t        t        f       | j                  |j                  |f       | j                  |t           j                  t        f       | j                  |t           j                  d       y )Nc                  >    d xf G fdd
} t         |       S )r   c                   "    e Zd ZW  ZU W ed<   y).NamedTupleTests.test_generic_pep695.<locals>.Xr   Nr  r  s   r\   r  r    
     Dr^   r  )r6   r  s    @@r\   z<generic parameters of X>zFNamedTupleTests.test_generic_pep695.<locals>.<generic parameters of X>  s     	 	: 	r^   r   rk   )rv  r   r   r   rh   r*	  r  r#   r/	  r6   r  r  r  r   r  )rW   r  r   s      r\   test_generic_pep695z#NamedTupleTests.test_generic_pep695  s    	a)S)ug&67))J
+CDQw$?@))A4033&13..3r^   c                 Z    G d dt               }|t           }| j                  |j                  |       | j                  |j                  d       | j                  |j
                  t        f        |ddg      }| j                  t        |      |       | j                  |ddgf       y )Nc                   (    e Zd ZU eed<   ee   ed<   y)9NamedTupleTests.test_non_generic_subscript.<locals>.Groupr  groupN)rh   ri   rj   r   r   r  rk   r^   r\   Groupr    s    F7Nr^   r  rk   rn   r   )r6   r   r   r  r  r  r   r   )rW   r  r   r  s       r\   r
  z*NamedTupleTests.test_non_generic_subscript  s    	J 	 #Ju-))2.cV,a!Id1gu%QH%r^   c                    t        dt        t              } |dd      }| j                  |t               | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  t        t        t                     | j                  t              5  t        ddt        fgt               d d d        y # 1 sw Y   y xY w)NLocalEmployee)r  ageNick   Namer   r  )r6   r   r   r   r  r   r  rh   r  r   r&  r   r   )rW   r  nicks      r\   test_namedtuple_keyword_usagez-NamedTupleTests.test_namedtuple_keyword_usage  s    "?#FVR(dE*F+//A..@66#38OPy) 	4vc
|s3	4 	4 	4s   C11C:c                    t        dt        t        t        t              }| j                  |j                  d       | j                  |j                  d        |t        dddt        fg      }| j                  |j                  t               | j                  |j                  d       | j                  |j                  d       | j                  |j                  dt        fg       y )Nr  )rX   rW   typenamefieldsr   rk  r*  )r6   r   r  r   r  r   rh   r  r  rX   rW   r  r  )rW   r  r  s      r\   %test_namedtuple_special_keyword_namesz5NamedTupleTests.test_namedtuple_special_keyword_names  s    $Vc$Od+%JK3R%%8HI$$U+UEN#34r^   c                 n   t        d      } G d dt               }||fD ]  }| j                  |      5  | j                  |j                  d       | j                  |j                  i        | j                  |j
                  i        | j                   |       |       d d d         y # 1 sw Y   xY w)Nr  c                       e Zd Zy)2NamedTupleTests.test_empty_namedtuple.<locals>.CNTNr|   rk   r^   r\   CNTr    r  r^   r  )structrk   )r6   ru   r   r  r  r   r   )rW   r  r  r  s       r\   test_empty_namedtuplez%NamedTupleTests.test_empty_namedtuple  s    	* 	 3i 	8FV, 8  4  !7!7<  !7!7<%%fh7	8 8	88 8s   A,B++B4	c                 ^   | j                  t              5  t        j                          d d d        | j                  t              5  t                d d d        | j                  t              5  t        ddt        fgd        d d d        | j                  t
              5  t        ddt        fg       d d d        | j                  t              5  t        dt        t               d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   bxY w# 1 sw Y   y xY w)Nr  r  _name)r  r  r  )r   r   r6   r  r   r  r   r   s    r\   test_namedtuple_errorsz&NamedTupleTests.test_namedtuple_errors  s    y) 	! 	!y) 	L	y) 	5u}ot4	5z* 	0u~./	0y) 	9CC8	9 	9	! 	!	 		5 	5	0 	0	9 	9s;   C3C?0D"DD#3C<?DDD #D,c                 n   t        ddt        fdt        fg      at        t        | j
                  fD ]  }| j                  |      5   |dd      }t        t        j                  dz         D ]Q  }t        j                  ||      }t        j                  |      }| j                  ||       | j                  ||       S t        |      }| j                  ||       | j                  ||       t        |      }| j                  ||       | j                  ||       d d d         y # 1 sw Y   xY w)Nr  r  r{  r  jane%   rn   )r6   r   r   r  rz  r  ru   rr   rs   rt   rv  ru  r   r   r   r   )rW   rX   r  rq   rQ  jane2s         r\   test_copy_and_picklez$NamedTupleTests.test_copy_and_pickle  s   &# >?d&9&99 	2C#& 262"6#:#:Q#>? 6ET51A"LLOE$$UD1))%5	6 T
  -%%eS1   -%%eS12 2	22 2s   CD**D4	c                 T   t        d      } G d dt              } G d dt        t        |         }| j                  |j                  t        f       | j                  |j                  t        t        |   f       t        dg       }| j                  |j                  t        f       y )Nr   c                       e Zd Zy)9NamedTupleTests.test_orig_bases.<locals>.SimpleNamedTupleNr|   rk   r^   r\   SimpleNamedTupler  %  r  r^   r  c                       e Zd Zy):NamedTupleTests.test_orig_bases.<locals>.GenericNamedTupleNr|   rk   r^   r\   GenericNamedTupler  (  r  r^   r  CallNamedTuple)r   r6   r#   r   r/	  )rW   r   r  r  r	  s        r\   r0	  zNamedTupleTests.test_orig_bases"  s    CL	z 		
GAJ 	 	)88:-H*99JPQ
;ST#$4b966Fr^   N)rh   ri   rj   r6   r  r9  r  r  r  r
  r  r  r
  r  r  r  r  r  r0	  rk   r^   r\   r  r  N  sW     P 	F(8$$ >4&	458
92(Gr^   r  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)TypedDictTestsc                    t        dt        t        d      }| j                  |t               | j                  |t
        j                         | j                  |t        j                  j                          |dd      }| j                  t        |      t               | j                  |d   d       | j                  |d   d       | j                  |j                  d       | j                  |j                  t               | j                  |j                   t        f       | j                  |j"                  t        t        d       | j                  |j$                  d       | j                  |j&                  ddh       | j)                  |j&                  t*               | j                  |j,                  t/                      | j)                  |j,                  t*               y Nr  r  r  rn   r  r  T)r9   r   r   r]   r&  rc   r!   r`   r  r  r	  r   r   r   rh   ri   r*	  r   	__total____required_keys__r   r  __optional_keys__rY  rW   r  r  s      r\   test_basics_functional_syntaxz,TypedDictTests.test_basics_functional_syntax4  sd   378c4(c6#8#89  koo&>&>?u#d3i&Ve,TA&u-20,,s#.FG-..?c33Y?..6c33Y?r^   c                 ,   | j                  t              5  t        dt        t              }d d d        | j                  t               | j                  |t        j                         | j                  |t        j                  j                          |dd      }| j                  t        |      t               | j                  |d   d       | j                  |d   d       | j                  |j                   d       | j                  |j"                  t                | j                  |j$                  t        f       | j                  |j&                  t        t        d       | j                  |j(                  d       y # 1 sw Y   ^xY wr  )r  r  r9   r   r   r]   r&  rc   r!   r`   r  r  r	  r   r   r   rh   ri   r*	  r   r  r  s      r\   test_basics_keywords_syntaxz*TypedDictTests.test_basics_keywords_syntaxG  s'   01 	5E4C	5c4(c6#8#89  koo&>&>?u#d3i&Ve,TA&u-20,,s#.FG-	5 	5s   F		Fc           
         | j                  t              5  t        dt        t        t
        t        t        t              }d d d        | j                  j                  d       | j                  |j                  t        t        t
        t        t        t        d        |t
        ddddt        fgdt        h      }| j                  |d   t
               | j                  |d	   d       | j                  |d
   d       | j                  |d   d       | j                  |d   dt        fg       | j                  |d   dt        h       y # 1 sw Y   xY w)NTD)rX   rW   r  	_typenamer  r  r   rk  5   r*  r_  rX   rW   r  r  r  r  )r  r  r9   r   r  r   r   r  r&  r   rh   r   r  rY  )rW   r  r  s      r\   $test_typeddict_special_keyword_namesz3TypedDictTests.test_typeddict_special_keyword_namesW  s-   01 	p4TPS\`jnoB	pd+++T6WZilx|  JN  .O  	P3R%2u~FVafhk`lm53'6B':.;,8u~&679s|4	p 	ps   +EEc                    | j                  t              5  t        j                          d d d        | j                  t              5  t                d d d        | j                  t              5  t        ddt        fgd        d d d        | j                  t              5  t        dt        t
               d d d        y # 1 sw Y   xY w# 1 sw Y   |xY w# 1 sw Y   VxY w# 1 sw Y   y xY w)Nr  r  )r  r  r  )r   r   r9   r  r   r   r   s    r\   test_typeddict_create_errorsz+TypedDictTests.test_typeddict_create_errorsd  s    y) 	 	 y) 	K	y) 	4evsm_d3	4y) 	9CC8	9 	9	  	 	 		4 	4	9 	9s/   CC0C"C&CCC#&C/c                 X   t        dt        t        d      }| j                  t         j                  d        |dd      }| j                  t              5  t        i |       d d d        | j                  t              5  t        ||       d d d        | j                  t              5  t        t        |       d d d        | j                  t              5  t        ddt        fgt               d d d        y # 1 sw Y   xY w# 1 sw Y   {xY w# 1 sw Y   YxY w# 1 sw Y   y xY w)	Nr  r  rc   r  rn   Hir   r  )
r9   r   r   r   ri   r   r   r   rT   r&  r  s      r\   test_typeddict_errorsz$TypedDictTests.test_typeddict_errorsn  s    378--x8u#y) 	 r3	 y) 	!sC 	!y) 	"tS!	"y) 	1dc3ZLC0	1 	1	  	 	! 	!	" 	"	1 	1s0   C<D+DD <DDD D)c                 r   | j                  t        j                  d       | j                  t        j                  t               | j                  t        j                  t
        t
        t        d       | j                  t        j                  t        f       | j                  t        j                  d       | j                  t        t        j                         t        dd      }| j                  |d   d       | j                  |d   d       t        ddd	      }| j                  |d
   d	       y )Nr  r  Tr   rn   r  r   r   hir  )r   r  rh   ri   r   r   r   r*	  r&  r  r`   rc   r	  r  )rW   
not_originrc  s      r\   test_py36_class_syntax_usagez+TypedDictTests.test_py36_class_syntax_usage{  s    ..?00(;55SsUX7YZ//$9//6  v?qA&
C!,C!,qAT2w.r^   c                    t        dt        t        d      at        ddd      }t	        t
        j                  dz         D ]  }t        j                  ||      }t        j                  |      }| j                  ||       | j                  |ddd       t        j                  t        |      }t        j                  |      }| j                   |ddd      |        y )NEmpDr  r  r  rn   )
r9   r   r   r$  rr   rs   rt   rv  ru  r   )rW   r  rq   rQ  r   ZZEmpDnews          r\   r$  zTypedDictTests.test_pickle  s    #S!9:V2./622Q67 	HET5)ALLOEUD)UV2$>?dE*Bll2&GWfB%?@$G	Hr^   c                    t        dd      }t        t        j                  dz         D ]  }t        j                  ||      }t        j
                  |      }| j                  ||       | j                  |ddd       t        j                  t         |      }t        j
                  |      }| j                   |ddd      |        y )Ng      @g      @rQ  rn   )r  rr   rs   rt   rv  ru  r   )rW   pointrq   rQ  point2r%  Point2DGenericNews          r\   test_pickle_genericz"TypedDictTests.test_pickle_generic  s    ,622Q67 	MEUE*A\\!_FVU+V3S%9:ne4B &R 0.Ss/CDeL	Mr^   c                    t        dt        t        d      }| j                  t        j
                  |   t        j                  d |f          | j                  t        j                  |   t        j                  |          y )Nr$  r  )
r9   r   r   r   rc   r   r   r   r   r   )rW   r$  s     r\   r  zTypedDictTests.test_optional  s[    #S!9:.T4Z0HIFKK-v||D/ABr^   c                    t        ddt        id      }| j                   |       i        | j                   |d      ddi       | j                  |j                  d       | j                  |j                  t                      | j                  |j                  t
               | j                  |j                  dh       | j                  |j                  t
               | j                  t               i        | j                  t        d      d	di       | j                  t        j                  d       | j                  t        j                  t                      | j                  t        j                  d	d
h       y )NrE  r   Fr  rn   r   r   )r  r  r  )	r9   r   r   r  r  r  r   r  r  r  s     r\   
test_totalzTypedDictTests.test_total  s#   cC:U3b!Q#q*e,,,ik:a119=,,se4a119=B'1-Q/?@**E222IK@22[*4MNr^   c                 @    G d dt         d      }| j                  |j                  t        ddg             | j	                  |j                  t               | j                  |j
                  t        dg             | j	                  |j
                  t               y )Nc                       e Zd ZU eed<   y)6TypedDictTests.test_optional_keys.<locals>.Point2Dor3DrQ  Nr  rk   r^   r\   Point2Dor3Dr1    rm  r^   r2  Fr  r   r   rQ  )r  r   r  r  r   r  )rW   r2  s     r\   test_optional_keysz!TypedDictTests.test_optional_keys  sz    	' 	 	66	3*8MNk;;YG66	3%8HIk;;YGr^   c                     G d dt               } G d d|d      } G d d|      }| j                  |j                  t        d	g             | j                  |j                  t        g              | j                  |j
                  d	t        i       | j                  |j                  t        d	g             | j                  |j                  t        d
dg             | j                  |j
                  t        t        t        d       | j                  |j                  t        d	dg             | j                  |j                  t        d
dg             | j                  |j
                  t        t        t        t        d       y )Nc                       e Zd ZU eed<   y)8TypedDictTests.test_keys_inheritance.<locals>.BaseAnimalr  Nr  rk   r^   r\   
BaseAnimalr6    r  r^   r7  c                   "    e Zd ZU eed<   eed<   y)4TypedDictTests.test_keys_inheritance.<locals>.Animalvoicer  N)rh   ri   rj   r   r   r,  rk   r^   r\   Animalr9    s    JJr^   r;  Fr  c                       e Zd ZU eed<   y)1TypedDictTests.test_keys_inheritance.<locals>.Cat	fur_colorNr  rk   r^   r\   Catr=    s    Nr^   r?  r  r  r:  )r  r  r:  r>  )r>  r  r  r:  )r9   r   r  r  r  r   r   r,  )rW   r7  r;  r?  s       r\   test_keys_inheritancez$TypedDictTests.test_keys_inheritance  sE   	 		Zu 		& 	 	55y&7JK55y}E33fc]C119fX3FG119fg=N3OP//2
 	 	..	6;:O0PQ..	67:K0LM,,	/
 	r^   c                     G d dt         d      } G d d|      }| j                  |j                  t                      | j                  |j                  t        dg             | j                  |j                  t        dg             | j                  |j                  t                       G d d	t               } G d
 d|      }| j                  |j                  t        dg             | j                  |j                  t        dg             | j                  |j                  t        dg             | j                  |j                  t        dg             y )Nc                       e Zd ZU eed<   y)ETypedDictTests.test_keys_inheritance_with_same_name.<locals>.NotTotalr  Nr  rk   r^   r\   NotTotalrC    rm  r^   rD  Fr  c                       e Zd ZU eed<   y)BTypedDictTests.test_keys_inheritance_with_same_name.<locals>.Totalr  Nr  rk   r^   r\   TotalrF    rm  r^   rG  r  c                   .    e Zd ZU ee   ed<   ee   ed<   y)ATypedDictTests.test_keys_inheritance_with_same_name.<locals>.Baser  r   N)rh   ri   rj   r7   r   r   r8   rk   r^   r\   r_	  rI    s    3}r^   r_	  c                   .    e Zd ZU ee   ed<   ee   ed<   y)BTypedDictTests.test_keys_inheritance_with_same_name.<locals>.Childr  r   N)rh   ri   rj   r8   r   r   r7   rk   r^   r\   r
  rK    s    }3r^   r
  r   )r9   r   r  r  r  )rW   rD  rG  r_	  r
  s        r\   $test_keys_inheritance_with_same_namez3TypedDictTests.test_keys_inheritance_with_same_name  s   	y 		H 	 	33Y[A33Yu5EF00)SE2BC00)+>	9 		 D 	  	//C51AB//C51AB00)SE2BC00)SE2BCr^   c                 >    G d dt               } G d dt               } G d d||      }| j                  |j                  dt        t           i       | j                  |j
                  t        dg             | j                  |j                  t                      y )Nc                       e Zd ZU ee   ed<   y)ETypedDictTests.test_multiple_inheritance_with_same_key.<locals>.Base1r  Nr  rk   r^   r\   Base1rO    s    3r^   rP  c                       e Zd ZU ee   ed<   y)ETypedDictTests.test_multiple_inheritance_with_same_key.<locals>.Base2r  Nr  rk   r^   r\   Base2rR    s    }r^   rS  c                       e Zd Zy)ETypedDictTests.test_multiple_inheritance_with_same_key.<locals>.ChildNr|   rk   r^   r\   r
  rU    r  r^   r
  r  )r9   r   r   r8   r   r  r  r  )rW   rP  rS  r
  s       r\   'test_multiple_inheritance_with_same_keyz6TypedDictTests.test_multiple_inheritance_with_same_key  s~    	 I 	 	I 		E5 	 	..hsm0DE00)SE2BC00)+>r^   c                    | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t
        j                  t        dh             | j                  t
        j                  t        dh             | j                  t        j                  j                  t                      | j                  t        j                  j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             y )Nr  ri  r  )r   r  r  r  r  r  rN   rE  r  r  r  r  r   s    r\   test_required_notrequired_keysz-TypedDictTests.test_required_notrequired_keys  s   88"G9-	/88"F8,	. 	55"G9-	/55"F8,	. 	+99KK"	&+99KK"C5)	+ 	99"G9-	/99"F8,	. 	+=="G9-	/+=="F8,	. 	::"G9-	/::"F8,	. 	2DD"G9-	/2DD"F8,	.r^   c                     G d dt               } G d dt               } G d dt         d      }t        d	d
t        i      } G d d      } G d d||      }| j                  |j                  t	        g d             | j                  |j
                  t	        g              | j                  |j                  t        t        t        d        G d d||      }| j                  |j                  t	        ddg             | j                  |j
                  t	        dg             | j                  |j                  t        t        t        d        G d d||d      }| j                  |j                  t	        dg             | j                  |j
                  t	        ddg             | j                  |j                  t        t        t        d        G d d||      }	| j                  |	j                  t	        d
dg             | j                  |	j
                  t	        dg             | j                  |	j                  t        t        t        d       ||f||f|||f||f||fg}
|
D ]G  }| j                  |      5  | j                  t        d      5   G d dg| }d d d        d d d        I y # 1 sw Y   xY w# 1 sw Y   `xY w)Nc                       e Zd ZU eed<   y)5TypedDictTests.test_multiple_inheritance.<locals>.OnerV  Nr  rk   r^   r\   Oner[  ,      Hr^   r\  c                       e Zd ZU eed<   y)5TypedDictTests.test_multiple_inheritance.<locals>.TwotwoNr  rk   r^   r\   Twor_  .  r]  r^   ra  c                       e Zd ZU eed<   y)9TypedDictTests.test_multiple_inheritance.<locals>.UntotaluntotalNr  rk   r^   r\   Untotalrc  0  s    Lr^   re  Fr  Inlineinlinec                       e Zd Zy)9TypedDictTests.test_multiple_inheritance.<locals>.RegularNr|   rk   r^   r\   Regularri  3  r  r^   rj  c                       e Zd ZU eed<   y)7TypedDictTests.test_multiple_inheritance.<locals>.ChildchildNrh   ri   rj   r,  r   rk   r^   r\   r
  rl  6      Kr^   r
  )rV  r`  rm  c                       e Zd ZU eed<   y)CTypedDictTests.test_multiple_inheritance.<locals>.ChildWithOptionalrm  Nrn  rk   r^   r\   ChildWithOptionalrq  E  ro  r^   rr  rV  rm  rd  )rV  rd  rm  c                       e Zd ZU eed<   y)ETypedDictTests.test_multiple_inheritance.<locals>.ChildWithTotalFalserm  Nrn  rk   r^   r\   ChildWithTotalFalsert  T  ro  r^   ru  c                       e Zd ZU eed<   y)LTypedDictTests.test_multiple_inheritance.<locals>.ChildWithInlineAndOptionalrm  Nrn  rk   r^   r\   ChildWithInlineAndOptionalrw  c  ro  r^   rx  )rg  rd  rm  )basesz=cannot inherit from both a TypedDict type and a non-TypedDictc                       e Zd Zy)7TypedDictTests.test_multiple_inheritance.<locals>.WrongNr|   rk   r^   r\   Wrongr{    rk
  r^   r|  )r9   r,  r   r  r  r  r   r   r   ru   r   r   )rW   r\  ra  re  rf  rj  r
  rr  ru  rx  wrong_basesry  r|  s                r\   r
  z(TypedDictTests.test_multiple_inheritance+  s   	) 		) 		iu 	8h%56	 		C 	##-.	
 	##bM	
 	!!d3	

	W 	//ug&'	
 	//yk"	
 	--C$7	

	#we 	11ug	
 	11y'*+	
 	//C$7	

	& 	&88x)*	
 	&88yk"	
 	&66d;	
 'NcN#wWg
 ! 	EE* ++S  	 	  s$   
K!K -K K	KK	c                    | j                  t        t              d       | j                  t        t        t        t
        f         d       | j                  t        t                     d       t        ddt
        i      }| j                  t        |      d       | j                  t         |             d       t        d       G fddt        t                 }| j                  t        |      d       | j                  t        |t
                 d       | j                  t         |             d        d        }| j                  t        |      d       | j                  t        |t
                 d       | j                  t         |             d       | j                  t        t              d       y )	NTF
call_basedr  r   c                       e Zd ZU W  ed<   y)4TypedDictTests.test_is_typeddict.<locals>.BarGenericr  Nrs  rt  s   r\   r  r    s    Dr^   r  c                  >    d xf G fdd
} t         |       S )r   c                   "    e Zd ZW  ZU W ed<   y)4TypedDictTests.test_is_typeddict.<locals>.NewGenericr  Nr  r  s   r\   r  r    r  r^   r  r9   r  s    @@r\   z"<generic parameters of NewGeneric>zLTypedDictTests.test_is_typeddict.<locals>.<generic parameters of NewGeneric>  s     	 	I 	r^   )	r   r/   r  r   r   r   r9   r   r#   )rW   r  r  r  r   s       @r\   test_is_typeddictz TypedDictTests.test_is_typeddict  s1   l7+T2l5c?3U;l79-u5|c3Z8
l:.5l:<0%8CL	GAJ 	l:.5l:c?3U;l:<0%8	l:.5l:c?3U;l:<0%8 	l9-u5r^   c                 z    | j                  t        t              t        j                  t
           t
        d       y )NrQ  )r   r+   r   rc   r   r   r   s    r\   r
  z"TypedDictTests.test_get_type_hints  s)    3//#&S1	
r^   c                    | j                  t        t              t        j                  t
           t        d        G d dt        t                 }| j                  t        |      t        j                  t
           t        t        d       y )NrQ  c                       e Zd ZU eed<   y)ATypedDictTests.test_get_type_hints_generic.<locals>.FooBarGenericr  Nr  rk   r^   r\   FooBarGenericr    rm  r^   r  r  r   r  )r   r+   r  rc   r   r   r   r   )rW   r  s     r\   test_get_type_hints_genericz*TypedDictTests.test_get_type_hints_generic  sd    :&//!$3/	

	JsO 	 	=)//!$3S9	
r^   c                 Z    d        }|j                   \  }| j                  |t               | j                  |j                  d       | j                  |j
                  t        t        f       | j                  |j                  t        t        |   f       | j                  |j                  |t        t        t        f       | j                  |j                  |f       | j                  |t           j                  d       | j                  |t           j                  t        f       y )Nc                  >    d xf G fdd
} t         |       S )r   c                   "    e Zd ZW  ZU W ed<   y)7TypedDictTests.test_pep695_generic_typeddict.<locals>.Ar  Nr  r  s   r\   r   r    r  r^   r   r  r  s    @@r\   z<generic parameters of A>zOTypedDictTests.test_pep695_generic_typeddict.<locals>.<generic parameters of A>  s     	 	9 	r^   r   rk   )rv  r   r   r   rh   r*	  r#   r&  r/	  r9   r  r  r  r   r  )rW   r   r   s      r\   test_pep695_generic_typeddictz,TypedDictTests.test_pep695_generic_typeddict  s    	 a)S)wo6))Iwqz+BCQv$>?))A403..333&1r^   c                 "    G d dt         t        t                 }| j                  |j                  t        t
        f       | j                  |j                  t         t        t           f       | j                  |j                  |t        t
        t        f       | j                  |j                  t        f       | j                  |t           j                  d       | j                  |t           j                  t        f        G d dt        t           t               }| j                  |j                  t        t
        f       | j                  |j                  t        t           t         f       | j                  |j                  |t        t
        t        f       | j                  |j                  t        f       | j                  |t           j                  d       | j                  |t           j                  t        f        G d d|t           d	      }| j                  |j                  t        t
        f       | j                  |j                  |t           f       | j                  |j                  |t        t
        t        f       | j                  |j                  t        f       | j                  |j                  d       | j                  |j                  t        d
g             | j                  |j                   t        dg             | j                  |t           j                  d       | j                  |t           j                  t        f       | j                  |t           j"                  |        G d d|t$                 }| j                  |j                  t        t
        f       | j                  |j                  |t$           f       | j                  |j                  |t        t
        t        f       | j                  |j                  d       | j                  |j                  d       | j                  |j                  t        d
g             | j                  |j                   t        ddg             | j                  |j&                  t        t        t$        d       | j)                  t*              5  |t            d d d         G d dt,        t           t        t        t        f         }| j                  |j                  t        t
        f       | j                  |j                  t,        t           t        t        t        f   f       | j                  |j                  |t        t
        t        f       | j                  |j                  t        t        f       | j                  |j                  d       | j                  |j                  t                      | j                  |j                   t        g d             | j                  |j&                  t        t        t        d       | j                  |t$        t        f   j"                  |       | j)                  t*              5  |t$            d d d        | j)                  t*              5   G d dt,        t           t        t                 }d d d        y # 1 sw Y   xY w# 1 sw Y   WxY w# 1 sw Y   y xY w)Nc                       e Zd ZU eed<   y)2TypedDictTests.test_generic_inheritance.<locals>.Ar  Nr  rk   r^   r\   r   r    r  r^   r   rk   c                       e Zd ZU eed<   y)3TypedDictTests.test_generic_inheritance.<locals>.A2r  Nr  rk   r^   r\   A2r    r  r^   r  c                       e Zd ZU eed<   y)2TypedDictTests.test_generic_inheritance.<locals>.Br   Nrh   ri   rj   r   r   rk   r^   r\   r   r        Er^   r   Fr  r   r  c                       e Zd ZU eed<   y)2TypedDictTests.test_generic_inheritance.<locals>.Cr  Nr  rk   r^   r\   rB  r    rm  r^   rB  Tr  r  c                       e Zd ZU eed<   y8TypedDictTests.test_generic_inheritance.<locals>.Point3Dr  Nr  rk   r^   r\   Point3Dr    r  r^   r  c                       e Zd ZU eed<   yr  r  rk   r^   r\   r  z8TypedDictTests.test_generic_inheritance.<locals>.Point3D	  s    r^   )r9   r#   r   r   r*	  r&  r/	  r  r  r  r   r  r   r  r  r  r  r  r   r   r   r   r  )rW   r   r  r   rB  r  s         r\   test_generic_inheritancez'TypedDictTests.test_generic_inheritance  s.   		71: 	 	wo6))Iwqz+BCQv$>?))A403..333&1	Y 	 	7**WQZ,CDb'4%@A**QD1C//4C))C62	"U 	 	wo6))AbE84Qv$>?))B51e,,,i.>?,,i.>?3..333&13**A.	# 	 	wo6))AcF95Qv$>?))2.d+,,i.>?,,ic
.CD**-
 	
 y) 	cF		nQ'B 	 	**WdO<//.2CWQPRU^1TU7GT6*JK//!R9**D122IK@22Io4NO003
 	
 	c*55w?y) 	CL	 y) 	.+WR[ 	 	1	 	*	 		 	s$   
[,
[9 #\,[69\\c                     G d dt         t        t                 } G d d|t           d      } G d d|      }| j	                  |j
                  t        t        f       | j	                  |j                  |t        t        t        f       | j	                  |j                  d	       | j	                  |j                  d
       | j	                  |j                  t        dg             | j	                  |j                  t        ddg             | j	                  |j                  t        t        t        d       | j!                  t"              5  |t$            d d d        y # 1 sw Y   y xY w)Nc                       e Zd ZU eed<   y)7TypedDictTests.test_implicit_any_inheritance.<locals>.Ar  Nr  rk   r^   r\   r   r    r  r^   r   c                       e Zd ZU eed<   y)7TypedDictTests.test_implicit_any_inheritance.<locals>.Br   Nr  rk   r^   r\   r   r    r  r^   r   Fr  c                       e Zd ZU eed<   y)ETypedDictTests.test_implicit_any_inheritance.<locals>.WithImplicitAnyr  Nr  rk   r^   r\   WithImplicitAnyr    rm  r^   r  rk   Tr   r  r  r  )r9   r#   r   r   r   r*	  r&  r  r  r  r  r  r  r  r   r   r   r   r   )rW   r   r   r  s       r\   test_implicit_any_inheritancez,TypedDictTests.test_implicit_any_inheritance  s(   		71: 		"U 		a 	 	22Wd4DE00?GTSY2Z[77<22D9::Ise<LM::IsCj<QR88;
 	
 y) 	!C 	! 	! 	!s   
E&&E/c                 ^    G d dt               }|t           }| j                  |j                  |       | j                  |j                  d       | j                  |j
                  t        f        |d      }| j                  t        |      t               | j                  |ddi       y )Nc                       e Zd ZU eed<   y)5TypedDictTests.test_non_generic_subscript.<locals>.TDr  Nr  rk   r^   r\   r  r  (  r  r^   r  rk   rn   r  r  )	r9   r   r   r  r  r  r   r   r&  )rW   r  r   r  s       r\   r
  z)TypedDictTests.test_non_generic_subscript%  s    	 	sGr*))2.cV,!Hd1gt$S!H%r^   c                 $   t        d      } G d dt              } G d d|      } G d d|      } G d d	|||      } G d
 dt        t        |         } G d d|t                 } G d d|t                 } G d d|||t
                 }	 G d d|t           |t
                 }
t        di       }| j                  |j                  t        f       | j                  |j                  |f       | j                  |j                  |f       | j                  |j                  |||f       | j                  |j                  t        t        |   f       | j                  |j                  |t           f       | j                  |j                  |t           f       | j                  |	j                  |||t
           f       | j                  |
j                  |t           |t
           f       | j                  |j                  t        f       y )Nr   c                       e Zd Zy).TypedDictTests.test_orig_bases.<locals>.ParentNr|   rk   r^   r\   Parentr  5  r  r^   r  c                       e Zd Zy)-TypedDictTests.test_orig_bases.<locals>.ChildNr|   rk   r^   r\   r
  r  8  r  r^   r
  c                       e Zd Zy)2TypedDictTests.test_orig_bases.<locals>.OtherChildNr|   rk   r^   r\   
OtherChildr  ;  r  r^   r  c                       e Zd Zy)2TypedDictTests.test_orig_bases.<locals>.MixedChildNr|   rk   r^   r\   
MixedChildr  >  r  r^   r  c                       e Zd Zy)5TypedDictTests.test_orig_bases.<locals>.GenericParentNr|   rk   r^   r\   GenericParentr  A  r  r^   r  c                       e Zd Zy)4TypedDictTests.test_orig_bases.<locals>.GenericChildNr|   rk   r^   r\   GenericChildr  D  r  r^   r  c                       e Zd Zy)9TypedDictTests.test_orig_bases.<locals>.OtherGenericChildNr|   rk   r^   r\   OtherGenericChildr  G  r  r^   r  c                       e Zd Zy)9TypedDictTests.test_orig_bases.<locals>.MixedGenericChildNr|   rk   r^   r\   MixedGenericChildr  J  r  r^   r  c                       e Zd Zy)<TypedDictTests.test_orig_bases.<locals>.MultipleGenericBasesNr|   rk   r^   r\   MultipleGenericBasesr  M  r  r^   r  CallTypedDict)r   r9   r#   r   r   r{  r   r/	  )rW   r   r  r
  r  r  r  r  r  r  r  r  s               r\   r0	  zTypedDictTests.test_orig_bases2  s   CL	Y 		F 		 		
F 		Iwqz 		=- 		c 2 		.?uAU 		=#5}U7K 	 "/26..=--y922VI>22UJ4PQ55	71:7NO44}S7I6KL*99M#<N;PQ*99LJ[]jkp]q;rs-<<}S?QS`afSg>hi55	|Dr^   N)rh   ri   rj   r  r  r  r  r  r"  r$  r+  r  r.  r3  r@  rL  rV  rX  r
  r  r
  r  r  r  r  r
  r0	  rk   r^   r\   r  r  3  s    @&. 591/H	MCO H@D2?".HUn62

2M^!2&)Er^   r  c                   *    e Zd Zd Zd Zd Zd Zd Zy)RequiredTestsc                 h   | j                  t              5  t        t            d d d        | j                  t              5  t        t        t
        f    d d d        | j                  t              5  t        t           t
            d d d        y # 1 sw Y   mxY w# 1 sw Y   HxY w# 1 sw Y   y xY wrb   )r   r   r8   r7   r   r   r   s    r\   r9  zRequiredTests.test_basics`  s    y) 	"[!	"y) 	S#X	y) 	SM#	 			" 	"	 		 	#   BB2B(BB%(B1c                     | j                  t        t              d       t        t           }| j                  t        |      d       t        t           }| j                  t        |      dt
         d       y )Nztyping.Requiredztyping.Required[int]ztyping.Required[
.Employee])r   r   r8   r   r{   rh   r
  s     r\   r   zRequiredTests.test_reprh  s]    h):;c]b#9:hb%5hZz#JKr^   c           	      $   | j                  t        t              5   G d dt        t                    }d d d        | j                  t        t              5   G d dt        t        t
                       }d d d        | j                  t        d      5   G d dt              }d d d        | j                  t        d      5   G d	 d
t        t
                 }d d d        y # 1 sw Y   xY w# 1 sw Y   yxY w# 1 sw Y   WxY w# 1 sw Y   y xY w)Nc                       e Zd Zy)-RequiredTests.test_cannot_subclass.<locals>.CNr|   rk   r^   r\   rB  r  q  r   r^   rB  c                       e Zd Zy)-RequiredTests.test_cannot_subclass.<locals>.DNr|   rk   r^   r\   rE  r  t  r   r^   rE  z Cannot subclass typing\.Requiredc                       e Zd Zy)-RequiredTests.test_cannot_subclass.<locals>.ENr|   rk   r^   r\   r  r  x  r   r^   r  z'Cannot subclass typing\.Required\[int\]c                       e Zd Zy)-RequiredTests.test_cannot_subclass.<locals>.FNr|   rk   r^   r\   r  r  |  r   r^   r  )r   r   r   r   r8   r   r
  s        r\   r   z"RequiredTests.test_cannot_subclasso  s    ##I/CD 	DN 	 ##I/CD 	D#' 	 ##I35 	H 	 ##I:< 	HSM 	 		 		 		 		 	r
  c                    | j                  t              5  t                d d d        | j                  t              5   t        t                      d d d        | j                  t              5   t        t        t        t
                            d d d        y # 1 sw Y   |xY w# 1 sw Y   VxY w# 1 sw Y   y xY wrb   )r   r   r8   r   r   r   r   s    r\   rI  zRequiredTests.test_cannot_init  r
  r
  c                    | j                  t              5  t        dt        t                  d d d        | j                  t              5  t        t        t               d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wrK  )r   r   r   r8   r   rT   r   s    r\   rL  z RequiredTests.test_no_isinstance  r
  r
  Nr
  rk   r^   r\   r  r  ^  s    L ,&r^   r  c                   *    e Zd Zd Zd Zd Zd Zd Zy)NotRequiredTestsc                 h   | j                  t              5  t        t            d d d        | j                  t              5  t        t        t
        f    d d d        | j                  t              5  t        t           t
            d d d        y # 1 sw Y   mxY w# 1 sw Y   HxY w# 1 sw Y   y xY wrb   )r   r   r7   r8   r   r   r   s    r\   r9  zNotRequiredTests.test_basics  s    y) 	"!	"y) 	"S!	"y) 	"S!	" 	"		" 	"	" 	"	" 	"r  c                     | j                  t        t              d       t        t           }| j                  t        |      d       t        t           }| j                  t        |      dt
         d       y )Nztyping.NotRequiredztyping.NotRequired[int]ztyping.NotRequired[r  )r   r   r7   r   r{   rh   r
  s     r\   r   zNotRequiredTests.test_repr  s_    k*,@Ab#<="b%8
*#MNr^   c           	      $   | j                  t        t              5   G d dt        t                    }d d d        | j                  t        t              5   G d dt        t        t
                       }d d d        | j                  t        d      5   G d dt              }d d d        | j                  t        d      5   G d	 d
t        t
                 }d d d        y # 1 sw Y   xY w# 1 sw Y   yxY w# 1 sw Y   WxY w# 1 sw Y   y xY w)Nc                       e Zd Zy)0NotRequiredTests.test_cannot_subclass.<locals>.CNr|   rk   r^   r\   rB  r    r   r^   rB  c                       e Zd Zy)0NotRequiredTests.test_cannot_subclass.<locals>.DNr|   rk   r^   r\   rE  r    r   r^   rE  z#Cannot subclass typing\.NotRequiredc                       e Zd Zy)0NotRequiredTests.test_cannot_subclass.<locals>.ENr|   rk   r^   r\   r  r    r   r^   r  z*Cannot subclass typing\.NotRequired\[int\]c                       e Zd Zy)0NotRequiredTests.test_cannot_subclass.<locals>.FNr|   rk   r^   r\   r  r    r   r^   r  )r   r   r   r   r7   r   r
  s        r\   r   z%NotRequiredTests.test_cannot_subclass  s    ##I/CD 	D% 	 ##I/CD 	DS)* 	 ##I68 	K 	 ##I=? 	K$ 	 		 		 		 		 	r
  c                    | j                  t              5  t                d d d        | j                  t              5   t        t                      d d d        | j                  t              5   t        t        t        t
                            d d d        y # 1 sw Y   |xY w# 1 sw Y   VxY w# 1 sw Y   y xY wrb   )r   r   r7   r   r   r   r   s    r\   rI  z!NotRequiredTests.test_cannot_init  s    y) 	M	y) 	 D	 y) 	/,DXc]+,.	/ 	/		 		  	 	/ 	/r
  c                    | j                  t              5  t        dt        t                  d d d        | j                  t              5  t        t        t               d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wrK  )r   r   r   r7   r   rT   r   s    r\   rL  z#NotRequiredTests.test_no_isinstance  sf    y) 	,q+c*+	,y) 	)sK(	) 	)	, 	,	) 	)r
  Nr
  rk   r^   r\   r  r    s    "O /)r^   r  c                   $    e Zd Zd Zd Zd Zd Zy)IOTestsc                     dt         dt        fd}|j                  d   }| j                  |j                  t        f       y )Nr  r   c                 "    | j                         S rb   readliner  s    r\   r0  zIOTests.test_io.<locals>.stuff      ::<r^   )r;   r   r   r   r  rW   r0  r  s      r\   test_iozIOTests.test_io  s?    	 R 	 F 	  !!#&))F95r^   c                 z    dt         dt        fd}|j                  d   }| j                  |j                  d       y )Nr  r   c                 "    | j                         S rb   r  r  s    r\   r0  z"IOTests.test_textio.<locals>.stuff  r  r^   rk   )r<   r   r   r   r  r  s      r\   test_textiozIOTests.test_textio  s=    	 V 	  	  !!#&))2.r^   c                 z    dt         dt        fd}|j                  d   }| j                  |j                  d       y )Nr  r   c                 "    | j                         S rb   r  r  s    r\   r0  z$IOTests.test_binaryio.<locals>.stuff  r  r^   rk   )r=   r  r   r   r  r  s      r\   test_binaryiozIOTests.test_binaryio  s=    	 X 	 % 	  !!#&))2.r^   c                    t        j                  d      5 }t        j                  dt               ddlm}m}m}m}m	} | j                  |t        j
                         | j                  |t        j                         | j                  |t        j                         | j                  t        |      t        g d             | j                  |d       | j                  t        |      d	       d d d        y # 1 sw Y   y xY w)
NTrecordr  categoryr   )r;   r<   r=   r	  rh   r:   z	typing.iorn   )warningscatch_warningsfilterwarningsr  	typing.ior;   r<   r=   r	  rh   r   rc   r   rY  r  )rW   wr;   r<   r=   r	  rh   s          r\   test_io_submodulezIOTests.test_io_submodule  s    $$D1 	(Q##I8JKIIMM"fii(MM&&--0MM(FOO4S\3/K+LMX{3SVQ'	( 	( 	(s   CC==DN)rh   ri   rj   r  r  r  r  rk   r^   r\   r  r    s    6//	(r^   r  c                   6    e Zd Zd Zd Zd Zd Zd Zd Zd Z	y)	RETestsc                 *   t        j                  dt         j                        }| j                  |j                  t
               | j                  t        |      t
               | j                  |t
               |j                  d      }| j                  |j                  t               | j                  t        |      t               | j                  |t               t
        t        t        t        f       t        t        t        t        f       y )Nz[a-z]+z12345abcde.....)r   compiler  r]   r   r>   r   r   searchr?   r   r   r  )rW   r,  mats      r\   r9  zRETests.test_basics  s    jj244(cmmW5d3i1c7+jj*+cmmU3d3i/c5) 	c5j!"eE3J r^   c                 6   | j                  t        t           t        t                  | j                  t        t           t        t                  | j                  t        t           t
        t                  | j                  t        t           t               y rb   )r   r>   r   r   r  r?   r   s    r\   test_alias_equalityzRETests.test_alias_equality  s^    ws|4GCL'%.9GCL%*5GCL#.r^   c                    t         t        t        t        f      }| j	                  t
              5  |t            d d d        | j	                  t
              5  t        dt        t                  d d d        | j	                  t
              5  t        t        t           t        t                  d d d        y # 1 sw Y   xY w# 1 sw Y   VxY w# 1 sw Y   y xY wr   )	r?   r   r   r  r   r   r   r>   rT   )rW   r  s     r\   r   zRETests.test_errors  s    %U
#$y) 	cF	y) 	)r73<(	) y) 	5wu~ws|4	5 	5	 		) 	)	5 	5s#   
B8C#C8CCCc                    | j                  t        t              d       | j                  t        t        t                 d       | j                  t        t        t                 d       | j                  t        t
              d       | j                  t        t
        t                 d       | j                  t        t
        t                 d       y )Nztyping.Patternztyping.Pattern[str]ztyping.Pattern[bytes]ztyping.Matchztyping.Match[str]ztyping.Match[bytes])r   r   r>   r   r  r?   r   s    r\   r   zRETests.test_repr   s    g(89gcl+-BCgen-/FGen5eCj)+>?eEl+-BCr^   c                    t        j                  d      5 }t        j                  dt               ddlm}m}m}m} | j                  |t        j
                         | j                  |t        j                         | j                  t        |      t        ddg             | j                  |d	       | j                  t        |      d
       d d d        y # 1 sw Y   y xY w)NTr  r  r  r   )r?   r>   r	  rh   r?   r>   	typing.rern   )r  r  r  r  	typing.rer?   r>   r	  rh   r   rc   r   rY  r  )rW   r  r?   r>   r	  rh   s         r\   test_re_submodulezRETests.test_re_submodule   s    $$D1 	(Q##I8JKCCMM%.MM'6>>2S\3/C+DEX{3SVQ'	( 	( 	(s   B;CC$c                    t        j                         5  t        j                  dt               ddlm} | j                  |j                  t               | j                  |j                  d       | j                  |j                  t        j                         d d d        | j                  t              5  j                   d d d        y # 1 sw Y   4xY w# 1 sw Y   y xY w)Nerrorr  r   )r   r  )r  r  r  r  rc   r   r   rO  r   r   rh   r  r  MappingProxyTyper  r?   )rW   r   s     r\   test_re_submodule_access_basicsz'RETests.test_re_submodule_access_basics   s    $$& 	G##G6HI!!!"**c2R[[+6!!"++u/E/EF	G 01 	HH	 		G 	G	 	s   BC:CCC%c                    | j                  t        d      5   G d dt        j                        }d d d        | j                  t        d      5   G d dt        j                        }d d d        y # 1 sw Y   BxY w# 1 sw Y   y xY w)Nz/type 're\.Match' is not an acceptable base typec                       e Zd Zy)'RETests.test_cannot_subclass.<locals>.ANr|   rk   r^   r\   r   r  )   r   r^   r   z1type 're\.Pattern' is not an acceptable base typec                       e Zd Zy)'RETests.test_cannot_subclass.<locals>.BNr|   rk   r^   r\   r   r  /   r   r^   r   )r   r   rc   r?   r>   r   s      r\   r   zRETests.test_cannot_subclass$   s{    ##>
 	FLL 		 ##@
 	FNN 		 		 		 	s   A2A>2A;>BN)
rh   ri   rj   r9  r  r   r   r  r  r   rk   r^   r\   r  r    s&    !/	5D(	r^   r  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)AnnotatedTestsc                 n    | j                  t        d      5  t                d d d        y # 1 sw Y   y xY w)Nz%Type Annotated cannot be instantiatedr   r   r@   r   s    r\   test_newzAnnotatedTests.test_new5   s2    ##3
 	 K		 	 	s   +4c                     | j                  t        t        t        ddf         d       | j                  t        t        t        t           ddf         d       y )NrT  rU  ztyping.Annotated[int, 4, 5]z(typing.Annotated[typing.List[int], 4, 5])r   r   r@   r   r   r   s    r\   r   zAnnotatedTests.test_repr<   sP    319%&)	
 	49a?+,6	
r^   c                     t        t        t        t        df               }dD ]/  }| j	                  |      5  | j                  ||       d d d        1 y # 1 sw Y   <xY w)NrT  )r  r  r  __metadata__rW  )rY  rZ  r@   r   ru   r[  r\  s      r\   r^  zAnnotatedTests.test_dirF   sc    Ic1f-./	
 	8M M: 8mY78 8		88 8s   AA 	c                     t         t         t        df   df   }| j                  |t         t        ddf          | j                  |j                  d       | j                  |j                  t               y )NrT  rU  rS  )r@   r   r   r%  r  r  s     r\   r}  zAnnotatedTests.test_flattenO   s]    iQ'*+Ic1ai010s+r^   c                 H   | j                  t        t        t        df   t        z        t        t        df   t        f       | j                  t        t        t        t        df   t        f         t        t        df   t        f       | j                  t        t        t        df   t        t        df   z  t        z        t        t        df   t        t        df   t        f       | j                  t        t        t        t        df   t        t        df   t        f         t        t        df   t        t        df   t        f       | j                  t        t        t        df   t        t
        df   z  t        z        t        t        df   t        t
        df   t        f       | j                  t        t        t        t        df   t        t
        df   t        f         t        t        df   t        t
        df   t        f       | j                  t        t        df   t        t        df   z  t        z  t        t        df   t        z         | j                  t        t        t        df   t        t        df   t        f   t        t        t        df   t        f          | j                  t        t
        t        t        i f   z  t        t        t               f   z  t        z        t
        t        t        i f   t        t        t               f   t        f       | j                  t        t        t
        t        t        i f   t        t        t               f   t        f         t
        t        t        i f   t        t        t               f   t        f       | j                  t        t
        t        t        i f   z  t        t
        i f   z  t        z        t
        t        t        i f   t        t
        i f   t        f       | j                  t        t        t
        t        t        i f   t        t
        i f   t        f         t
        t        t        i f   t        t
        i f   t        f       | j                  t        t        t        df   t
        z  t        t
        i f   z  t        z        t        t        df   t
        t        t
        i f   t        f       | j                  t        t        t        t        df   t
        t        t
        i f   t        f         t        t        df   t
        t        t
        i f   t        f       dd l}|j                   G d d             } |dd      }| j                  t        t        t        |f   d z        t        t        |f   t        j                  f       | j                  t        t        t        t        |f   d f         t        t        |f   t        j                  f       | j                  t        t        t        t        |f            t        t        |f   t        j                  f       | j                  t        t        i f   t        t        i f   z  t        z  t        t        i f   t        z         | j                  t        t        i f   t        t        i f   z  t        z  t        t        t        i f   z         | j                  t        t        t        i f   t        t        i f   t        f   t        t        t        i f   t        f          | j                  t        t        t        i f   t        t        i f   t        f   t        t        t        t        i f   f          y )Nrn   r   r   c                   "    e Zd ZU eed<   eed<   y)>AnnotatedTests.test_deduplicate_from_union.<locals>.ValueRangelor   Nr  rk   r^   r\   
ValueRanger)  z   s    GGr^   r+  )r   r-   r@   r   r   r   rY  dataclasses	dataclassr  NoneTyper   )rW   r,  r+  r  s       r\   test_deduplicate_from_unionz*AnnotatedTests.test_deduplicate_from_unionU   s   )CF"3c"9:#CF+S1	3%	#q&(93(>"?@#CF+S1	3)CF"3iQ6G"G#"MN#CF+YsAv->D	F%	#q&(99S!V;Lc(Q"RS#CF+YsAv->D	F)CF"3iQ6G"G#"MN#CF+YsAv->D	F%	#q&(99S!V;Lc(Q"RS#CF+YsAv->D	F 	36*YsAv->>D"36*S0	2ya0)CF2CSHIya0#56	8 	#	#r'(:":YsCEz=R"RUX"XYyb19S#%Z3H#N	P%YsBw-?3PSPU:AVX[(["\]yb19S#%Z3H#N	P#	#r'(:":YsBw=O"ORU"UVyb19S"W3EsK	M%YsBw-?3PR7ASUX(X"YZyb19S"W3EsK	M 	)CF"3c"9Ic2g<N"NQT"TU#CF+S)CG2DcJ	L%	#q&(93	#r'@RTW(W"XY#CF+S)CG2DcJ	L 					 	 
	 q!)CF"3d":;#CF+U^^<	>%	#q&(94(?"@A#CF+U^^<	>(9S!V+<"=>#CF+U^^<	> 	37+iR.@@3F"37+c1	337+iR.@@3Fyb11	3yb19S"W3EsJKyb1367	9yb19S"W3EsJKsIc2g$667	9r^   c           	      j   t         t        df   t        z  t         t        i f   z  t        z  }t        j                  t        |            D ]G  }| j                  |      5  | j                  |t        t        j                  |             d d d        I t        t         t        df   t        t         t        i f   t        f   }t        j                  t        |            D ]6  }| j                  |      5  | j                  |t        |          d d d        8 y # 1 sw Y   xY w# 1 sw Y   OxY w)Nrn   r  )r@   r   r   r  permutationsr-   ru   r   r   operatoror_r   )rW   expr1r   expr2s       r\   test_order_in_unionz"AnnotatedTests.test_order_in_union   s   #q&!C')CG*<<sB**8E?; 	DD4( D  x||T(BCD D	D iQ'iR.@#EF**8E?; 	5D4( 5  d45 5	5	D D
5 5s   !+D8D)D&	)D2	c                 0   t         t        t           df   }t         t        t           df   }| j	                  |t           t         t        t           df          | j	                  |t           j
                  d       | j	                  |t           j                  t        t                  | j                  t              5  |t            d d d        | j                  t              5  |t        t        f    d d d        y # 1 sw Y   7xY w# 1 sw Y   y xY w)Nmy decoration)r8  )
r@   r   r   r   r   r%  r  r   r   r{  )rW   r  LIs      r\   test_specializezAnnotatedTests.test_specialize   s    d1g./tCy/12349o+E!FG3,,.@A3**DI6y) 	sG	y) 	c5jM	 		 		 	s    
D 'D D	Dc           	      p   | j                  t        t        t        ddf   t        t        ddf   h      d       | j	                  t        t        ddf   t        t        ddf          | j	                  t        t        ddf   t        t
        ddf          | j	                  t        t        df   t        t        ddf          | j                  t        t        ddf   t        t        ddf   t        t        ddf   ht        t        ddf   t        t        ddf   h       t        t        g f   }| j                  t              5  t        |       d d d         G d d      }t        t         |       f   }| j                  t              5  t        |       d d d        y # 1 sw Y   QxY w# 1 sw Y   y xY w)NrT  rU  rn   c                       e Zd ZdZy)&AnnotatedTests.test_hash_eq.<locals>.ANr  rk   r^   r\   r   r=     r  r^   r   )
r   r  r@   r   r   r   r   r   r   r  )rW   a1r   a2s       r\   test_hash_eqzAnnotatedTests.test_hash_eq   s|   iQ	2Ic1ai4HIJANIc1ai0)CAI2FGIc1ai0)CAI2FGIc1f-ya/CDsAqy!9S!QY#71a79KLsAqy!9Q1W#56	

 sBwy) 	H		 	sACx y) 	H	 		 		 	s   F F, F),F5c                     G fdd      t         df   } |d      } d      }| j                  ||       | j                  |j                  |j                         | j                  |j                  |j                         y )Nc                   "    e Zd ZdZd Z fdZy)*AnnotatedTests.test_instantiate.<locals>.CrT  c                     || _         y rb   r   r   s     r\   r   z3AnnotatedTests.test_instantiate.<locals>.C.__init__   r   r^   c                 Z    t        |      st        S |j                  | j                  k(  S rb   )r   NotImplementedr   )rW   rc  rB  s     r\   __eq__z1AnnotatedTests.test_instantiate.<locals>.C.__eq__   s&    !%+))ww$&&((r^   N)rh   ri   rj   classvarr   rG  r  s   r\   rB  rC     s    H)r^   rB  a decorationrU  )r@   r   r   rH  )rW   r   r  r  rB  s       @r\   test_instantiatezAnnotatedTests.test_instantiate   sp    		) 		) a'(aDaDAacc"QZZ0r^   c                     t         t        j                  t           df   }| j	                   |g d      ddd       | j	                   |t
           g d      ddd       y )Nr8  )rT  rT  rU  r   rn   rS  )r@   rc   r  r   r   r   )rW   MyCounts     r\   test_instantiate_genericz'AnnotatedTests.test_instantiate_generic   sR    FNN1->?+q\:i0aA,?r^   c                 \     G d d      }t         |df   }| j                   |       |       y )Nc                       e Zd Zd Zy)4AnnotatedTests.test_instantiate_immutable.<locals>.Cc                     t        d      )Nzshould be ignored)r  r  s      r\   r  z@AnnotatedTests.test_instantiate_immutable.<locals>.C.__setattr__   s     344r^   N)rh   ri   rj   r  rk   r^   r\   rB  rP     s    5r^   rB  rI  )r@   r   rW   rB  r   s      r\   test_instantiate_immutablez)AnnotatedTests.test_instantiate_immutable   s1    	5 	5 a'( 	ac1%r^   c                 z    t         d   }| j                  t              5   |d       d d d        y # 1 sw Y   y xY w)N)r   rU  r  rU  )r@   r   r   r  s     r\   test_cannot_instantiate_forwardz.AnnotatedTests.test_cannot_instantiate_forward   s6    m$y) 	aD	 	 	s   	1:c                     t         t        df   }| j                  t              5   |d       d d d        y # 1 sw Y   y xY w)NrU  rU  )r@   r   r   r   r  s     r\    test_cannot_instantiate_type_varz/AnnotatedTests.test_cannot_instantiate_type_var   s:    ai y) 	aD	 	 	s	   	7A c                     | j                  t              5  t        t        df   j                   d d d        y # 1 sw Y   y xY w)N)rU  r  )r   r  r@   r   r   r   s    r\   test_cannot_getattr_typevarz*AnnotatedTests.test_cannot_getattr_typevar   s7    ~. 	#ai ""	# 	# 	#	   9Ac                      G d d      }t         |df   }| j                  |j                  d       d|_        | j                  |j                  d       y )Nc                       e Zd ZdZy)/AnnotatedTests.test_attr_passthrough.<locals>.CrT  N)rh   ri   rj   rH  rk   r^   r\   rB  r^     s    Hr^   rB  rI  rT  rU  )r@   r   rH  r   rR  s      r\   test_attr_passthroughz$AnnotatedTests.test_attr_passthrough   sL    	 	 a'(Q'a r^   c                      G d d      }| j                  t        |t                     d   t        t                  | j                  t        |t                     d   t
        t                  y )Nc                   J    e Zd ZU dZeee   df   ed<   dZee	e   df   ed<   y)7AnnotatedTests.test_special_form_containment.<locals>.CrT  rI  rH  r  r  N)
rh   ri   rj   rH  r@   r$   r   r   r  r%   rk   r^   r\   rB  rb     s2    ABHi~ =>B45E9U3Z015r^   rB  rH  r  )r   r+   r  r$   r   r%   r$  s     r\   test_special_form_containmentz,AnnotatedTests.test_special_form_containment   sR    	6 	6 	795jA8C=Q795g>c
Kr^   c                 x    | j                  t        d      5   G d dt              }d d d        y # 1 sw Y   y xY w)NzCannot subclass .*Annotatedc                       e Zd Zy).AnnotatedTests.test_cannot_subclass.<locals>.CNr|   rk   r^   r\   rB  rf     r   r^   rB  r!  r$  s     r\   r   z#AnnotatedTests.test_cannot_subclass   s4    ##I/LM 	I 	 	 	rC  c                     | j                  t              5  t        dt        t        df          d d d        y # 1 sw Y   y xY w)NrU  positive)r   r   r   r@   r   r   s    r\   test_cannot_check_instancez)AnnotatedTests.test_cannot_check_instance!  s8    y) 	6q)CO45	6 	6 	6r[  c                     | j                  t              5  t        t        t        t        df          d d d        y # 1 sw Y   y xY w)Nrh  )r   r   rT   r   r@   r   s    r\   test_cannot_check_subclassz)AnnotatedTests.test_cannot_check_subclass!  s8    y) 	8sIc:o67	8 	8 	8s	   =Ac                 t    | j                  t        d      5  t        t            d d d        y # 1 sw Y   y xY w)Nzat least two arguments)r   r   r@   r   r   s    r\   test_too_few_type_argsz%AnnotatedTests.test_too_few_type_args	!  s/    ##I/GH 	cN	 	 	s   .7c                    t         j                  t         j                  t        t        f   t         j
                  t           t        t        df   t         j                  t        gt        f   g}|D ]  }t        |df   }t        t        j                  dz         D ][  }| j                  ||      5  t        j                  ||      }t        j                  |      }| j!                  ||       d d d        ]   G d dt"        t$                 at        t&        t           df   }d|_        d	|_        t        t        j                  dz         D ]  }t        j                  ||      }	t        j                  |	      }| j!                  |j(                  d       | j!                  |j*                  d	       | j!                  |j,                  d        y # 1 sw Y   ExY w)
N.r  rn   )protocolr   c                       e Zd ZdZy)_Annotated_test_Grn   Nrz  rk   r^   r\   rq  rq  !  r  r^   rq  zA decorationr   r  )rc   r   r   r   r   r   r   r"   r  r@   rr   rs   rt   ru   rv  ru  r   r#   r   rq  rk  r*  r   )
rW   r"  r  r   protr  restoredr  rq   rQ  s
             r\   r$  zAnnotatedTests.test_pickle!  s   ::v||CH5??3'sCx??C5%<02  	2A!S&!Af559: 2\\4a\8 2$ll1d3G%||G4H$$Q12 22	2	
 	 ',n<=622Q67 	%EQ&AQAQUUB'QUUE*QSS!$	%2 2s   1>GG c                 V   d}d}t         t        |f   }| j                  |t           t         t        |f          | j                  |t         t        |f      t         t        ||f          t         t        t           |f   }| j                  |t           t         t        t           |f          | j                  t              5  |t        t        f    d d d        | j                  ||t              t         t        t           ||f          t         t        j                  t        t        f   |f   }| j                  |t        t        f   t         t        j                  t        t        f   |f          | j                  t              5  |t            d d d        t         t        |f   }| j                  t              5  |d     d d d        |t           }| j                  t              5  |d     d d d        y # 1 sw Y   *xY w# 1 sw Y   uxY w# 1 sw Y   OxY w# 1 sw Y   y xY w)NrI  zanother decoration)r@   r   r   r   r   r   r   rc   r    r   r   r   )rW   r  dec2r  r  rE  Itr9  s           r\   
test_substzAnnotatedTests.test_subst+!  s   #ag339!569S#X./3T>1JKd1gsl#349c>!:;y) 	c3hK	 	1S6Id3id.B$CDfkk"b&)3./38iCH0Es0J&KLy) 	cF	 sCx y) 	tH	 sVy) 	tH	 		 		 		 		 	s0   G:	
H?H+H:HHHH(c                    d}t        d      }t        d      }t        d      }t        d      }t        t        g |   |f   }| j	                  |t
           t        t        t
           |f          | j	                  |t        t
        f   t        t        t        t
        f   |f          | j                  t              5  t        g ||    d d d        t        t        t        |      |f   }| j	                  |t
           t        t        t
           |f          | j	                  |t        t
        f   t        t        t        t
        f   |f          | j                  t              5  t        t        |   |f    d d d        t        t        |g|   |f   }| j	                  |t
           t        t        t
           |f          | j	                  |t
        t        f   t        t        t
        t        f   |f          | j	                  |t
        t        t        f   t        t        t
        t        t        f   |f          | j                  t              5  |d    d d d        t        t        |t        |   f   |f   }	| j	                  |	t
           t        t        t
           |f          | j	                  |	t
        t        f   t        t        t
        t        f   |f          | j	                  |	t
        t        t        f   t        t        t
        t        t        f   |f          | j                  t              5  |	d    d d d        t        t        g ||   |f   }
| j	                  |
t
           t        t        t
           |f          | j	                  |
t
        t        f   t        t        t
        t        f   |f          | j	                  |
t
        t        t        f   t        t        t
        t        t        f   |f          | j                  t              5  |
d    d d d        t        t        t        |   |f   |f   }| j	                  |t
           t        t        t
           |f          | j	                  |t
        t        f   t        t        t
        t        f   |f          | j	                  |t
        t        t        f   t        t        t
        t        t        f   |f          | j                  t              5  |d    d d d        t        t        |g||   |f   }| j	                  |t
        t        f   t        t        t
        t        f   |f          | j	                  |t
        t        t        f   t        t        t
        t        t        f   |f          | j	                  |t
        t        t        t        f   t        t        t
        t        t        t        f   |f          | j                  t              5  |t
            d d d        t        t        |t        |   |f   |f   }| j	                  |t
        t        f   t        t        t
        t        f   |f          | j	                  |t
        t        t        f   t        t        t
        t        t        f   |f          | j	                  |t
        t        t        t        f   t        t        t
        t        t        t        f   |f          | j                  t              5  |t
            d d d        t        d      }t        d      }t        d	      }||g||   }||t        |   |f   }|t        t        |g||   |f   f|t        t        |t        |   |f   |f   f|t
        t        f   t        t        t
        t        f   |f   f|t
        t        f   t        t        t
        t        f   |f   f|t
        t        t        f   t        t        t
        t        t        f   |f   f|t
        t        t        f   t        t        t
        t        t        f   |f   f|t
        t        t        t        f   t        t        t
        t        t        t        f   |f   f|t
        t        t        t        f   t        t        t
        t        t        t        f   |f   ffD ]  \  }}| j	                  ||        | j                  t              5  |t
            d d d        | j                  t              5  |t
            d d d        y # 1 sw Y   txY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   #xY w# 1 sw Y   MxY w# 1 sw Y   sxY w# 1 sw Y   xxY w# 1 sw Y   yxY w# 1 sw Y   xY w# 1 sw Y   y xY w)
NrI  r  r   r"  r#  rk   r   r4  T4)r   r   r@   r  r   r   r   r   r   r   r   r{  r,  )rW   r  r  r   r"  r#  r   r   rB  rE  r  r  r  r  r   r4  ry  r  r  r   r   s                        r\   test_typevar_substz!AnnotatedTests.test_typevar_substH!  sM   $CLT]T]eCRCj#o&35:s?!;<38ic3h0D&EFy) 	 hrh3h	  eF2J',-35:s?!;<38ic3h0D&EFy) 	'fRj#o&	' eAFFmS()35:s?!;<38ic3h0D&EFc3oeCeO,c12	
 y) 	bE	 eAvbzM*C/035:s?!;<38ic3h0D&EFc3oeCeO,c12	
 y) 	bE	 eFRFFmS()35:s?!;<38ic3h0D&EFc3oeCeO,c12	
 y) 	bE	 eF2JM*C/035:s?!;<38ic3h0D&EFc3oeCeO,c12	
 y) 	bE	 eBKKRK(#-.38ic3h0D&EFc3oeCeO,c12	
 	c3e#$eCdE12C78	
 y) 	cF	 eBr
B./4538ic3h0D&EFc3oeCeO,c12	
 	c3e#$eCdE12C78	
 y) 	cF	
 5!T]T] bl3llOb&+r!" 5c2+>+C!DE5VC["1D+Es+J!KLsCx[5c?C+?!@AsCx[5c?C+?!@AsC5c5+A3+F!GHsC5c5+A3+F!GHsCu$%!*5c41F+G+L!MOsCu$%!*5c41F+G+L!MO
 	#DAq Q"	# y) 	cF	y) 	cF	 	K	  	 	' 	'	 		 		 		 		 		 	6	 		 	sx   ?e *ee e'#e4
f
f
f
f(-
f4 e
ee$'e14e>fff%(f14f=c                     t         t        t        df      }| j                  |t           t         t        t        df             y )NrU  )r   r@   r   r   r   r  s     r\   test_annotated_in_other_typesz,AnnotatedTests.test_annotated_in_other_types!  s6    1a4!3iQ&7!89r^   c                      G d dt         t        df         }| j                  |j                  |t        t        fd       y )Nc                       e Zd Zy),AnnotatedTests.test_annotated_mro.<locals>.XNr|   rk   r^   r\   r  r  !  r   r^   r  r  z Annotated should be transparent.)r@   r   r   r  r  r  s     r\   test_annotated_mroz!AnnotatedTests.test_annotated_mro!  s3    -	#w,'-QV$4;	=r^   c                     G d dt               } G d dt               }t        t          |d      f   }t        t          |d      f   }|j                  d   }|j                  d   }| j                  t	        |      |       | j                  | |d             | j                  t	        |      |       | j                  | |d             | j                  t	        |      t	        |             t        t          |d      f   }t        t          |d      f   }|j                  d   }	|j                  d   }
| j                  t	        |	      |       | j                  |	 |d             | j                  t	        |
      |       | j                  |
 |d             | j                  t	        |	      t	        |
             t        t        df   }t        t        d	f   }t        t        d
f   }| j                  t	        |j                  d         t               | j                  t	        |j                  d         t               | j                  t	        |j                  d         t               y )Nc                       e Zd Zy):AnnotatedTests.test_annotated_cached_with_types.<locals>.ANr|   rk   r^   r\   r   r  !  r   r^   r   c                       e Zd Zy):AnnotatedTests.test_annotated_cached_with_types.<locals>.BNr|   rk   r^   r\   r   r  !  r   r^   r   r  r   r  rn   g      ?T)
r   r@   r%  r   r   r   r	  r   r{  r,  )rW   r   r   field_a1field_a2a1_metadataa2_metadatafield_b1field_b2b1_metadatab2_metadatafield_c1field_c2field_c3s                 r\    test_annotated_cached_with_typesz/AnnotatedTests.test_annotated_cached_with_types!  s   S!C&[)S!C&[)++A.++A.d;'+af-d;'+af-k*D,=>S!C&[)S!C&[)++A.++A.d;'+af-d;'+af-k*D,=>S!V$S#X&S$Y'd80034c:d80034e<d80034d;r^   N)rh   ri   rj   r"  r   r^  r}  r/  r6  r:  r@  rJ  rM  rS  rV  rX  rZ  r_  rc  r   ri  rk  rm  r$  rw  rz  r|  r  r  rk   r^   r\   r  r  3   s    
8,99v	5	(1&@
	&

#!L
68%<:pd:=
 <r^   r  c                   B    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zy
)TypeAliasTestsc                     t         }y rb   r{   rW   r  s     r\   -test_canonical_usage_with_variable_annotationz<TypeAliasTests.test_canonical_usage_with_variable_annotation!  s    #r^   c                     t         }y rb   r  r  s     r\   &test_canonical_usage_with_type_commentz5TypeAliasTests.test_canonical_usage_with_type_comment!  s    r^   c                 l    | j                  t              5  t                d d d        y # 1 sw Y   y xY wrb   )r   r   rD   r   s    r\   r   z&TypeAliasTests.test_cannot_instantiate!  s*    y) 	K	 	 	rf  c                 x    | j                  t              5  t        dt               d d d        y # 1 sw Y   y xY wr   )r   r   r   rD   r   s    r\   rL  z!TypeAliasTests.test_no_isinstance!  s/    y) 	&r9%	& 	& 	&r   c                 Z     G d d      }| j                  t        |      dt        i       y )Nc                       e Zd ZU ded<   y)/TypeAliasTests.test_stringized_usage.<locals>.ArD   r  Nrs  rk   r^   r\   r   r  !  s    Nr^   r   r  )r   r+   rD   r  s     r\   test_stringized_usagez$TypeAliasTests.test_stringized_usage!  s&    	 	*S),<=r^   c                     | j                  t              5  t        t        t               d d d        | j                  t              5  t        t        t               d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wrb   )r   r   rT   r{   rD   r   s    r\   test_no_issubclassz!TypeAliasTests.test_no_issubclass!  sc    y) 	,x+	, y) 	,y(+	, 	,	, 	,	, 	,s   A&A2&A/2A;c                     | j                  t        d      5   G d dt              }d d d        | j                  t              5   G d dt	        t                    }d d d        y # 1 sw Y   @xY w# 1 sw Y   y xY w)Nz!Cannot subclass typing\.TypeAliasc                       e Zd Zy).TypeAliasTests.test_cannot_subclass.<locals>.CNr|   rk   r^   r\   rB  r  "  r   r^   rB  c                       e Zd Zy).TypeAliasTests.test_cannot_subclass.<locals>.DNr|   rk   r^   r\   rE  r  "  r   r^   rE  )r   r   rD   r   r   rF  s      r\   r   z#TypeAliasTests.test_cannot_subclass"  sp    ##I46 	I 	
 y) 	DO 	 		 	
	 	s   A&A2&A/2A;c                 B    | j                  t        t              d       y )Nztyping.TypeAlias)r   r   rD   r   s    r\   r   zTypeAliasTests.test_repr"  s    i*<=r^   c                 r    | j                  t              5  t        t            d d d        y # 1 sw Y   y xY wrb   )r   r   rD   r   r   s    r\   r=  z$TypeAliasTests.test_cannot_subscript"  s,    y) 	cN	 	 	r>  N)rh   ri   rj   r  r  r   rL  r  r  r   r   r=  rk   r^   r\   r  r  !  s/    $&>
,>r^   r  c                   f    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zy)ParamSpecTestsc                     t        d      }| j                  ||       | j                  |t                | j                  |j                  d       | j                  |j                  t               y )Nr  )rE   r   r   rh   ri   rn  s     r\   rx  zParamSpecTests.test_basic_plain"  sS    cNAa+S)x0r^   c                     i }t        d||       |d   }| j                  |t               | j                  |j                  d       | j                  |j                  d        y )Nz0from typing import ParamSpec; P = ParamSpec("P")r  )rz  r   rE   r   rh   r   ri   )rW   r|  r  s      r\   r}  z#ParamSpecTests.test_basic_with_exec"  sS    ?RHsGa+S)allD)r^   c                    t        d      }t        d      }t        |t        f   }| j	                  |j
                  |t        f       | j	                  |j                  |f       t        ||f   }| j	                  |j
                  ||f       | j	                  |j                  ||f       t        j                  j                  |t        f   }| j	                  |j
                  |t        f       | j	                  |j                  |f       t        j                  j                  ||f   }| j	                  |j
                  ||f       | j	                  |j                  ||f       y Nr  r   )	rE   r   r"   r   r   r  r  r  r  rW   r  r   r&  r'  r(  r)  s          r\   test_valid_useszParamSpecTests.test_valid_uses$"  s#   cNCLafq#h/**QD1ad^q!f-**QF3__%%af-q#h/**QD1__%%ad+q!f-**QF3r^   c                 \   t        d      }t        d      }| j                  dt        |             | j                  dt        |             | j                  |j                  t
               | j                  |j                  t               | j                  |j                  j                  |       | j                  |j                  j                  |       | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  |j                  |j                         | j                  t        |j                        d       | j                  t        |j                        d       y )Nr  P_2r   r   P.argsP.kwargs)rE   r[  rZ  r   r   rG   r   rH   r   r  r   r   r   )rW   r  r  s      r\   test_args_kwargszParamSpecTests.test_args_kwargs5"  si   cNfc!f%hA'affm4ahh8aff''+ahh))1-(188,AFFCHH-AHHcjj1AFFAHH-AHHaff-AFFCJJ/affx0ahh4r^   c                 R   t        d      } G d dt        |         }| j                  t        |t	               t                     dt        |t        f   i       | j                  t        |j                  t	               t                     |j                  |j                  d       y )Nr  c                   *    e Zd ZU edef   ed<   ddZy))ParamSpecTests.test_stringized.<locals>.Cr  r
  c                      y rb   rk   r   s      r\   rk  z-ParamSpecTests.test_stringized.<locals>.C.fooL"  r  r^   N)r   r  r   r  )rh   ri   rj   r"   r   r   rk  rk   r^   r\   rB  r  J"  s    38$$r^   rB  r
  r/  )rE   r#   r   r  r  r  r"   r   rk  r   r   r~  s      r\   test_stringizedzParamSpecTests.test_stringizedH"  sy    cN	
 	
 	Q	684vx3?O6PQwy&(+aff-Q	
r^   c                 $   t        d      t        d      t        d      } G fddt        f         }|t        |f   }| j	                  |j
                  t        |f       | j	                  |j                  |f       | j                  t        d      5  |t            d d d        | j                  t        d      5  |t        |t        f    d d d        |t        t        t        |f   f   }| j	                  |j
                  t        t        t        |f   f       | j	                  |j                  |f       |t        t        t        gf   }| j	                  |j
                  t        t        t        ff       | j	                  |j                  d       |t        d	f   }| j	                  |j
                  t        t        f       | j	                  |j                  d        G fd
dt                 }|t        t        t        g   }| j	                  |j
                  t        t        t        ff       | j	                  |j                  d       |t        t        t        f   }	| j	                  |	j
                  t        t        t        ff       | j	                  |	j                  d       | j	                  |j
                  |	j
                         | j	                  |j                  |	j                         | j	                  |j                  |	j                         | j	                  ||	       |t           }
| j	                  |
j
                  t        ff       | j	                  |
j                  d       | j                  t        d      5  |t        t        gt        f    d d d        | j                  t        d      5  ||t        f    d d d        y # 1 sw Y   =xY w# 1 sw Y   xY w# 1 sw Y   NxY w# 1 sw Y   y xY w)Nr   r  r  c                   2    e Zd ZU eW  ef   ed<   W ed<   y),ParamSpecTests.test_user_generics.<locals>.Xrf   r   Nrh   ri   rj   r"   r   r   )r  r   s   r\   r  r  Y"  s    3Dr^   r  rC  rB  rk   .c                   &    e Zd ZU eW  ef   ed<   y),ParamSpecTests.test_user_generics.<locals>.Zrf   Nr  )r  s   r\   r  r  p"  s    3r^   r  )r   rE   r#   r   r   r  r  r   r   r   rF   r,  rO	  r  )rW   r  r  r  r  G3G4r  G5G6G7r  r   s              @@r\   test_user_genericsz!ParamSpecTests.test_user_genericsT"  sG   CLcN	1 	 sCx[sCj1**SF3##I/BC 	cF	##I/CD 	c3m	 sKS))*sKS,A&BC**SF3sS$K sS$K&89**B/sCx[sHo6**B/	 
 	  S$ S$'7&9:**B/sC~S$'7&9:**B/ 	bkk26**B,=,=>R sVvi0**B/##I/CD 	 sCj$	 ##I/CD 	c4iL	 	Q	 		 	H	  	 	 	s0   
O O-O:P O*-O7:PPc                    t        d      t        d       G fddt        f         }|t        t        gt        gf   }|t        gt        t        gf   }| j                  ||       | j                  |j                  t        t        ft        ff       | j                  |j                  t        ft        t        ff       y )Nr  r8  c                   <    e Zd ZU eW  ef   ed<   eW ef   ed<   y)CParamSpecTests.test_multiple_paramspecs_in_user_generics.<locals>.Xrf   r  N)rh   ri   rj   r"   r   r   r   )r  r8  s   r\   r  r  "  s!    3C  r^   r  )rE   r#   r   r   r  r   r   r  )rW   r  r  r  r  r8  s       @@r\   )test_multiple_paramspecs_in_user_genericsz8ParamSpecTests.test_multiple_paramspecs_in_user_generics"  s    cNt_	!2 	! SzE7"#usEl"#B#SzE8&<=vU|&<=r^   c                 l   t        d      t        d       G fddt        g          }|t        t        gf   }| j                  |j                  t        t        ff       |t        t        t        gf   }| j                  |j                  t        t        t        ff       |t        g   }| j                  |j                  t        ff       |g    }| j                  |j                  d       | j                  t              5  |d    d d d         G fddt        g         }|t        gt        f   }| j                  |j                  t        ft        f       |t        gt        t        f   }| j                  |j                  t        ft        t        f       |t        g   }| j                  |j                  t        ff       |g    }| j                  |j                  d       | j                  t              5  |d    d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)	Nr  r  c                   >    e Zd ZU eW  ef   ed<   eg W    ed<   y)KParamSpecTests.test_typevartuple_and_paramspecs_in_user_generics.<locals>.Xrf   r  Nrh   ri   rj   r"   r   r   r   r  r  s   r\   r  r  "      3SbSzMr^   r  )rk   rk   c                   >    e Zd ZU eW  ef   ed<   eg W    ed<   y)KParamSpecTests.test_typevartuple_and_paramspecs_in_user_generics.<locals>.Yrf   r  Nr  r  s   r\   r  r  "  r  r^   r  )
r   rE   r#   r   r  r   r  r   r   r   )	rW   r  r  r  r  r  r  r  r  s	          @@r\   1test_typevartuple_and_paramspecs_in_user_genericsz@ParamSpecTests.test_typevartuple_and_paramspecs_in_user_generics"  s   $cN	Q 	 sUG|_sUHo6sC% !sC%&:;wZxk2rUe,y) 	bE		B 	 w|_xo6wS !xc&:;wZxk2rUe,y) 	bE	 		 		 	s   HH*H'*H3c           
         t        d      }t        d      }t        d      }t        t        j
                  j                  fD ]  }| j                  |      5  ||t        g |   f   }|t        t        gt        t        f   }| j                  |j                  t        t        t        t        t        f   f       d d d          G d dt        ||f         }|t        g |   |f   }|t        t        t        t        gf   }| j                  |j                  t        t        t        f   t        t        ff        G d dt        ||f         }||t        g |   f   }|t        t        gt        t        f   }| j                  |j                  t        t        ft        t        t        f   f       y # 1 sw Y   ~xY w)	Nr  r   r  )r  c                       e Zd Zy)MParamSpecTests.test_typevartuple_and_paramspecs_in_generic_aliases.<locals>.XNr|   rk   r^   r\   r  r  "  r  r^   r  c                       e Zd Zy)MParamSpecTests.test_typevartuple_and_paramspecs_in_generic_aliases.<locals>.YNr|   rk   r^   r\   r  r  "  r  r^   r  )rE   r   r   r"   r  r  ru   r   r   r   r  r{  r   r  r#   )	rW   r  r   r  rB  r   r   r  r  s	            r\   3test_typevartuple_and_paramspecs_in_generic_aliaseszBParamSpecTests.test_typevartuple_and_paramspecs_in_generic_aliases"  s   cNCL$;??333 	NAa( Nassm$sCj%./  c3eUl8K-LMN N	N	1 	 eCRCj!meUS#J&'eE5L&9C;%GH	1 	 assmsCj%&'sCk53F%GH#N Ns   A$F66G 	c                    t        d      }|j                  }| j                   |t        t        f      t        t        f       | j                   |t        t        g      t        t        f       | j                   |d g      t        d       f       | j                   |d      d       | j                   ||      |       | j                   |t        t        |f         t        t        |f          y )Nr  .)rE   r  r   r   r   r   r   rF   )rW   r  r  s      r\   r  z$ParamSpecTests.test_var_substitution"  s    cN""Sz*S#J7Sz*S#J7vd6eCj#&eAh"{3623[a5HIr^   c                    t        d      }t        d      }dt        d |t        t        z  t        t        t        f   f}|D ]  }| j                  |      5  | j                  t              5  |j                  |       d d d        | j                  t              5  t        j                  ||f   |t        f    d d d        | j                  t              5  t        j                  j                  ||f   |t        f    d d d        d d d         y # 1 sw Y   xY w# 1 sw Y   fxY w# 1 sw Y   ,xY w# 1 sw Y   xY w)Nr   r  r   r   )r   rE   r   r   r   ru   r   r   r  rc   r"   r  r  )rW   r   r  r  r   s        r\   r  z(ParamSpecTests.test_bad_var_substitution"  s   CLcNT1c#guS#X? 	=C#& =&&y1 ,&&s+,&&y1 4OOAqD)#s(34&&y1 =OO,,QT238<== =	=, ,4 4= == =sT   D7,D>D7D:D7)D+ D7DD7D($D7+D40D77E 	c                    t        d      }t        d      }t        d      }t        d      }t        d      } G d dt        |         }||   }| j	                  |j
                  |f       | j	                  |j                  |ff       | j	                  |t           |t                  ||g   }| j	                  |j
                  |f       | j	                  |j                  |ff       | j	                  |t           |t                  |t        |g   }	| j	                  |	j
                  |f       | j	                  |	j                  t        |ff       | j	                  |	t           |t        t        g          ||t        |g   }
| j	                  |
j
                  ||f       | j	                  |
j                  |t        |ff       | j	                  |
t        t        f   |t        t        t        g          |g |t           }| j	                  |j
                  |f       | j	                  |j                  g |t        f       | j	                  |t        t        f   |t        t        t        g          |t        g|   }| j	                  |j
                  |f       | j	                  |j                  t        g|f       | j	                  |t        t        f   |t        t        t        g          ||g|   }| j	                  |j
                  ||f       | j	                  |j                  |g|f       | j	                  |t        t        t        f   |t        t        t        g          |||g   }| j	                  |j
                  |f       | j	                  |j                  ||ff       | j	                  |t           |t        t        g          ||t        |   g   }| j	                  |j
                  |f       | j	                  |j                  |t        |   ff       | j	                  |t           |t        t        t           g          |t        g |   g|   }| j	                  |j
                  |f       | j	                  |j                  t        g |   g|f       | j	                  |t        t        f   |t        t        t        f   t        t        f          ||   }| j	                  |j
                  |f       | j	                  |j                  |f       | j	                  |t        t        g   |t        t        g           G d d	t        ||f         }|||f   }| j	                  |j
                  ||f       | j	                  |j                  ||f       | j	                  |t        t        gt        gf   |t        t        gt        gf          | j	                  |g g f   |g g f          |t        t        g|f   }| j	                  |j
                  |f       | j	                  |j                  t        t        f|f       | j	                  |t        t        g   |t        t        gt        t        gf          | j	                  |g    |t        t        gg f          ||t        t        gf   }| j	                  |j
                  |f       | j	                  |j                  |t        t        ff       | j	                  |t        t        g   |t        t        gt        t        gf          | j	                  |g    |g t        t        gf          ||t        gt        |gf   }| j	                  |j
                  ||f       | j	                  |j                  |t        ft        |ff       | j	                  |t        t        f   |t        t        gt        t        gf          |g |t        t        |gf   }| j	                  |j
                  ||f       | j	                  |j                  g |t        t        |ff       | j	                  |t        t        t        f   |t        t        t        gt        t        gf          ||t        gt        g|f   }| j	                  |j
                  ||f       | j	                  |j                  |t        ft        g|f       | j	                  |t        t        t        f   |t        t        gt        t        t        gf           G d
 dt        ||f         }|||f   }| j	                  |j
                  ||f       | j	                  |j                  ||f       | j	                  |t        t        gt        f   |t        t        gt        f          |t        |g|f   }| j	                  |j
                  |f       | j	                  |j                  t        |f|f       | j	                  |t           |t        t        gt        f          |t        g||f   }| j	                  |j
                  ||f       | j	                  |j                  t        g||f       | j	                  |t        t        t        f   |t        t        t        gt        f          y )Nr   r#  r  r8  r  c                       e Zd Zy)DParamSpecTests.test_type_var_subst_for_other_type_vars.<locals>.BaseNr|   rk   r^   r\   r_	  r  "  r  r^   r_	  c                       e Zd Zy)GParamSpecTests.test_type_var_subst_for_other_type_vars.<locals>.DoublePNr|   rk   r^   r\   DoublePr  +#  r  r^   r  c                       e Zd Zy)EParamSpecTests.test_type_var_subst_for_other_type_vars.<locals>.PandTNr|   rk   r^   r\   PandTr  Q#  r  r^   r  )r   rE   r   r#   r   r  r  r   r   r,  r  r   r{  r  )rW   r   r#  r  r8  r  r_	  A1r  A3A4A5A5_2A6A7A8A9A10r  B1B2B3B4B5B6r  r&  r'  r(  s                                r\   'test_type_var_subst_for_other_type_varsz6ParamSpecTests.test_type_var_subst_for_other_type_vars"  sS	   CLT]cNt_$	71: 	 !W**QD1tg.C$s),1#Y**QD1tg.C$s),3(^**QD1Qxk2C$Sz"231c2,**QG43|o6CIc3-=(>?*B****RE2zzSzm4CIc4-=(>?SJ2J,,re4#6c4i$S$/?*@A1(r(^**QG4xBxk2CdN+T3T2B-CD1a&\**QD11vi0C$Sz"231d1g,**QD147|o6C$T#Y'7"895":##$**RE2crc
'8R'8&:;CHtE#s(OS#,E'FG2h++bU3u-c3Z$Sz*:;	gaen 	 QU^**QG4q"g.S#J./#tf9L1MNBFWRV_5c3Z^$**RE2Sz2&67T4L)7C#;t3L+MNB#b!9:Qt_%**QD1q4,&78S#J#tTl1J)KLBdD\)9!:;aXbz)***QG43x$&<=CJ#sdE]1J)KLZrZ3Z$+,**RH5zzSzD":&>?C-. #uc!2T5M!AB	D aX{r{*+**QG43x$&=>C-. #sdE5-A!AB	D	GAqDM 	 1a4[**QF3q!f-S#J,-uc3Z5E/FGC8Q;**QD1Qxm4C%c
C"89C:":q=!**RG4zbz1o6Cu,-uc35Eu5L/MNr^   c                    t        d      }t        d      }t        ||f   }t        |   }t        |   }t        |   t
        z  }| j                  |j                  ||f       | j                  |j                  ||f       | j                  |j                  ||f       t        t
        t        gt        f   }| j                  |t
        t        gt        f   t        |          | j                  |t
        t        gt        f   t        |          | j                  |t
        t        gt        f   t        |   t
        z         y )Nr   r  )
r   rE   r"   r   r  r   r   r  r   r{  )rW   r   r  r&  r  r  r  rB  s           r\   !test_paramspec_in_nested_genericsz0ParamSpecTests.test_paramspec_in_nested_genericsc#  s    CLcNad^"X"X"X^**QF3**QF3**QF3c3Z&'S#J-.Q8S#J-.Q8S#J-.Q#>r^   c                 x   t        d      }t        d      }t        |t        f   }| j                  |j                  |f       | j                  ||   j                  |f       | j                  |t
           j                  d       | j                  |t
        t        f   j                  t        f       | j                  |t        t
        |f      j                  |f       | j                  |t        t        |f      j                  t        |f       | j                  |d   j                  d       t        t        t
        |f   t        f   }| j                  |j                  |f       | j                  ||   j                  |f       | j                  |t
           j                  d       | j                  |t
        t        f   j                  t        f       | j                  |t        t
        |f      j                  |f       | j                  |t        t        |f      j                  t        |f       y )Nr  r8  rk   .)rE   r"   r   r   r  r   r   rF   )rW   r  r8  r&  r'  s        r\   test_paramspec_gets_copiedz)ParamSpecTests.test_paramspec_gets_copiedu#  s   cNt_af**QD1B..6C//4CF22QD9KR01@@2%HK2./>>BHC//4k#q&)3./**QD1B..6C//4CF22QD9KR01@@2%HK2./>>BHr^   c                 8   | j                  t        t        dz        5   G d dt              }d d d        | j                  t        t        dz        5   G d dt              }d d d        | j                  t        t        dz        5   G d d	t
              }d d d        t        d
      }| j                  t        t        dz        5   G d d|      }d d d        | j                  t        t        dz        5   G d d|j                        }d d d        | j                  t        t        dz        5   G d d|j                        }d d d        y # 1 sw Y   'xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   vxY w# 1 sw Y   y xY w)NrE   c                       e Zd Zy).ParamSpecTests.test_cannot_subclass.<locals>.CNr|   rk   r^   r\   rB  r  #  r   r^   rB  rG   c                       e Zd Zy).ParamSpecTests.test_cannot_subclass.<locals>.DNr|   rk   r^   r\   rE  r  #  r   r^   rE  rH   c                       e Zd Zy).ParamSpecTests.test_cannot_subclass.<locals>.ENr|   rk   r^   r\   r  r   #  r   r^   r  r  c                       e Zd Zy).ParamSpecTests.test_cannot_subclass.<locals>.FNr|   rk   r^   r\   r  r  #  r   r^   r  c                       e Zd Zy).ParamSpecTests.test_cannot_subclass.<locals>.GNr|   rk   r^   r\   r  r  #  r   r^   r  c                       e Zd Zy).ParamSpecTests.test_cannot_subclass.<locals>.HNr|   rk   r^   r\   r  r  #  r   r^   r  )	r   r   r  rE   rG   rH   r  r   r   )rW   rB  rE  r  r  r  r  r  s           r\   r   z#ParamSpecTests.test_cannot_subclass#  sS   ##I/LM 	%$I$	%##I/PQ 	)(M(	)##IAR/RS 	+*O*	+cN##I(;68 	A	 ##I(?:< 	"!AFF!	" ##I(+<<> 	$#AHH#	$ 	$	% 	%	) 	)	+ 	+	 		" 	"	$ 	$sG   EE E,E89F4FE E),E58FFFN)rh   ri   rj   rx  r}  r  r  r  r  r  r  r  r  r  r  r  r  r   rk   r^   r\   r  r  "  sU    1*4"5&

4l> DI2J=wOr?$I*$r^   r  c                   $    e Zd Zd Zd Zd Zd Zy)ConcatenateTestsc                 p    t        d      } G d d      }t        ||f   }| j                  |t               y )Nr  c                       e Zd Zy)-ConcatenateTests.test_basics.<locals>.MyClassNr|   rk   r^   r\   r?  r  #  r   r^   r?  )rE   rF   r   )rW   r  r?  r  s       r\   r9  zConcatenateTests.test_basics#  s/    cN
#A{+r^   c                     t        d      }t        t        t        t        |f               }dD ]/  }| j                  |      5  | j                  ||       d d d        1 y # 1 sw Y   <xY w)Nr  rV  rW  )rE   rY  rZ  rF   r   ru   r[  )rW   r  r]  rX  s       r\   r^  zConcatenateTests.test_dir#  sl    cNKQ/01	
 	8M M: 8mY78 8	88 8s   A""A+	c                    t        d      }t        d      }t        t        t        |f   t        f   }| j                  |j                  t        t        |f   t        f       | j                  |j                  |f       t        t        t        ||f   |f   }| j                  |j                  t        t        ||f   |f       | j                  |j                  ||f       t        j                  j                  t        t        |f   t        f   }| j                  |j                  t        t        |f   t        f       | j                  |j                  |f       t        j                  j                  t        t        ||f   |f   }| j                  |j                  t        t        ||f   |f       | j                  |j                  ||f       y r  )
rE   r   r"   rF   r   r   r  r  r  r  r  s          r\   r  z ConcatenateTests.test_valid_uses#  s~   cNCLk#q&)3./{36':C&@A**QD1k#q!),a/0{319'=q&AB**QF3 __%%k#q&&93&>?{36':C&@A**QD1__%%k#q!)&<a&?@{319'=q&AB**QF3r^   c                    t        d      }t        d      }t        d      }t        ||f   }| j                  |t        |f   t        t        |f          | j                  |t        t
        t        gf   t        t
        t        f       | j                  |t        g f   t        f       | j                  |t        t        t
        |f   f   t        t        t
        |f          | j                  |t        df   t        t        df          t        t        |f   }| j                  ||   t        t        |f          | j                  |t
        t        g   t        t
        t        f       | j                  |t
        t        f   t        t
        t        f       | j                  |g    t        f       | j                  |t        t
        |f      t        t        t
        |f          | j                  |d   t        t        df          y )Nr   r  r8  .)r   rE   rF   r   r   r   r{  )rW   r   r  r8  rB  s        r\   r  z&ConcatenateTests.test_var_substitution#  s   CLcNt_137[b%9:3e,-S%/@A37cV,3CG 445$S#r\2	438k#s(&;<Q2CG 45C<3U*;<3:c5(9:2';sBw/0+c3l2KL3S#X!67r^   N)rh   ri   rj   r9  r^  r  r  rk   r^   r\   r  r  #  s    ,84$8r^   r  c                   *    e Zd Zd Zd Zd Zd Zd Zy)TypeGuardTestsc                 
   t         t            dt         t           fd}| j                  t        |      dt         t           i       | j	                  t
              5  t         t        t        f    d d d        y # 1 sw Y   y xY w)Nr   c                      y rb   rk   r   s    r\   rk  z'TypeGuardTests.test_basics.<locals>.foo#  r  r^   )rI   r   r   r  r   r   r   rm  s     r\   r9  zTypeGuardTests.test_basics#  sa    #+	#+SHin#=>y) 	 c3h	  	  	 s   A99Bc                 N   | j                  t        t              d       t        t           }| j                  t        |      d       t        t           }| j                  t        |      dt
        z         t        t        t              }| j                  t        |      d       y )Nztyping.TypeGuardztyping.TypeGuard[int]ztyping.TypeGuard[%s.Employee]ztyping.TypeGuard[tuple[int]])r   r   rI   r   r{   rh   r  r
  s     r\   r   zTypeGuardTests.test_repr#  s|    i*<=s^b#:;x b#BX#MNuSz"b#ABr^   c           	      $   | j                  t        t              5   G d dt        t                    }d d d        | j                  t        t              5   G d dt        t        t
                       }d d d        | j                  t        d      5   G d dt              }d d d        | j                  t        d      5   G d	 d
t        t
                 }d d d        y # 1 sw Y   xY w# 1 sw Y   yxY w# 1 sw Y   WxY w# 1 sw Y   y xY w)Nc                       e Zd Zy).TypeGuardTests.test_cannot_subclass.<locals>.CNr|   rk   r^   r\   rB  r  #  r   r^   rB  c                       e Zd Zy).TypeGuardTests.test_cannot_subclass.<locals>.DNr|   rk   r^   r\   rE  r  #  r   r^   rE  z!Cannot subclass typing\.TypeGuardc                       e Zd Zy).TypeGuardTests.test_cannot_subclass.<locals>.ENr|   rk   r^   r\   r  r  #  r   r^   r  z(Cannot subclass typing\.TypeGuard\[int\]c                       e Zd Zy).TypeGuardTests.test_cannot_subclass.<locals>.FNr|   rk   r^   r\   r  r  #  r   r^   r  )r   r   r   r   rI   r   r
  s        r\   r   z#TypeGuardTests.test_cannot_subclass#  s    ##I/CD 	DO 	 ##I/CD 	D3( 	 ##I$HJ 	I 	 ##I$OQ 	IcN 	 		 		 		 		 	r
  c                    | j                  t              5  t                d d d        | j                  t              5   t        t                      d d d        | j                  t              5   t        t        t        t
                            d d d        y # 1 sw Y   |xY w# 1 sw Y   VxY w# 1 sw Y   y xY wrb   )r   r   rI   r   r   r   r   s    r\   rI  zTypeGuardTests.test_cannot_init#  s    y) 	K	y) 	DO	y) 	-*D8C=)*,	- 	-		 		 		- 	-r
  c                    | j                  t              5  t        dt        t                  d d d        | j                  t              5  t        t        t               d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wrK  )r   r   r   rI   r   rT   r   s    r\   rL  z!TypeGuardTests.test_no_isinstance#  se    y) 	*q)C.)	*y) 	'sI&	' 	'	* 	*	' 	'r
  Nr
  rk   r^   r\   r  r  #  s     C -'r^   r  SpecialAttrsPSpecialAttrsTc                   D    e Zd Zd Z ej
                  de      Zd Zd Z	y)SpecialAttrsTestsc           	      B   i t         j                  dt         j                  dt         j                  dt         j                  dt         j
                  dt         j                  dt         j                  dt         j                  dt         j                  d	t         j                  d
t         j                  dt         j                  dt         j                  dt         j                  dt         j                  dt         j                   dt         j"                  di t         j$                  dt         j&                  dt         j(                  dt         j*                  dt         j,                  dt         j.                  dt         j0                  dt         j2                  dt         j4                  dt         j6                  dt         j8                  dt         j:                  dt         j<                  dt         j>                  dt         j@                  d t         jB                  d!t         jD                  d"i t         jF                  d#t         jH                  d$t         jJ                  d%t         jL                  d&t         j                  tN           dt         j                  tN           dt         j                  tN        tN        f   dt         j                  tN           dt         j
                  tN           dt         j                  tN           dt         j                  g tN        f   dt         j                  d'tN        f   dt         j                  tN        tN        f   d	t         j                  tN           d
t         j                  tN           dt         j                  tN           dt         j                  tN        tN        tN        f   di t         j                  tN           dt         j                  tN        tN        f   dt         j                   tN           dt         j"                  tN        tN        f   dt         j$                  tN           dt         j&                  tN        tN        tN        f   dt         j*                  tN        tN        f   dt         j,                  tN           dt         j.                  tN           dt         j0                  tN           dt         j2                  tN           dt         j4                  tN        tN        f   dt         j6                  tN           dt         j8                  tN        tN        f   dt         j:                  tN           dt         j<                  tN           dt         j>                  tN        tN        f   di t         j@                  tN           d t         jB                  tN           d!t         jD                  tN           d"t         jH                  tN           d$t         jH                  tN        d'f   d$t         jJ                  tN           d%t         jL                  tN           d&t         jP                  d(t         jN                  d)t         jR                  d*t         jT                  d+t         jV                  d,t         jX                  d-t         jZ                  d.t         j\                  d/t         j^                  d0t         j`                  d1i t         jb                  d2t         jd                  d3t         jf                  d4t         jh                  d5t         jj                  d6t         jl                  d7t         jP                  tN        d8f   d(t         jP                  tn        d8f   d(t         jR                  tN           d*t         jT                  tN        tp        f   d+t         jV                  tN           d,t         jZ                  tN           d.t         jZ                  d9   d.t         jZ                  d:   d.t         jb                  tN           d2t         jf                  tN           d4t         jj                  tN           d)t         jj                  tn        tr        f   d6i}|ju                         D ]  \  }}| jw                  |;      5  | jy                  |jz                  |t}        |             | jy                  |j~                  |t}        |             | jy                  |j                  d<t}        |             t        t        j                  d=z         D ]?  }t        j                  ||      }t        j                  |      }| j                  ||       A 	 d d d         y # 1 sw Y   xY w)>Nr	  rW  r  rq  rd  rf  r  r"   r	  r|  r	  rh  rl  r  r	  r  r    rZ	  r  r\  	ItemsViewr  rZ  KeysViewr   r  MappingViewr!   r  r  r  r5  r	  r  rz  r   r5   
ValuesView.r@   r   r$   rF   r%   rA   r   r  r   r   r   rD   rI   r   r   rB   
Annotationr  rr  r  rc   rn   )Grc   r	  rW  r  rq  rd  rf  r  r"   r	  r|  r	  rh  rl  r  r	  r  r    rZ	  r  r\  r$  r  rZ  r%  r   r  r&  r!   r  r  r  r5  r	  r  rz  r   r5   r'  r   r@   r$   rF   r%   rA   r   r  r   r   r   rD   rI   r   r   rB   r   r  r{  r  ru   r   rh   r   rj   ri   rr   rs   rt   rv  ru  r   )rW   cls_to_checkrX   r  rq   r   r#  s          r\   r  z$SpecialAttrsTests.test_special_attrs$  s
   q
q
 &&(=q
 !!#3	q

   /q
   /q
 kq
 |q
 OOZq
 OOZq
 |q
 kq
 !!#3q
 kq
 NNIq
  !q
" LL'#q
$ KK%q
& k'q
( k)q
* OOZ+q
, k-q
. OOZ/q
0 OOZ1q
2 OOZ3q
4 KK5q
6 NNI7q
8 9q
: !!#3;q
< ""$5=q
> |?q
@ Aq
B |Cq
D OOZEq
F JJGq
H LL'Iq
J LL'Kq
L KKMq
N |Oq
R s#]Sq
T &&s+-BUq
V !!#s(+-=Wq
X   %Yq
Z   %[q
\ S!;]q
^ OOBG$j_q
` OOCH%zaq
b OOCH%zcq
d c"Leq
f S!;gq
h !!#&(8iq
j S#s]+[kq
l NN3mq
n sCx(-oq
p LLwqq
r KKS!6sq
t S!;uq
v S#s]+[wq
x S#X&yq
z OOC *{q
| OOC *}q
~ OOC *q
@ KKfAq
B NN38$iCq
D s#]Eq
F !!#s(+-=Gq
H ""3'):Iq
J c"LKq
L sCx(-Mq
N c"LOq
P OOC *Qq
R JJsOUSq
T LLwUq
V LLc"GWq
X KKfYq
Z c"L[q
^ k_q
` JJaq
b OOZcq
d eq
f LL'gq
h |iq
j NNIkq
l NNImq
n OOZoq
p LL'qq
r OOZsq
t kuq
v kwq
x NNIyq
z LL'{q
| KK}q
@ S,./Aq
B S,./Cq
D OOC *Eq
F sM12MGq
H LLwIq
J NN3Kq
L NN4 )Mq
N NN7#YOq
P OOC *Qq
R S!;Sq
T LLuUq
V LLe$gWq
f &++- 	/IC#& /  tSX>  !1!14SB  3s8D"6#:#:Q#>? /ES%0A#\\!_FMM#v./	/ /	// /s   8Cff	SpecialAttrsTests.TypeNamec                    t        j                  d      }| j                  t        |d             | j                  t        |d             | j	                  |j
                  d       t        t        j                  dz         D ]6  }| j                  t              5  t        j                  ||       d d d        8 | j	                  t        j                  j                  d       | j	                  t        j                  j                  d       | j	                  t        j                  j
                  t               t        t        j                  dz         D ][  }t        j                  t        j                  |      }t        j                   |      }| j#                  t        j                  |       ] | j	                  t$        j                  d       | j                  t        t$        d             | j	                  t$        j
                  t               t        t        j                  dz         D ]G  }t        j                  t$        |      }t        j                   |      }| j#                  t$        |       I | j	                  t&        j                  d	       | j                  t        t&        d             | j	                  t&        j
                  t               t        t        j                  dz         D ]G  }t        j                  t&        |      }t        j                   |      }| j#                  t&        |       I y # 1 sw Y   xY w)
Nzset[Any]rh   rj   rc   rn   TypeNamer*  r   r  )rc   rA   r   rl  r   ri   rr   rs   rt   r   r   rv  r"  r,  rh   rj   ru  r   r   r  )rW   rA  rq   r   r#  s        r\   test_special_attrs2z%SpecialAttrsTests.test_special_attrs2$  s}    z*Z01^451622Q67 	(E""9- (R'( (	( 	*33<<jI&&33(	
 	&&11	

 622Q67 	>E.77?A\\!_FMM+44f=	> 	//A?@118<622Q67 	1E]E2A\\!_FMM-0	1
 	//A?@118<622Q67 	1E]E2A\\!_FMM-0	1G( (s   MM	c                 
    G d dt         t                 }t        t        |t                       }dD ]/  }| j                  |      5  | j                  ||       d d d        1 | j                  d|       y # 1 sw Y   NxY w)Nc                       e Zd Zd ZdZdZy)4SpecialAttrsTests.test_genericalias_dir.<locals>.Fooc                      y rb   rk   r   s    r\   r*  z8SpecialAttrsTests.test_genericalias_dir.<locals>.Foo.bar$  r  r^   rP  rT  N)rh   ri   rj   r*  r_  	__magic__rk   r^   r\   r   r0  $  s    CIr^   r   )r*  r_  r  r  r  rW  r2  )r#   r   rY  rZ  r   ru   r[  rN  )rW   r   r]  rX  s       r\   test_genericalias_dirz'SpecialAttrsTests.test_genericalias_dir$  s    	'!* 	 CH&	
 	8M M: 8mY78 8		8 	i08 8s   	A99B	N)
rh   ri   rj   r  rc   r  r   r,  r-  r3  rk   r^   r\   r"  r"  	$  s)    |/| v~~:C@H01d1r^   r"  c                       e Zd Zd Zy)RevealTypeTestsc                     t               }t               5 }| j                  |t        |             d d d        | j	                  j                         d       y # 1 sw Y   *xY w)NzRuntime type is 'object'
)r  rJ   r   r0   r   getvalue)rW   rV  stderrs      r\   test_reveal_typez RevealTypeTests.test_reveal_type$  sQ    h 	1&MM#{3/0	1*,HI	1 	1s   AA#N)rh   ri   rj   r9  rk   r^   r\   r5  r5  $  s    Jr^   r5  c                       e Zd Zd Zd Zd Zy)DataclassTransformTestsc           
         ddddt         dt         fd} t        dd      |      } G d d	      }| j                  ||       | j                  |j                  ddddd
i d       | j                    |dd      |      |       y )NFTfrozenkw_onlyr>  r?  c                     d S )Nc                     | S rb   rk   r  s    r\   r0  zNDataclassTransformTests.test_decorator.<locals>.create_model.<locals>.<lambda>$  s    s r^   rk   r=  s     r\   create_modelz<DataclassTransformTests.test_decorator.<locals>.create_model$  s    ""r^   )kw_only_defaultorder_defaultc                       e Zd ZU eed<   y)=DataclassTransformTests.test_decorator.<locals>.CustomerModelr  Nr  rk   r^   r\   CustomerModelrF  $      Gr^   rG  rk   
eq_defaultrD  rC  frozen_defaultfield_specifiersr   )r,  r1   r   r   __dataclass_transform__)rW   rB  	decoratedrG  s       r\   test_decoratorz&DataclassTransformTests.test_decorator$  s    +0$ 	#D 	#4 	# S'ERS_`		 	 	i.--"!&#'"'$&
	
 	1IT51-@	
r^   c           
           G d d      } t        ddd      |      } G d d|d      }| j                  ||       | j                  |j                  ddddd	d
did       | j	                  ||       y )Nc                       e Zd ZdddefdZy):DataclassTransformTests.test_base_class.<locals>.ModelBaseFr>  r>  c                     y rb   rk   )rX   r>  s     r\   r  zLDataclassTransformTests.test_base_class.<locals>.ModelBase.__init_subclass__$  s    r^   N)rh   ri   rj   r,  r  rk   r^   r\   	ModelBaserR  $  s    9>D$Dr^   rU  T)rJ  rD  make_everything_awesomec                       e Zd ZU eed<   y)>DataclassTransformTests.test_base_class.<locals>.CustomerModelr  Nr  rk   r^   r\   rG  rX  $  rH  r^   rG  rS  Frk   rV  rI  )r1   r   r   rM  r]   )rW   rU  	DecoratedrG  s       r\   test_base_classz'DataclassTransformTests.test_base_class$  s    	E 	E
'$(	

 		Id 	 	i+--"!%#("'$&4d;
	
 	mY7r^   c           
      "    G d d      } G d dt               } t        dd|f      |      } G d d|	      } G d
 d|d      }| j                  ||       | j                  |j                  dddd|fi d       | j                  ||       y )Nc                       e Zd Zy)5DataclassTransformTests.test_metaclass.<locals>.FieldNr|   rk   r^   r\   Fieldr]  %  r   r^   r^  c                   *     e Zd Zdddef fdZ xZS )9DataclassTransformTests.test_metaclass.<locals>.ModelMetaTinitrb  c                (    t         |   | |||      S rb   )r   r  )rX   r  ry  	namespacerb  r   s        r\   r  zADataclassTransformTests.test_metaclass.<locals>.ModelMeta.__new__%  s     wsD%CCr^   )rh   ri   rj   r,  r  r   r   s   @r\   	ModelMetar`  %  s    =AD6:D Dr^   re  T)rD  rK  rL  c                       e Zd Zy)9DataclassTransformTests.test_metaclass.<locals>.ModelBaseNr|   rk   r^   r\   rU  rg  %  r   r^   rU  r  c                       e Zd ZU eed<   y)=DataclassTransformTests.test_metaclass.<locals>.CustomerModelr  Nr  rk   r^   r\   rG  ri  %  rH  r^   rG  Fra  rI  )r   r1   r   r   rM  r   )rW   r^  re  rY  rU  rG  s         r\   test_metaclassz&DataclassTransformTests.test_metaclass%  s    	D 	D
'tuh

	 	2)1	IE 	 	i+--"!%#("&%*H
	
 	mY7r^   N)rh   ri   rj   rO  rZ  rj  rk   r^   r\   r;  r;  $  s    
4888r^   r;  c                       e Zd ZdZd Zd Zy)AllTestszTests for __all__.c                    ddl m} | j                  d|       | j                  d|       | j                  d|       | j                  d|       | j                  d|       | j                  d|       | j                  d	|       | j                  d
|       | j                  d|       | j                  d|       | j                  d|       | j                  d|       | j                  d|       y )Nr   )r	  r	  r'  r)   r   rh  rW  ior   osr3  Textr,  r#  )rc   r	  r[  rN  r(
  s     r\   test_allzAllTests.test_all3%  s    'mQ'lA&fa j!$&*+Q/q!q!q!"fa oq)'+r^   c           	      z   t        t        j                        }t        t              j	                         D ch c]b  \  }}||v sW|j                  d      sH|dvrD|j                  d      s3|j                         |k(  s t        |dd       t        j                  k(  r|d }}}| j                  ||       y c c}}w )NrJ  >   rn  r   )rN	  _contra_cori   )rY  rc   r	  rO  r  r  r  upperr	  rh   assertSetEqual)rW   
actual_allr  r  computed_alls        r\   test_all_exported_namesz AllTests.test_all_exported_namesI%  s    (
v,,,.
!QJLL%%JJ9:GGIN<.&//A 
 
 	L*5
s   A'B7N)rh   ri   rj   rO  rq  ry  rk   r^   r\   rl  rl  0%  s    ,,6r^   rl  c                   f    e Zd Zeeeeef   eeef   ee	e
e
def   e
egef   eeedf   fZd Zd Zy)TypeIterationTests.r   c                    d}| j                   D ]  }| j                  |      5  | j                  t        |      5  t	        |       d d d        | j                  t        |      5  t        |       d d d        | j                  t        |      5  |D ]  } 	 d d d        d d d         y # 1 sw Y   exY w# 1 sw Y   GxY w# 1 sw Y   ,xY w# 1 sw Y   xY w)Nzobject is not iterabler  )_UNITERABLE_TYPESru   r   r   r	  r  )rW   expected_error_regex	test_typerJ  s       r\   test_cannot_iteratez&TypeIterationTests.test_cannot_iteratek%  s    7// 	I9- ++I7KL $O$++I7KL $O$++I7KL &  	$ $$ $  sR   CB+C%B71CCC+B40C7C <CCCC	c                 z    | j                   D ],  }| j                  |t        j                  j                         . y rb   )r}  r   r  r  r  )rW   type_to_tests     r\    test_is_not_instance_of_iterablez3TypeIterationTests.test_is_not_instance_of_iterablew%  s3     22 	ML$$\;??3K3KL	Mr^   N)rh   ri   rj   r   r   r   r   r   r   r   r"   r@   r}  r  r  rk   r^   r\   r{  r{  \%  sc    c3hc1fa!c!R%
Mr^   r{  c                 V    dd l }|j                  |j                  t                     |S rb  )doctestaddTestsDocTestSuiterc   )loaderr  patternr  s       r\   
load_testsr  |%  s!    	NN7''/0Lr^   __main__)rO  r  collections.abcr   	functoolsr   r   r   r  r
  r  r2  rs   r   r3  r  unittestr   r   r	   unittest.mockr
   r   r   rc   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r5   r6   r7   r8   r9   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   r  r~	  r  r  test.supportrJ   rK   test.typinganndatarL   rM   rN   r   r  r  rP   ry   r{   r   r   r   r   r   r   r  r  r$  rV  rp  r  r   r&  r  r  r  r  rQ  r  rr  r  r  r  rE  rK  rM  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r
  r
  r
  r
  r  r   r#  r%  r(  r+  r  r  r#  rL  rM  rN  rO  rP  rQ  rf  rS  rd  r\  rf  r   r   rq  r  r  rv  rz  r~  r  r  r  r  r  r   r   
FooGenericr  r  r  r  r  r  r  r  r  r  r  r  r  rW  r   r  rg  rm  r  r   r  r  r  rM  rZ  rJ  rZ  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r{  r"  r   r"  r5  r;  rl  r{  r  rh   rk   r^   r\   <module>r     s      # . . 	     	 
  ) )   5 5 ; ; 8 8   + + 4 4  < < 7 7 ! '    & 9  ? ? ' ' ! ( &  I I  
     6 T T @ C> 8 *		 		h 		h 		gw 	C| CL&% &%R-(, -(8%| 8 
| 
&65 65r5> 5>nD)< D)NA,S	 A,c49n9M A,RVW\]`WaRb A,H+| +B@L @HB', B'JB< B<J.$ .$bPG PGf)' )'Xd dL		?+\ 	?(0, (x=< x=v T3T]	GBFO 	mBF+ $  J   
H H  	ueX 	 	 H  
	u 	   h  X8L X8v0v< vr+&L +&Z0# 0#fG6, G6T{9\ {9| $6l 6" +0 0 0 < < <X1l X1v   YCL YC|  env'', %6//4 %   1  
    : j J 
J  	'WcN+,i 	WQZ 	

 
  #..q1  (7E 'iu  IU )5 ) J J, : ,,Y ,,9 ,. .$,.. $V//4 

35Mt  vU| vUr	aT8 aTHSg, Sgl1L 1:$% $%NK( KR< RjbGl bGJhE\ hEV-&L -&`-)| -)`#(l #(LLl L^p<\ p<f*\ *ZG$\ G$T48| 48l/'\ /'d !  1UGDD1 D1NJl JU8l U8p)6| )6XM M@ zF qj  66!9??s   0\ \<\77\<