
    z%iI                    L   d dl Z d dlZd dlZd dlmZ d dlmZmZ d dl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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.m/Z/m0Z0m1Z1m2Z2 d dlm3Z3m4Z4m5Z5 d dlm6Z6 d dlm7Z7m8Z8 d dlm9Z9 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m@Z@mAZAmBZBmCZC d dlmDZDmEZEmFZF d dlmGZGmHZH d dlmIZImJZJ d dlmKZKmLZL d dlmMZM d dlmNZNmOZOmPZPmQZQ d dlmRZR d dlSZSd dlTZTd dlZd dlUZUd dlVZVd d lWmXZXmYZYmZZZ d d!l[m\Z\ d d"l[m]Z] d#Z^d$Z_d%Z` G d& d'e      Zad( Zb G d) d*      Zc G d+ d,ec      Zd G d- d.ec      Ze G d/ d0edee      Zf G d1 d2ea      Zg G d3 d4      Zh G d5 d6ehea      Zi G d7 d8ehea      Zj G d9 d:ea      Zk G d; d<ea      Zl G d= d>ea      Zm G d? d@ea      ZndAeoep   dBeqepeoep   f   dCeoerep      fdDZs G dE dFea      Zt G dG dHea      Zu G dI dJea      Zv G dK dLea      Zw G dM dNea      Zx G dO dPea      Zy G dQ dRea      Zz G dS dT      Z{ G dU dVe{ea      Z| G dW dXe{ea      Z} G dY dZea      Z~ ed[epe      Z ed\      Z G d] d^e.eef         Z G d_ d`eeef         Z G da dbe2      Ze5 G dc ddee2             Z G de df      Z G dg dhe2      Z G di dje2      Ze5 G dk dleee2             Ze5 G dm dne2             Z G do dpe      Z G dq dr      Z G ds dte@      Ze5 G du dve2             Z G dw dxea      Z G dy dzea      Z G d{ d|ea      Z G d} d~ea      Z G d dea      Z G d dea      Z G d dea      Z G d dea      Zd dl[mZ e= G d d             Ze= G d d             Z G d dea      Z e       d        Z G d d      Z G d dea      Zd dl[mZmZmZmZmZ  ed      Z G d dejH                  e         Z G d dejL                  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 de@      Z G d de@      Z G d de@      Z G d de@      Z eCddepfg      Z G d deC      Z G d de.e#   eC      Z G d de]jl                  d      Z G d de]jp                  e#   d      Z G d dee      Z G d deCd      Z G d deC      Z G d deCd      Z G dÄ deCd      Z G dń de      Z G dǄ deC      Z G dɄ de      Z G d˄ deC      Z G d̈́ deC      Z G dτ deC      Z G dф de\jR                        Zdej                  e   fdԄZ	  e e             j                  d       e6Z G dՄ d֫      Z G dׄ dea      Z G dل de      Z G dۄ dea      Z G d݄ dea      Z G d߄ dea      Z G d de      Z G d dea      Z G d dea      Z G d dea      Z G d dea      Z G d dea      Z G d dea      Z G d dea      Z G d dea      Z G d dea      Z G d dea      Z G d dea      Z G d dea      Z ej                  d      Z ej>                  deee      Z G d dea      Z G d d ea      Z G d dea      Z G d dea      Z G d dea      Zedk(  r e        yy# e$ rZY dZ[ːQdZ[ww xY w(      N)defaultdict)	lru_cachewraps)TestCasemain
skipUnless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)import_helpercaptured_stderrcpython_only)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        D/home/uftp/.pyenv/versions/3.12.0/lib/python3.12/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                 0     	 t                fd       }|S )Nc                     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$    D
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                   0    e 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                     | 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   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r   r|   rk   r^   r\   r   z4BottomTypeTestsMixin.test_cannot_subclass.<locals>.A   r   r^   )assertRaisesRegexr   reescapestrr   CANNOT_SUBCLASS_TYPEr   rW   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       r^   c                      y rb   rk   r   s    r\   some_strz3NoReturnTests.test_get_type_hints.<locals>.some_str   r   r^   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   r   r^   c                      y rb   rk   r   s    r\   r   z0NeverTests.test_get_type_hints.<locals>.some_str   r   r^   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   AssertionErrorr   r   
assertLesslen	exceptionargsrc   _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  r   r^   N)rh   ri   rj   rB   r  rk   r^   r\   Foor    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  r   r^   N)r   rB   rh   ri   rj   r  rk   r^   r\   FooStrr	    s    (r^   r  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	  r   r^   N)r   typing.Selfr  rk   r^   r\   FooStrTypingr    s    /r^   r  r   r   )ru   r   r   r  rB   r   r,   rW   r  r  r  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 )Nr  )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\   Cr    r   r^   r  zCannot subclass typing\.Selfc                       e Zd Zyr  r|   rk   r^   r\   r  z)SelfTests.test_cannot_subclass.<locals>.C  r   r^   )r   r   r   r   rB   rW   r  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_init   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   r  r   r  r   r"  r%  r,  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_equality7  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.bar>  r   r^   N)rh   ri   rj   rC   r  rk   r^   r\   r  r3  =  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.bar@  r   r^   N)r   rC   r  rk   r^   r\   r  r6  ?  s    1r^   r  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.barB  r   r^   N)r   typing.LiteralStringr  rk   r^   r\   r  r9  A  s    8r^   r  r   r   )ru   r   r   r  rC   r   r,   r  s        r\   r  zLiteralStringTests.test_basics<  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 )Nr;  )r   r   rC   r   s    r\   r   zLiteralStringTests.test_reprI  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_subscriptL  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\   r  rA  R  r   r^   r  z%Cannot subclass typing\.LiteralStringc                       e Zd Zyr@  r|   rk   r^   r\   r  z2LiteralStringTests.test_cannot_subclass.<locals>.CV  r   r^   )r   r   r   r   rC   r  s     r\   r   z'LiteralStringTests.test_cannot_subclassP  st    ##I/CD 	D' 	 ##I8: 	M 	 		 		 	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   rC   r   r   s    r\   r"  z#LiteralStringTests.test_cannot_initY  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r$  )r   r   r   rC   rT   r   r   s    r\   r%  z%LiteralStringTests.test_no_isinstance_  sa    y) 	)q-(	)y) 	+sM*	+ 	+	) 	)	+ 	+r&  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-   r(  s       r\   r,  zLiteralStringTests.test_aliase  so    }45}%=)'*]M,JK'*],<='*],<=r^   Nr-  rk   r^   r\   r/  r/  6  s+    1
7F"+>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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_plainn  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   rI  r   rJ  floatrK  rL  rM  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   rI  r   rJ  r   rK  rL  rM  )rW   rV  rY  rZ  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   rN  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   rN  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   ri  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 )Nri  Y)	r   r   r   r   r   __args____parameters__r   
__origin__)rW   ri  rm  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 Nri  x)r   r   r   r-   rA   rj  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   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~AnyStrrZ  Tr[  z+T_cor]  r^  z	-T_contra)r   r   r   r   r   r   r   )rW   rZ  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 rf  )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r  r|   rk   r^   r\   r  z,TypeVarTests.test_cannot_subclass.<locals>.V  r   r^   )r   r   NOT_A_BASE_TYPEr   CANNOT_SUBCLASS_INSTANCE)rW   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rw  )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)Nri  rW  z%Bound must be a type\. Got \(1, 2\)\.rn   r   )r   r   r   r   r   rR  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')
rQ  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\  ra  )r_  ra  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 rf  )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   i )rE   r   r   ru   weakrefWeakValueDictionaryrr   r   )rW   rX   valsrt  s       r\   test_many_weakrefszTypeVarTests.test_many_weakrefs#  su    |W5 	C#& 224v *A!#a&kDG* 	 s   :A,,A5	N)rh   ri   rj   rO  rT  rb  rd  rg  rk  rq  ru  ry  r   r|  r   r  r  r  r  r  r  r  r  rk   r^   r\   rG  rG  m  sj    1*8:

7B56L'=BB! r^   rG  	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 rb   )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_duplicatesrt  s                r\   template_replacer  .  s&    L +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_renderst  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  r  s    + +r^   r  c                   &    e Zd Z	 d Zd Zd Zd Zy)GenericAliasSubstitutionTestsc           	         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\   r  r    r   r^   r  )r  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  r  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\   r  r    r   r^   r  )r  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  r  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\   r  r    r   r^   r  r  r   )generic[T1, bool, T2]r  generic[int, bool, str])r	  r  r
  r  r  r  r   )r   r#   r  ru   r   r   r  r   )rW   r  r  r  r  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 r  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\   r  r  4  r   r^   r  )r  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   )r  r  generic[list[int]])r  r  zgeneric[list[int], str])r  r  zgeneric[list[int], str, bool])r  r  r   )r  r  r  )r  r  r  )r  r  r  )generic[*Ts, list[T]]r  r   )r  r  r  )r  r  zgeneric[int, list[str]])r  r  zgeneric[int, str, list[bool]])generic[T1, T2, *Ts]r  r   )r  r  r   )r  r  r  )r  r  r  )r  [int, str, bool, bytes]generic[int, str, bool, bytes])generic[*Ts, T1, T2]r  r   )r  r  r   )r  r  r  )r  r  r  )r  r  r  )generic[T1, *Ts, T2]r  r   )r  r  r   )r  r  r  )r  r  r  )r  r  r  )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  r  z(generic[str, *tuple_type[int, ...], int])r  r  #generic[*tuple_type[int, ...], str])r  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])r  r  z)generic[list[int], *tuple_type[int, ...]])r  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]r  r  )r  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  r  )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  r  s                  r\   test_variadic_parametersz6GenericAliasSubstitutionTests.test_variadic_parameters/  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   r  r  r  r   rk   r^   r\   r  r    s    /d?B@dr^   r  c                   0    e 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rn  ro  rp  required_item)setdirr   r   r   ru   assertInrW   	dir_itemsr)  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)nameyearkwargsc                       y rb   rk   )r<  s    r\   fooz/UnpackTests.test_usage_with_kwargs.<locals>.foo  r   r^   ztyping.Unpack[z.Movie])r9   r   r   r   r   r   r   rh   )rW   r9  r>  s      r\   test_usage_with_kwargsz"UnpackTests.test_usage_with_kwargs  sK    'C#=>-&--c11(;<)(7;	=r^   N)	rh   ri   rj   r$  r/  r1  r4  r6  r?  rk   r^   r\   r"  r"    s     8++=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%)&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  )rQ  r   rh   r   ri   )rW   rS  r  s      r\   	test_execzTypeVarTupleTests.test_exec  sA    GLXd+bmmT*r^   c                 >    t        d      }| j                  ||       y rK  )r   r   rL  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 rK  )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 rK  )r   r   rL  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rK  )r   r   r   rL  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   rL  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 rK  )r   r   r  r   r   rL  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 rK  )r   r  r   rn  ro  r   r   )rW   r  t1t2s       r\   *test_tuple_args_and_parameters_are_correctz<TypeVarTupleTests.test_tuple_args_and_parameters_are_correct  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\   G1re    r   r^   rf  c                       e Zd Zy)3TypeVarTupleTests.test_var_substitution.<locals>.G2Nr|   rk   r^   r\   G2rh    r   r^   ri  rk   )r   r   r#   r   r   r  r   rR  r   r  r   r   r   r   rx  )rW   r  r   r  rf  ri  r   Br  D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\   rf  rs  N  r   r^   rf  c                       e Zd Zy)7TypeVarTupleTests.test_bad_var_substitution.<locals>.G2Nr|   rk   r^   r\   ri  ru  O  r   r^   ri  )
r   r   r#   r   r   r  r   r   r   r   )	rW   r  r   r  rf  ri  r   rj  r  s	            r\   r  z+TypeVarTupleTests.test_bad_var_substitutionJ  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\   rf  rx  k  r   r^   rf  c                       e Zd Zy)2TypeVarTupleTests.test_repr_is_correct.<locals>.G2Nr|   rk   r^   r\   ri  rz  l  r   r^   ri  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  rf  ri  s       r\   test_repr_is_correctz&TypeVarTupleTests.test_repr_is_correcth  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\   rj  r  |  r   r^   rj  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   rG  r   rR  r   r  r   r   )rW   r  r   rj  s       r\   #test_variadic_class_repr_is_correctz5TypeVarTupleTests.test_variadic_class_repr_is_correcty  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   rG  r   rR  r   r   r  r   )rW   r  r   rj  r  rk  rl  rm  rn  ro  rp  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\   r  r    r   r^   r  r  c                       e Zd Zyr  r|   rk   r^   r\   r  z1TypeVarTupleTests.test_cannot_subclass.<locals>.C  r   r^   c                       e Zd Zyr  r|   rk   r^   r\   r  z1TypeVarTupleTests.test_cannot_subclass.<locals>.C  r   r^   c                       e Zd Zyr  r|   rk   r^   r\   r  z1TypeVarTupleTests.test_cannot_subclass.<locals>.C  r   r^   c                       e Zd Zyr  r|   rk   r^   r\   r  z1TypeVarTupleTests.test_cannot_subclass.<locals>.C  r   r^   zCannot subclass typing\.Unpackc                       e Zd Zyr  r|   rk   r^   r\   r  z1TypeVarTupleTests.test_cannot_subclass.<locals>.C  r   r^   z#Cannot subclass typing.Unpack\[Ts\]c                       e Zd Zyr  r|   rk   r^   r\   r  z1TypeVarTupleTests.test_cannot_subclass.<locals>.C  r   r^   c                       e Zd Zyr  r|   rk   r^   r\   r  z1TypeVarTupleTests.test_cannot_subclass.<locals>.C  r   r^   )r   r   r  r   r  r   r   r   )rW   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\   rj  r    r   r^   rj  rk   )r   r   r#   r   r   rn  r   r   )rW   r   r  r   rj  r  rk  rl  rm  rn  ro  rp  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\   r  r    r   r^   r  c                       e Zd Zy)BTypeVarTupleTests.test_variadic_class_origin_is_correct.<locals>.DNr|   rk   r^   r\   rk  r    r   r^   rk  )r   r#   r   r   rp  r   r   )rW   r  r  rk  s       r\   %test_variadic_class_origin_is_correctz7TypeVarTupleTests.test_variadic_class_origin_is_correct  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>.func1'  r   r^   c                       y rb   rk   r  s    r\   func2zCTypeVarTupleTests.test_get_type_hints_on_unpack_args.<locals>.func2*  r   r^   c                       e Zd Zy)LTypeVarTupleTests.test_get_type_hints_on_unpack_args.<locals>.CustomVariadicNr|   rk   r^   r\   CustomVariadicr  -  r   r^   r  c                       y rb   rk   r  s    r\   func3zCTypeVarTupleTests.test_get_type_hints_on_unpack_args.<locals>.func3/  r   r^   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>.func15  r   r^   )localnsc                       y rb   rk   r  s    r\   r  zJTypeVarTupleTests.test_get_type_hints_on_unpack_args_string.<locals>.func29  r   r^   c                       e Zd Zy)STypeVarTupleTests.test_get_type_hints_on_unpack_args_string.<locals>.CustomVariadicNr|   rk   r^   r\   r  r  <  r   r^   r  c                       y rb   rk   r  s    r\   r  zJTypeVarTupleTests.test_get_type_hints_on_unpack_args_string.<locals>.func3>  r   r^   )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_string2  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 rK  )r   r   r  rn  r   r   r   r   rL  s     r\   test_tuple_args_are_correctz-TypeVarTupleTests.test_tuple_args_are_correctB  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   rn  r   r   r   r  r   )rW   r  r]  r  r   bcderf   ghijklmnopqrsus                           r\   test_callable_args_are_correctz0TypeVarTupleTests.test_callable_args_are_correctV  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\   r  r    r   r^   r  c                       e Zd Zyr  r|   rk   r^   r\   r  zSTypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails.<locals>.C  r   r^   c                       e Zd Zyr  r|   rk   r^   r\   r  zSTypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails.<locals>.C  r   r^   c                       e Zd Zyr  r|   rk   r^   r\   r  zSTypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails.<locals>.C  r   r^   )r   r   r   r#   r   )rW   r]  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\   r  r    r   r^   r  )r   r#   r   r   r   boolrR  rW   r  r  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 rK  )r   r  r   r   r  rR  r   r   rL  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\   r  r    r   r^   r  )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\   rm  r    r   r^   rm  c                       e Zd Zy)VTypeVarTupleTests.test_variadic_class_definition_using_concrete_types_fails.<locals>.ENr|   rk   r^   r\   rl  r    r   r^   rl  )r   r   r   r#   r   r   )rW   r  rm  rl  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\   rj  r    r   r^   rj  c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.CNr|   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>.DNr|   rk   r^   r\   rk  r    r   r^   rk  c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.ENr|   rk   r^   r\   rl  r    r   r^   rl  c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.FNr|   rk   r^   r\   rm  r    r   r^   rm  )r   r   r#   r   r   rR  r  r   )
rW   r  r  r  r   rj  r  rk  rl  rm  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  r   r^   c                       y rb   rk   r  s    r\   r  zGTypeVarTupleTests.test_variadic_args_annotations_are_correct.<locals>.g  r   r^   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>.a  r   r^   r   c                       y rb   rk   r  s    r\   r  zUTypeVarTupleTests.test_variadic_args_with_ellipsis_annotations_are_correct.<locals>.b  r   r^   )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  r   r^   r   c                       y rb   rk   r  s    r\   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.b	  r   r^   c                       y rb   rk   r  s    r\   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.c  r   r^   c                       y rb   rk   r  s    r\   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.d  r   r^   c                       y rb   rk   r  s    r\   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.e  r   r^   c                       y rb   rk   r  s    r\   rf   zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.f#  r   r^   c                       y rb   rk   r  s    r\   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.g)  r   r^   c                       y rb   rk   r  s    r\   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.h/  r   r^   )
r   r  r   r   r   r   r  rR  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_correct  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\   r  r  7  r   r^   r  c                       e Zd Zy)MTypeVarTupleTests.test_variadic_class_same_args_results_in_equalty.<locals>.DNr|   rk   r^   r\   rk  r  8  r   r^   rk  r]  r  )r   r#   r   r   r   rW   r  r  rk  r]  r  s         r\   0test_variadic_class_same_args_results_in_equaltyzBTypeVarTupleTests.test_variadic_class_same_args_results_in_equalty5  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\   r  r  ]  r   r^   r  c                       e Zd Zy)ETypeVarTupleTests.test_variadic_class_arg_ordering_matters.<locals>.DNr|   rk   r^   r\   rk  r  ^  r   r^   rk  r]  r  )r   r#   r   r   r   r   r  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\   r  r  z  r   r^   r  c                       e Zd Zy)RTypeVarTupleTests.test_variadic_class_arg_typevartuple_identity_matters.<locals>.DNr|   rk   r^   r\   rk  r  {  r   r^   rk  )r   r#   r   r   )rW   r  r]  r  r  rk  s         r\   5test_variadic_class_arg_typevartuple_identity_matterszGTypeVarTupleTests.test_variadic_class_arg_typevartuple_identity_mattersu  s    $5!5!##*r
#*AdsdGQttW-AfSkNAfSkN;r^   N)'rh   ri   rj   rG  rI  rM  rO  rQ  rS  rU  rW  rY  r[  r^  rb  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\   rA  rA    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^   rA  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   r#  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   r)  rs   r$  r%  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_Tr)  )r   r0  r   r)  r  r   r   r   r   rs   r$  r%  r   )rW   rq   tuplestra  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   r'  r.  r3  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
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   rR  r   rW   r  s     r\   r  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   rR  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   r2  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,  rn  r7  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   rR  r{   r   )rW   r  vs      r\   test_union_unionzUnionTests.test_union_union  s:    #u*!X+E#uh"678r^   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   rR  r   )rW   r  r   s      r\   r   zUnionTests.test_repr  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r&  )r*  r+  r   r   r   ru   r,  r-  s      r\   r/  zUnionTests.test_dir  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\   r  rP    r   r^   r  c                       e Zd ZyrO  r|   rk   r^   r\   r  z*UnionTests.test_cannot_subclass.<locals>.C  r   r^   z)Cannot subclass typing\.Union\[int, str\]c                       e Zd ZyrO  r|   rk   r^   r\   r  z*UnionTests.test_cannot_subclass.<locals>.C  r   r^   )r   r   r   r   r   r   r   r  s     r\   r   zUnionTests.test_cannot_subclass	  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   rR  r7  s     r\   r   z"UnionTests.test_cannot_instantiate  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,  rn  r   s    r\   test_union_generalizationz$UnionTests.test_union_generalization!  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_other'  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_optional0  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_empty5  s,    y) 	"I	 	 	   
)2c                 r    t         t        t        f   }d|fd}| j                  t	        |      d   |       y )Nrt  c                      y rb   rk   rt  s    r\   rf   z(UnionTests.test_no_eval_union.<locals>.f;  r   r^   )r   r   r   r   r+   )rW   r  rf   s      r\   test_no_eval_unionzUnionTests.test_no_eval_union9  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?  r   r^   ztyping.Union[fun, int])r   r   r   r   )rW   rf  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_patternB  s    #w,	r^   c                 X    ddl m t        t        f    fd}t        |t        f    y )Nr   )Elementc                       |  S rb   rk   )r   rk  s    r\   Elemz#UnionTests.test_etree.<locals>.ElemN  s    D>!r^   )xml.etree.ElementTreerk  r   r   )rW   rm  rk  s     @r\   
test_etreezUnionTests.test_etreeG  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   rj  rk   r^   r\   Intsrr  _      AAr^   rt  )r   r   r   rn  enumIntEnumr   rj  )rW   rv  rt  s      r\   test_union_of_literalsz!UnionTests.test_union_of_literalsS  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   r  r9  r?  rA  rC  rE  rG  rJ  r   r/  r   r   rV  rY  r[  r^  rc  rg  ri  ro  rx  rk   r^   r\   r5  r5    so    &-	%(!
#+9
:28	WD
1
J


Gr^   r5  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}  y  r   r^   r~  )r   r   rT   r   r   r   r  r]   )rW   r~  s     r\   r  zTupleTests.test_basicss  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   rR  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   r  r   r  r  r   r   rk   r^   r\   rz  rz  q  s!    )9,-
L'r^   rz  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"   r  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.r'  r(  )r"   r*  r+  r   ru   r,  )rW   r"   r.  r)  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  | j                  ||g d f          d d d        | j                  t              5  | j                  ||g t        f          d d d        | j                  t              5  | j                  d |g d f          d d d        | j                  t              5  | j                  d |g t        f          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                       y rb   rk   rk   r^   r\   rf   z>BaseCallableTests.test_callable_instance_type_error.<locals>.f  r  r^   )r"   r   r   r   r   r   r  s      r\   !test_callable_instance_type_errorz3BaseCallableTests.test_callable_instance_type_error  s   ==	y) 	9!!!Xb$h%78	9y) 	8!!!Xb#g%67	8y) 	?$$T8BH+=>	?y) 	>$$T8BG+<=	> 	>	9 	9	8 	8	? 	?	> 	>s/   C-C9DD-C69DD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   rR  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\   r>  z:BaseCallableTests.test_callable_with_ellipsis.<locals>.foo  r  r^   )r"   r   r   r+   globalslocals)rW   r"   r>  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_generic  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_ror  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   rR  collectionsabcr   r  GenericAliasr   rp  r   rn  ro  rW   r"   r  s      r\   
test_basiczBaseCallableTests.test_basic  s    ==#sU*+{///!!%););<e&&(@(@A#sE):;--r2r^   c                     | j                   }|t        t        gt        f   }| j	                   t        j                  |             |       y rb   )r"   r   r   rR  r   r  refr  s      r\   test_weakrefzBaseCallableTests.test_weakref  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   rR  rF   rr   rs   rt   ru   r%  r$  r   rp  rn  ro  )rW   r"   samplesr  rq   r  loadeds          r\   test_picklezBaseCallableTests.test_pickle  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   rR  r   r   r  rc   r   r  )rW   r"   r  C1C2C3C4C5s           r\   r  z'BaseCallableTests.test_var_substitution%  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__J      r^   Nrh   ri   rj   r  rk   r^   r\   r  r  I  s    r^   r  )r"   r   r   r   	__class__r   __orig_class__)rW   r"   r  r   s       r\   test_type_erasurez#BaseCallableTests.test_type_erasureG  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  r  r  r  s          r\   test_paramspecz BaseCallableTests.test_paramspecP  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  r  z![typing.Concatenate[int, ~P], ~T].z"[typing.Concatenate[int, ~P], int])
r"   ri   r   rE   rF   r   r   r   r   rR  )rW   r"   r  r   r  r  r  s          r\   test_concatenatez"BaseCallableTests.test_concatenater  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  r  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   ro  r   rn  r   r  rx  r  rR  )rW   r"   r  r  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   rR  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  r  r  r  r  r   rk   r^   r\   r  r    ss    2
)8

1>
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   rn  hash)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"   r  rk   r^   r\   r  r    s    H?r^   r  c                   8    e Zd Zej                  j
                  Zy)CollectionsCallableTestsN)rh   ri   rj   r  r  r"   rk   r^   r\   r  r    s    ''Hr^   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)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      )rt  yzT)rn   2Fr        )s   foor  )r   r   s    r\   r  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  r    s    Ar^   r  )rv  Enumr   r   r   rn  )rW   rv  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   r  r  r>  r  )r   r   r   r   s    r\   3test_illegal_parameters_do_not_raise_runtime_errorsz@LiteralTests.test_illegal_parameters_do_not_raise_runtime_errors  s'     	 !$%
r^   c                 D    t         t        d       t         t        d       y )Nr  )r>  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   Tr>  ztyping.Literal[1, True, 'foo']ztyping.Literal[int]ztyping.Literalztyping.Literal[None]rn   r   r  r  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)Nr  r'  r(  )r*  r+  r   ru   r,  r-  s      r\   r/  zLiteralTests.test_dir  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r$  )r   r   r   r   r   s    r\   r"  zLiteralTests.test_cannot_init	  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r$  )r   r   r   r   r   rT   r   s    r\    test_no_isinstance_or_issubclassz-LiteralTests.test_no_isinstance_or_issubclass	  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  r  	  r   r^   r  rn   c                       e Zd Zy)-LiteralTests.test_no_subclassing.<locals>.BarNr|   rk   r^   r\   Barr
  	  r   r^   r  r   r   r   rW   r  r  s      r\   test_no_subclassingz LiteralTests.test_no_subclassing	  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r$  r  r   s    r\   test_no_multiple_subscriptsz(LiteralTests.test_no_multiple_subscripts	  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   r  r  )r   r   r   r   s    r\   
test_equalzLiteralTests.test_equal 	  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  r  r  r  )r   r  r   r   s    r\   	test_hashzLiteralTests.test_hash+	  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 )Nr  r  rn   r   )r  r  )rn   r   r  r  )r   r   rn  r   s    r\   	test_argszLiteralTests.test_args0	  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   r  r  r  )r   r   rn  )rW   l1l2l3r  s        r\   test_flattenzLiteralTests.test_flatten7	  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   Nrs  rk   r^   r\   rt  r   A	  ru  r^   rt  rn   r   )rv  rw  r   r   rj  r   rn  )rW   rv  rt  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   r  r  r  r  r   r/  r"  r  r  r  r  r  r  r  r!  rk   r^   r\   r  r    sP    	 :-O8(%	@L
=4=r^   r  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__T	      r^   r   c                      y rb   rk   rW   r&  r   s      r\   __setitem__zSimpleMapping.__setitem__W	  r*  r^   Ndefaultc                      y rb   rk   rW   r&  r.  s      r\   getzSimpleMapping.getZ	  r*  r^   rb   )rh   ri   rj   r"  r#  r)  r-  r1  rk   r^   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\   __init__zMySimpleMapping.__init__`	  s	    
r^   r&  c                      | j                   |   S rb   r5  r(  s     r\   r)  zMySimpleMapping.__getitem__c	  s    zz#r^   c                 "    || j                   |<   y rb   r5  r,  s      r\   r-  zMySimpleMapping.__setitem__f	  s    

3r^   Nc                 D    	 | j                   |   S # t        $ r |cY S w xY wrb   )r6  KeyErrorr0  s      r\   r1  zMySimpleMapping.geti	  s)    	::c?" 	N	s    rb   )rh   ri   rj   r7  r   r)  r-  r1  rk   r^   r\   r3  r3  ^	  s+    s  s  s r^   r3  c                   "    e Zd ZU eed<   eed<   y)
Coordinatert  r  Nrh   ri   rj   r   r   rk   r^   r\   r=  r=  p	      
F
Fr^   r=  c                       e Zd ZU eed<   y)PointlabelNrh   ri   rj   r   r   rk   r^   r\   rA  rA  t	  s    Jr^   rA  c                   ,    e Zd ZU eed<   eed<   eed<   y)MyPointrt  r  rB  Nrh   ri   rj   r   r   r   rk   r^   r\   rE  rE  x	  s    
F
FJr^   rE  c                       e Zd ZU eed<   y)XAxisrt  Nr>  rk   r^   r\   rH  rH  }	      
Fr^   rH  c                       e Zd ZU eed<   y)YAxisr  Nr>  rk   r^   r\   rK  rK  	  rI  r^   rK  c                       e Zd Zy)PositionNr|   rk   r^   r\   rM  rM  	  s    r^   rM  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   rS  rk   r^   r\   rO  rO  	  s    
I  r^   rO  c                       e Zd Zy)ConcreteNr|   rk   r^   r\   rU  rU  	  r}   r^   rU  c                   ,    e Zd ZU dZeed<   dedefdZy)Otherrn   rP  r   r   c                     |dk(  ryy)Nthisrn   r   rk   rR  s     r\   rS  z
Other.meth	  s    &=r^   N)rh   ri   rj   rP  r   r   r   rS  rk   r^   r\   rW  rW  	  s    D#M  r^   rW  c                   "    e Zd ZU eed<   eed<   y)NTrt  r  Nr>  rk   r^   r\   r[  r[  	  r?  r^   r[  c                   ,    e Zd ZU ej                  ed<   y)HasCallProtocolr  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 ZIyH)I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\   rS  z1ProtocolTests.test_basic_protocol.<locals>.P.meth	      r^   Nrh   ri   rj   rS  rk   r^   r\   r  rb  	      r^   r  c                       e Zd Zy),ProtocolTests.test_basic_protocol.<locals>.CNr|   rk   r^   r\   r  rh  	  r   r^   r  c                       e Zd Zd Zy),ProtocolTests.test_basic_protocol.<locals>.Dc                      y rb   rk   r   s    r\   rS  z1ProtocolTests.test_basic_protocol.<locals>.D.meth	  rd  r^   Nre  rk   r^   r\   rk  rj  	      r^   rk  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  r  rk  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>.FooN)rh   ri   rj   __type_params__.type_paramss   r\   r  rr  	  s    r^   r  rk   r   .generic_baseru  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\   rS  z>ProtocolTests.test_runtime_checkable_generic.<locals>.Foo.meth	  r   r^   Nrh   ri   rj   rs  rS  ru  r   s   r\   r  r}  	  s    $a$r^   r  r'   rw  ru  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\   rS  z?ProtocolTests.test_runtime_checkable_generic.<locals>.Impl.meth	  r   r^   Nrh   ri   rj   r   rS  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>.HasXrt  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>.Barrt  c                     || _         y rb   rb  rW   rt  s     r\   r7  zQProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.Bar.__init__	  	    r^   N)rh   ri   rj   rs  r   r7  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\   r7  zVProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.Capybara.__init__	  r  r^   N)rh   ri   rj   rs  r   r   r7  rt  s   r\   Capybarar  	  s     Fr^   r  rk   rv  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  	      r^   r  c                       e Zd Zy)BProtocolTests.test_everything_implements_empty_protocol.<locals>.CNr|   rk   r^   r\   r  r  	  r  r^   r  c                       y rb   rk   rk   r^   r\   rf   zBProtocolTests.test_everything_implements_empty_protocol.<locals>.f	  r  r^   rn   rk   )
r*   r'   r;  r   r  r  r  r]   rc   r   )rW   r  r  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\   r  r  	  r   r^   r  c                       e Zd Zy):ProtocolTests.test_no_inheritance_from_nominal.<locals>.BPNr|   rk   r^   r\   BPr  	  r   r^   r  c                       e Zd Zy9ProtocolTests.test_no_inheritance_from_nominal.<locals>.PNr|   rk   r^   r\   r  r  	  r   r^   r  c                       e Zd Zyr  r|   rk   r^   r\   r  z9ProtocolTests.test_no_inheritance_from_nominal.<locals>.P 
  r   r^   c                       e Zd Zyr  r|   rk   r^   r\   r  z9ProtocolTests.test_no_inheritance_from_nominal.<locals>.P
  r   r^   c                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.DNr|   rk   r^   r\   rk  r  
  r   r^   rk  c                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.ENr|   rk   r^   r\   rl  r  
  r   r^   rl  )r'   r   r   r   )rW   r  r  r  rk  rl  s         r\    test_no_inheritance_from_nominalz.ProtocolTests.test_no_inheritance_from_nominal	  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\   r  r  
  r   r^   r  r   r   c                       e Zd Zy)/ProtocolTests.test_no_instantiation.<locals>.PGNr|   rk   r^   r\   PGr  
  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   )rW   r  r  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>.Prt  r   Nc                     || _         y rb   rb  r  s     r\   r7  zUProtocolTests.test_protocol_defining_init_does_not_get_overridden.<locals>.P.__init__0
  r  r^   rh   ri   rj   r   r   r7  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\   r  r  2
  r   r^   r  rn   )r'   r7  r   rt  rW   r  r  r  s       r\   3test_protocol_defining_init_does_not_get_overriddenzAProtocolTests.test_protocol_defining_init_does_not_get_overridden*
  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>.Prt  r   Nc                     || _         y rb   rb  r  s     r\   r7  zSProtocolTests.test_concrete_class_inheriting_init_from_protocol.<locals>.P.__init__;
  r  r^   r  rk   r^   r\   r  r  9
  r  r^   r  c                       e Zd Zy)JProtocolTests.test_concrete_class_inheriting_init_from_protocol.<locals>.CNr|   rk   r^   r\   r  r  >
  r   r^   r  rn   )r'   r   r   rt  r  s       r\   1test_concrete_class_inheriting_init_from_protocolz?ProtocolTests.test_concrete_class_inheriting_init_from_protocol8
  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.amethG
  s    ))r^   N)rh   ri   rj   r  abstractmethodr   r  rk   r^   r\   r  r  E
  s!    *s *  *r^   r  c                       e Zd Zy)9ProtocolTests.test_cannot_instantiate_abstract.<locals>.BNr|   rk   r^   r\   rj  r  K
  r  r^   rj  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.amethO
      r^   N)rh   ri   rj   r   r  rk   r^   r\   r  r  N
  s    s r^   r  )r*   r'   r   r   r   )rW   r  rj  r  s       r\    test_cannot_instantiate_abstractz.ProtocolTests.test_cannot_instantiate_abstractD
  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.meth1X
  rd  r^   Nrh   ri   rj   r  rk   r^   r\   P1r  W
  rl  r^   r  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]
  rd  r^   Nrh   ri   rj   r  rk   r^   r\   r  r  [
  rf  r^   r  c                       e Zd Zd Zd Zy)4ProtocolTests.test_subprotocols_extending.<locals>.Cc                      y rb   rk   r   s    r\   r  z:ProtocolTests.test_subprotocols_extending.<locals>.C.meth1a
  rd  r^   c                      y rb   rk   r   s    r\   r  z:ProtocolTests.test_subprotocols_extending.<locals>.C.meth2d
  rd  r^   Nrh   ri   rj   r  r  rk   r^   r\   r  r  `
      r^   r  c                       e Zd Zd Zy)5ProtocolTests.test_subprotocols_extending.<locals>.C1c                      y rb   rk   r   s    r\   r  z;ProtocolTests.test_subprotocols_extending.<locals>.C1.meth1h
  rd  r^   Nr  rk   r^   r\   r  r  g
  rl  r^   r  c                       e Zd Zd Zy)5ProtocolTests.test_subprotocols_extending.<locals>.C2c                      y rb   rk   r   s    r\   r  z;ProtocolTests.test_subprotocols_extending.<locals>.C2.meth2l
  rd  r^   Nr  rk   r^   r\   r  r   k
  rl  r^   r  r'   r*   r   r`   r   r]   )rW   r  r  r  r  r  s         r\   test_subprotocols_extendingz)ProtocolTests.test_subprotocols_extendingV
  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\   r  z9ProtocolTests.test_subprotocols_merging.<locals>.P1.meth1x
  rd  r^   Nr  rk   r^   r\   r  r  w
  rl  r^   r  c                       e Zd Zd Zy)3ProtocolTests.test_subprotocols_merging.<locals>.P2c                      y rb   rk   r   s    r\   r  z9ProtocolTests.test_subprotocols_merging.<locals>.P2.meth2|
  rd  r^   Nr  rk   r^   r\   r  r	  {
  rl  r^   r  c                       e Zd Zy)2ProtocolTests.test_subprotocols_merging.<locals>.PNr|   rk   r^   r\   r  r  
  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\   r  z8ProtocolTests.test_subprotocols_merging.<locals>.C.meth1
  rd  r^   c                      y rb   rk   r   s    r\   r  z8ProtocolTests.test_subprotocols_merging.<locals>.C.meth2
  rd  r^   Nr  rk   r^   r\   r  r  
  r  r^   r  c                       e Zd Zd Zy)3ProtocolTests.test_subprotocols_merging.<locals>.C1c                      y rb   rk   r   s    r\   r  z9ProtocolTests.test_subprotocols_merging.<locals>.C1.meth1
  rd  r^   Nr  rk   r^   r\   r  r  
  rl  r^   r  c                       e Zd Zd Zy)3ProtocolTests.test_subprotocols_merging.<locals>.C2c                      y rb   rk   r   s    r\   r  z9ProtocolTests.test_subprotocols_merging.<locals>.C2.meth2
  rd  r^   Nr  rk   r^   r\   r  r  
  rl  r^   r  r  )rW   r  r  r  r  r  r  s          r\   test_subprotocols_mergingz'ProtocolTests.test_subprotocols_mergingv
  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\   rt  z4ProtocolTests.test_protocols_issubclass.<locals>.P.x
  r   r^   Nrh   ri   rj   rt  rk   r^   r\   r  r  
      r^   r  c                       e Zd Zd Zy)3ProtocolTests.test_protocols_issubclass.<locals>.PGc                      y rb   rk   r   s    r\   rt  z5ProtocolTests.test_protocols_issubclass.<locals>.PG.x
  r   r^   Nr  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\   rt  z7ProtocolTests.test_protocols_issubclass.<locals>.BadP.x
  r   r^   Nr  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\   rt  z8ProtocolTests.test_protocols_issubclass.<locals>.BadPG.x
  r   r^   Nr  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\   rt  z4ProtocolTests.test_protocols_issubclass.<locals>.C.x
  r   r^   Nr  rk   r^   r\   r  r+  
  r%  r^   r  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)  r  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\   rS  z_ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.CallableMembersProto.meth
  r   r^   Nre  rk   r^   r\   CallableMembersProtor6  
      r^   r8  c                       e Zd Zd Zy)TProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.IdenticalProtoc                      y rb   rk   r   s    r\   rS  zYProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.IdenticalProto.meth
  r   r^   Nre  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\   rS  zXProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.SupersetProto.meth
  r   r^   c                      y rb   rk   r   s    r\   r  zYProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.SupersetProto.meth2
  r   r^   N)rh   ri   rj   rS  r  rk   r^   r\   SupersetProtor?  
  s     r^   rB  c                   "    e Zd ZU eg df   ed<   y)]ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NonCallableMembersProtoNrS  rh   ri   rj   r"   r   rk   r^   r\   NonCallableMembersProtorD  
      2t8$$r^   rF  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>.NonCallableMembersSupersetProtoNrS  r  )rh   ri   rj   r"   r   r   r   r  rk   r^   r\   NonCallableMembersSupersetProtorI  
  s%    2t8$$S#J,--r^   rJ  c                   (    e Zd ZU eg df   ed<   d Zy)XProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.MixedMembersProto1NrS  c                      y rb   rk   r   s    r\   r  z^ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.MixedMembersProto1.meth2
  r   r^   )rh   ri   rj   r"   r   r  rk   r^   r\   MixedMembersProto1rL  
      2t8$$ r^   rN  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\   rS  z]ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.MixedMembersProto2.meth
  r   r^   r  N)	rh   ri   rj   rS  r"   r   r   r  r   rk   r^   r\   MixedMembersProto2rQ  
  s    S#J,--r^   rS  rp   c                       e Zd Zy)SProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.EmptyProtocolNr|   rk   r^   r\   EmptyProtocolrU  
  r   r^   rV  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.wut
  r   r^   N)rh   ri   rj   rZ  rk   r^   r\   UnrelatedProtocolrX  
  s    r^   r[  c                   "    e Zd ZU eg df   ed<   y)^ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.AnnotatedButNotAProtocolNrS  rE  rk   r^   r\   AnnotatedButNotAProtocolr]  	  rG  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\   rS  zlProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass.meth  r   r^   Nre  rk   r^   r\   !NotAProtocolButAnImplicitSubclassr`         r^   rb  c                   (    e Zd ZU eg df   ed<   d Zy)hProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass2NrS  c                      y rb   rk   r   s    r\   rS  zmProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass2.meth  r   r^   )rh   ri   rj   r"   r   rS  rk   r^   r\   "NotAProtocolButAnImplicitSubclass2re    rO  r^   rg  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>.NotAProtocolButAnImplicitSubclass3NrS  r  c                      y rb   rk   r   s    r\   rS  zmProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass3.meth  r   r^   c                      y)NTrk   rW   rt  r  s      r\   rS  zmProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass3.meth  s    r^   )	rh   ri   rj   r"   r   r   r   r  rS  rk   r^   r\   "NotAProtocolButAnImplicitSubclass3ri    s+    2t8$$S#J,-- -r^   rm  )r*   r'   ru   rh   r]   r`   )rW   r8  r=  rB  rF  rJ  rN  rS  rq   rV  r[  r^  rb  rg  rm  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  rq  &  r   r^   r  )
addCleanupgcenabledisabler   r   r  r  rX  r'   r   rx  s     r\   (test_isinstance_checks_not_at_whim_of_gcz6ProtocolTests.test_isinstance_checks_not_at_whim_of_gc  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\   rt  zLProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.C.x-  r   r^   Nr  rk   r^   r\   r  ry  ,  s    r^   r  r>  r/  rn   r   c                       e Zd Zy)VProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.EmptyProtocolNr|   rk   r^   r\   rV  r|  C  s    '+r^   rV  c                       e Zd ZdedefdZy)[ProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.SupportsStartsWithrt  r   c                      y rb   rk   r  s     r\   
startswithzfProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.SupportsStartsWith.startswithH  r   r^   Nrh   ri   rj   r   r  r  rk   r^   r\   SupportsStartsWithr~  F  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\   rt  zTProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.SupportsX.xL  r   r^   Nr  rk   r^   r\   	SupportsXr  J  r  r^   r  rp   )r`   r;  r'   r   r   r   r   rT   r   r*   ru   rh   r]   r   )rW   r  r2  r   rV  r  r  rq   s           r\   1test_issubclass_and_isinstance_on_Protocol_itselfz?ProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself+  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   Nr  rk   r^   r\   r  r  g      Ar^   r  c                       e Zd ZdZy)FProtocolTests.test_protocols_issubclass_non_callable.<locals>.PNonCallrn   Nr  rk   r^   r\   PNonCallr  j      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\   rk  r  ~  r   r^   rk  )
r*   r'   r   r   rT   r   registerr`   r   r]   )rW   r  r  non_callable_members_illegalrk  s        r\   &test_protocols_issubclass_non_callablez4ProtocolTests.test_protocols_issubclass_non_callablef  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>.Spamrt  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   rb  r   s    r\   r7  z[ProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance.<locals>.Eggs.__init__  s	    r^   r   Nrh   ri   rj   r7  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>.Spamrt  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>.Spamrt  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        |      )Nrt  r   AttributeErrorrW   rP  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>.Spamrt  Nrh   ri   rj   rs  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>.Eggsrt  r   Nc                     || _         y rb   rb  r  s     r\   r7  zbProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695.<locals>.Eggs.__init__  r  r^   )rh   ri   rj   rs  r7  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   rb  s    r\   rS  z7ProtocolTests.test_protocols_isinstance.<locals>.P.meth  r   r^   Nre  rk   r^   r\   r  r    r  r^   r  c                       e Zd Zd Zy)3ProtocolTests.test_protocols_isinstance.<locals>.PGc                      y rb   rk   rb  s    r\   rS  z8ProtocolTests.test_protocols_isinstance.<locals>.PG.meth  r   r^   Nre  rk   r^   r\   r  r    r  r^   r  c                   $    e Zd Zej                  Zy);ProtocolTests.test_protocols_isinstance.<locals>.WeirdProtoN)rh   ri   rj   r   	maketransrS  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   r^   Nre  rk   r^   r\   WeirdProto2r    s    /Dr^   r  c                       e Zd Zd Zy)?ProtocolTests.test_protocols_isinstance.<locals>.CustomCallablec                      y rb   rk   rW   r   r<  s      r\   r  zHProtocolTests.test_protocols_isinstance.<locals>.CustomCallable.__call__  rd  r^   Nr  rk   r^   r\   CustomCallabler    rl  r^   r  c                       e Zd Z W         Zy)=ProtocolTests.test_protocols_isinstance.<locals>.WeirderProtoNre  )r  s   r\   WeirderProtor    s    !#Dr^   r  c                       e Zd Zd Zy)5ProtocolTests.test_protocols_isinstance.<locals>.BadPc                      y rb   rk   rb  s    r\   rS  z:ProtocolTests.test_protocols_isinstance.<locals>.BadP.meth  r   r^   Nre  rk   r^   r\   r$  r    r%  r^   r$  c                       e Zd Zd Zy)6ProtocolTests.test_protocols_isinstance.<locals>.BadPGc                      y rb   rk   rb  s    r\   rS  z;ProtocolTests.test_protocols_isinstance.<locals>.BadPG.meth   r   r^   Nre  rk   r^   r\   r)  r    r%  r^   r)  c                       e Zd Zd Zy)2ProtocolTests.test_protocols_isinstance.<locals>.Cc                      y rb   rk   rb  s    r\   rS  z7ProtocolTests.test_protocols_isinstance.<locals>.C.meth  r   r^   Nre  rk   r^   r\   r  r    r%  r^   r  c                       e Zd Zd Zy)3ProtocolTests.test_protocols_isinstance.<locals>.C2c                     d | _         y )Nc                       y rb   rk   rk   r^   r\   r  zNProtocolTests.test_protocols_isinstance.<locals>.C2.__init__.<locals>.<lambda>  r   r^   )rS  r   s    r\   r7  z<ProtocolTests.test_protocols_isinstance.<locals>.C2.__init__  s	    (	r^   Nr  rk   r^   r\   r  r    s    )r^   r  )klassrq   r-  r.  )	r   r*   r'   ru   rh   r   r   r   r   )rW   r   r  r  r  r  r  r$  r)  r  r  r  rq   r0  only_runtime_checkable_msgr  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\   rP  zRProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.C.attr!      r^   Nrh   ri   rj   propertyrP  rk   r^   r\   r  r     s     r^   r  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__&  r  r^   rb   rh   ri   rj   r  rk   r^   r\   CustomDescriptorr  %  s    r^   r  c                       e Zd Z W         Zy)MProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.DNrh   ri   rj   rP  r  s   r\   rk  r  )      #%Dr^   rk  c                       e Zd Zy)MProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.ENr|   rk   r^   r\   rl  r  .  r   r^   rl  c                       e Zd Zy)MProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.FNr|   rk   r^   r\   rm  r  /  r   r^   rm  c                       e Zd Zy)QProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.EmptyNr|   rk   r^   r\   r  r  1  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\   rP  zRProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.P.attr7      r^   Nr  rk   r^   r\   r  r  5       r^   r  c                       e Zd ZU eed<   y)NProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.P1rP  Nr>  rk   r^   r\   r  r
  :      Ir^   r  c                       e Zd Zed        Zy)NProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.PGc                      y rb   rk   r   s    r\   rP  zSProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.PG.attr@  r  r^   Nr  rk   r^   r\   r  r  >  r  r^   r  c                       e Zd ZU W  ed<   y)OProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.PG1rP  Nrh   ri   rj   r   r   s   r\   PG1r  C      Gr^   r  c                       e Zd Zd Zy)SProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.MethodPc                      y rb   rk   r   s    r\   rP  zXProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.MethodP.attrI  r   r^   Nr  rk   r^   r\   MethodPr  G  r9  r^   r  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\   rP  zYProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.MethodPG.attrM  r   r^   Nr  r  s   r\   MethodPGr  K      $a$r^   r  r  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\   rP  zUProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadP.attr[  r  r^   Nr  rk   r^   r\   r$  r!  Z       r^   r$  c                       e Zd ZU eed<   y)QProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadP1rP  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\   rP  zVProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadPG.attrb  r  r^   Nr  rk   r^   r\   r)  r)  a  r#  r^   r)  c                       e Zd ZU W  ed<   y)RProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadPG1rP  Nr  r  s   r\   BadPG1r,  e  s    Gr^   r-  )r  r  )
r   r*   r'   ru   rh   r   r   r   r   r   )rW   r  rk  rl  rm  r  r  r  r  r  r  r  r  r  r$  r&  r)  r-  casesr  r  r   s                       @@r\   4test_protocols_isinstance_properties_and_descriptorszBProtocolTests.test_protocols_isinstance_properties_and_descriptors  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>.HasXrt  Nr>  rk   r^   r\   r  r2  t  r  r^   r  c                       e Zd ZdZd Zy)XProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.CustomDirWithX
   c                     g S rb   rk   r   s    r\   __dir__z`ProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.CustomDirWithX.__dir__z      	r^   N)rh   ri   rj   rt  r7  rk   r^   r\   CustomDirWithXr4  x  s    Ar^   r9  c                       e Zd Zd Zy)[ProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.CustomDirWithoutXc                     dgS Nrt  rk   r   s    r\   r7  zcProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.CustomDirWithoutX.__dir__~  s	    ur^   N)rh   ri   rj   r7  rk   r^   r\   CustomDirWithoutXr;  }      r^   r>  r  )rW   r  r9  r>  s       r\   2test_protocols_isinstance_not_fooled_by_custom_dirz@ProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dirs  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\   rP  zZProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.C.attr  s    $T**r^   Nr  rk   r^   r\   r  rC    s    + +r^   r  c                       e Zd ZddZy)dProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.CustomDescriptorNc                     t        d      )NNORuntimeErrorr  s      r\   r  zlProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.CustomDescriptor.__get__  s    "4((r^   rb   r  rk   r^   r\   r  rG    s    )r^   r  c                       e Zd Z W         Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.DNr  r  s   r\   rk  rM    r  r^   rk  c                       e Zd Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.ENr|   rk   r^   r\   rl  rO    r   r^   rl  c                       e Zd Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.FNr|   rk   r^   r\   rm  rQ    r   r^   rm  c                       e Zd Zd Zy)eProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.WhyWouldYouDoThisc                     t        d      )NrZ  rJ  )rW   r:  s     r\   r  zqProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.WhyWouldYouDoThis.__getattr__  s    "5))r^   Nr  rk   r^   r\   WhyWouldYouDoThisrS    s    *r^   rU  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\   rP  zZProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.P.attr  r  r^   Nr  rk   r^   r\   r  rW    r  r^   r  c                       e Zd ZU eed<   y)VProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.P1rP  Nr>  rk   r^   r\   r  rZ    r  r^   r  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\   rP  z[ProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.PG.attr  r  r^   Nr  rk   r^   r\   r  r\    r  r^   r  c                       e Zd ZU W  ed<   y)WProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.PG1rP  Nr  r  s   r\   r  r_    r  r^   r  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\   rP  z`ProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.MethodP.attr  r   r^   Nr  rk   r^   r\   r  ra    r9  r^   r  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\   rP  zaProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.MethodPG.attr  r   r^   Nr  r  s   r\   r  rd    r  r^   r  r  )r   r*   r'   ru   rh   r   r   )rW   r  rk  rl  rm  rU  r  r  r  r  r  r  r  r  r  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>.HasXrt  Nr>  rk   r^   r\   r  ri    r  r^   r  c                       e Zd ZdZy)MProtocolTests.test_protocols_isinstance___slots__.<locals>.HasNothingButSlotsrb  Nrh   ri   rj   	__slots__rk   r^   r\   HasNothingButSlotsrk    s    Ir^   rn  r*   r'   r   )rW   r  rn  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   rt  r  rB  )rW   rt  r  rB  s       r\   r7  zEProtocolTests.test_protocols_isinstance_py36.<locals>.APoint.__init__  s    "
r^   Nr  rk   r^   r\   APointrs    s    #r^   rv  c                       e Zd ZdZd Zy)<ProtocolTests.test_protocols_isinstance_py36.<locals>.BPointrj  c                      || _         || _        y rb   rt  r  rl  s      r\   r7  zEProtocolTests.test_protocols_isinstance_py36.<locals>.BPoint.__init__  s    r^   N)rh   ri   rj   rB  r7  rk   r^   r\   BPointrx    s    Er^   r{  c                       e Zd Zd Zd Zy)7ProtocolTests.test_protocols_isinstance_py36.<locals>.Cc                     || _         y rb   rP  r  s     r\   r7  z@ProtocolTests.test_protocols_isinstance_py36.<locals>.C.__init__  	     	r^   c                      yr3  rk   rR  s     r\   rS  z<ProtocolTests.test_protocols_isinstance_py36.<locals>.C.meth      r^   N)rh   ri   rj   r7  rS  rk   r^   r\   r  r}    s    !r^   r  c                       e Zd Zy)9ProtocolTests.test_protocols_isinstance_py36.<locals>.BadNr|   rk   r^   r\   Badr    r   r^   r  rn   r   r   r   )	r   rA  r   rE  rM  rW  rO  rU  r[  )rW   rv  r{  r  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   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd ZdZy)8ProtocolTests.test_protocols_isinstance_init.<locals>.PGrn   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd Zd Zy)7ProtocolTests.test_protocols_isinstance_init.<locals>.Cc                     || _         y rb   rb  r  s     r\   r7  z@ProtocolTests.test_protocols_isinstance_init.<locals>.C.__init__  r  r^   Nr  rk   r^   r\   r  r         r^   r  rn   )r   r*   r'   r   )rW   r   r  r  r  s        r\   test_protocols_isinstance_initz,ProtocolTests.test_protocols_isinstance_init  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>.HasXrt  Nr>  rk   r^   r\   r  r    r  r^   r  c                       e Zd Zy)CProtocolTests.test_protocols_isinstance_monkeypatching.<locals>.FooNr|   rk   r^   r\   r  r    r   r^   r  r   )r*   r'   r   rt  r   )rW   r  r  rf   s       r\   (test_protocols_isinstance_monkeypatchingz6ProtocolTests.test_protocols_isinstance_monkeypatching  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    r   r^   r  c                       e Zd Zy)=ProtocolTests.test_protocol_checks_after_subscript.<locals>.CNr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zy)BProtocolTests.test_protocol_checks_after_subscript.<locals>.Other1Nr|   rk   r^   r\   Other1r    r   r^   r  c                       e Zd Zy)BProtocolTests.test_protocol_checks_after_subscript.<locals>.Other2Nr|   rk   r^   r\   Other2r    r   r^   r  c                       e Zd Zy)>ProtocolTests.test_protocol_checks_after_subscript.<locals>.D1Nr|   rk   r^   r\   D1r    r   r^   r  c                       e Zd Zy)>ProtocolTests.test_protocol_checks_after_subscript.<locals>.D2Nr|   rk   r^   r\   D2r     r   r^   r  )r'   r   r   r   r`   r   r   r]   )	rW   r  r  r  r  CAr  r  CIs	            r\   $test_protocol_checks_after_subscriptz2ProtocolTests.test_protocol_checks_after_subscript  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   Nr  rk   r^   r\   r  r  '  r  r^   r  c                       e Zd Zd Zy)9ProtocolTests.test_protocols_support_register.<locals>.PMc                      y rb   rk   r   s    r\   rS  z>ProtocolTests.test_protocols_support_register.<locals>.PM.meth,  r   r^   Nre  rk   r^   r\   PMr  +  rc  r^   r  c                       e Zd Zy)8ProtocolTests.test_protocols_support_register.<locals>.DNr|   rk   r^   r\   rk  r  .  r   r^   rk  c                       e Zd Zy)8ProtocolTests.test_protocols_support_register.<locals>.CNr|   rk   r^   r\   r  r  0  r   r^   r  )r*   r'   r  r   )rW   r  r  rk  r  s        r\   test_protocols_support_registerz-ProtocolTests.test_protocols_support_register&  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   Nr  rk   r^   r\   r  r  8  r  r^   r  c                       e Zd ZdZy)NProtocolTests.test_none_on_non_callable_doesnt_block_implementation.<locals>.Arn   Nr  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>.BNr  rk   r^   r\   rj  r  ?      Ar^   rj  c                       e Zd Zd Zy)NProtocolTests.test_none_on_non_callable_doesnt_block_implementation.<locals>.Cc                     d | _         y rb   rb  r   s    r\   r7  zWProtocolTests.test_none_on_non_callable_doesnt_block_implementation.<locals>.C.__init__C  	    r^   Nr  rk   r^   r\   r  r  B      r^   r  ro  rW   r  r   rj  r  s        r\   5test_none_on_non_callable_doesnt_block_implementationzCProtocolTests.test_none_on_non_callable_doesnt_block_implementation7  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\   rt  zFProtocolTests.test_none_on_callable_blocks_implementation.<locals>.P.xL  r   r^   Nr  rk   r^   r\   r  r  J  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\   rt  zFProtocolTests.test_none_on_callable_blocks_implementation.<locals>.A.xO  r   r^   Nr  rk   r^   r\   r   r  N  r%  r^   r   c                       e Zd ZdZy)DProtocolTests.test_none_on_callable_blocks_implementation.<locals>.BNr  rk   r^   r\   rj  r  Q  r  r^   rj  c                       e Zd Zd Zy)DProtocolTests.test_none_on_callable_blocks_implementation.<locals>.Cc                     d | _         y rb   rb  r   s    r\   r7  zMProtocolTests.test_none_on_callable_blocks_implementation.<locals>.C.__init__U  r  r^   Nr  rk   r^   r\   r  r  T  r  r^   r  )r*   r'   r   r  s        r\   +test_none_on_callable_blocks_implementationz9ProtocolTests.test_none_on_callable_blocks_implementationI  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   Nr  rk   r^   r\   r  r  \  r  r^   r  c                       e Zd Zd Zy)6ProtocolTests.test_non_protocol_subclasses.<locals>.PRc                      y rb   rk   r   s    r\   rS  z;ProtocolTests.test_non_protocol_subclasses.<locals>.PR.metha  r   r^   Nre  rk   r^   r\   PRr  _       r^   r  c                       e Zd ZdZy)8ProtocolTests.test_non_protocol_subclasses.<locals>.NonPrn   Nr  rk   r^   r\   NonPr  c  r  r^   r  c                       e Zd Zy)9ProtocolTests.test_non_protocol_subclasses.<locals>.NonPRNr|   rk   r^   r\   NonPRr  f  r   r^   r  c                       e Zd ZdZy)5ProtocolTests.test_non_protocol_subclasses.<locals>.Crn   Nr  rk   r^   r\   r  r  h  r  r^   r  	metaclassc                       e Zd Zd Zy)5ProtocolTests.test_non_protocol_subclasses.<locals>.Dc                      y rb   rk   r   s    r\   rS  z:ProtocolTests.test_non_protocol_subclasses.<locals>.D.methl  r   r^   Nre  rk   r^   r\   rk  r  k  rc  r^   rk  __protocol_attrs____callable_proto_members_only__>   r7  _is_protocolro  r   __subclasshook___is_runtime_protocol)r'   r*   r  ABCMetar   r`   r   r]   assertNotInvarsassertLessEqualkeys)rW   r  r  r  r  r  rk  acceptable_extra_attrss           r\   test_non_protocol_subclassesz*ProtocolTests.test_non_protocol_subclasses[  s   	 	 
	! 	! 
	!	1 	 	B	#++ 		!#++ 	! 	  d+  e,  D)  E*egr*eR(-tDz:-tE{;:DJG:DKH"
 	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   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd Zy)7ProtocolTests.test_custom_subclasshook.<locals>.OKClassNr|   rk   r^   r\   OKClassr    r   r^   r  c                       e Zd ZdZy)8ProtocolTests.test_custom_subclasshook.<locals>.BadClassrn   Nr  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\   r  zBProtocolTests.test_custom_subclasshook.<locals>.C.__subclasshook__  s    ~~0066r^   Nrh   ri   rj   classmethodr  rk   r^   r\   r  r    s    7 7r^   r  )r'   r   r   r]   r`   )rW   r  r  r  r  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=  hasattrr  s     r\   r  zGProtocolTests.test_custom_subclasshook_2.<locals>.HasX.__subclasshook__      uc**r^   N)rh   ri   rj   rt  r  r  rk   r^   r\   r  r	    s    
 A+ +r^   r  c                       e Zd Zy)7ProtocolTests.test_custom_subclasshook_2.<locals>.EmptyNr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd ZdZy)@ProtocolTests.test_custom_subclasshook_2.<locals>.ImplementsHasXrn   Nr  rk   r^   r\   ImplementsHasXr    r  r^   r  c                       e Zd Zed        Zy)EProtocolTests.test_custom_subclasshook_2.<locals>.NotRuntimeCheckablec                     t        |d      S r=  r  r  s     r\   r  zVProtocolTests.test_custom_subclasshook_2.<locals>.NotRuntimeCheckable.__subclasshook__  r  r^   Nr  rk   r^   r\   NotRuntimeCheckabler    s    + +r^   r  r.  )r*   r'   r   r   r]   r`   r   r   rT   r;  r   )rW   r  r  r  r  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   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd Zy)8ProtocolTests.test_issubclass_fails_correctly.<locals>.CNr|   rk   r^   r\   r  r    r   r^   r  r/  )r*   r'   r   r   rT   rW   r  r  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\   rS  z>ProtocolTests.test_defining_generic_protocols.<locals>.PR.meth  r   r^   Nre  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\   r  r)    r   r^   r  )r   r*   r'   r   r   r   r   r   )rW   r   r!  r  r  r  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\   rS  zHProtocolTests.test_defining_generic_protocols_old_style.<locals>.PR.meth  r   r^   Nre  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  r0    r  r^   r  c                        e Zd ZdW  defdZy)CProtocolTests.test_defining_generic_protocols_old_style.<locals>.P1rt  r   c                      y rb   rk   r  s     r\   r  zGProtocolTests.test_defining_generic_protocols_old_style.<locals>.P1.bar  r   r^   Nrh   ri   rj   r   r  r  s   r\   r  r2        +Q+3+r^   r  c                        e Zd ZdW  defdZy)CProtocolTests.test_defining_generic_protocols_old_style.<locals>.P2rt  r   c                      y rb   rk   r  s     r\   r  zGProtocolTests.test_defining_generic_protocols_old_style.<locals>.P2.bar  r   r^   Nr4  r  s   r\   r  r7    r5  r^   r  c                       e Zd ZdZy)EProtocolTests.test_defining_generic_protocols_old_style.<locals>.PSubrn   Nr  rk   r^   r\   PSubr:    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   rt  r   c                     |S rb   rk   r  s     r\   r  zIProtocolTests.test_defining_generic_protocols_old_style.<locals>.Test.bar  s    r^   N)rh   ri   rj   rt  r   r  rk   r^   r\   Testr=    s    AS S r^   r?  )r   r*   r'   r#   r   r   r   r   rT   r]   r   )	rW   r!  r  r  r  r  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>.Foort  r   Nc                      y rb   rk   r  s     r\   rS  zMProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.Foo.meth  r   r^   r  r  s   r\   r  rD     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>   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>.Barrt  r   Nc                      y rb   rk   r  s     r\   rS  zMProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.Bar.meth  r   r^   r  r  s   r\   r  rH    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>  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__  r   r^   N)rh   ri   rj   rs  rN  r  s   r\   SupportsTruncrL  
  s    )1)r^   rO  r  r  s    @@r\   z%<generic parameters of SupportsTrunc>zjProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.<generic parameters of SupportsTrunc>
  s     	* 	*x 	*r^   g        )r*   r   r]   rR  )rW   r  r  rO  s       r\   -test_pep695_generic_protocol_callable_membersz;ProtocolTests.test_pep695_generic_protocol_callable_members  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  rS    r   r^   r  c                       e Zd Zd Zy))ProtocolTests.test_init_called.<locals>.Cc                     d| _         y r   testr   s    r\   r7  z2ProtocolTests.test_init_called.<locals>.C.__init__  r  r^   Nr  rk   r^   r\   r  rU        !r^   r  r  c                       e Zd Zd Zy))ProtocolTests.test_init_called.<locals>.Bc                     d| _         y r   rW  r   s    r\   r7  z2ProtocolTests.test_init_called.<locals>.B.__init__  r  r^   Nr  rk   r^   r\   rj  r[    rY  r^   rj  c                       e Zd Zy)*ProtocolTests.test_init_called.<locals>.D1Nr|   rk   r^   r\   r  r^     r  r^   r  c                       e Zd Zy)*ProtocolTests.test_init_called.<locals>.D2Nr|   rk   r^   r\   r  r`  %  r  r^   r  )r   r'   r   r   rX  )rW   r   r  r  rj  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  rd  -  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   )super__new__rX  )rX   r   rW   r  s      r\   ri  z0ProtocolTests.test_new_called.<locals>.C.__new__0  s"    ws2T2 	r^   rh   ri   rj   ri  __classcell__r  s   @r\   r  rf  /  s     r^   r  r  r   r  )r   r'   r   r   rX  r   r   )rW   r   r  r  s       r\   test_new_calledzProtocolTests.test_new_called*  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  rq  ?  r   r^   r  c                       e Zd Zyrp  r|   rk   r^   r\   r  z6ProtocolTests.test_protocols_bad_subscripts.<locals>.PA  r   r^   c                       e Zd Zyrp  r|   rk   r^   r\   r  z6ProtocolTests.test_protocols_bad_subscripts.<locals>.PC  r   r^   c                       e Zd Zyrp  r|   rk   r^   r\   r  z6ProtocolTests.test_protocols_bad_subscripts.<locals>.PE  r   r^   )r   r   r   r'   r   rc   rX  rW   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  ry  K  r   r^   r  z	P[~T, ~S]zP[int, str])r   r'   r   r   rC  r   r   ru  s       r\   test_generic_protocols_reprz)ProtocolTests.test_generic_protocols_reprG  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}  T  r   r^   r  )r   r'   r   r   r   r   ru  s       r\   test_generic_protocols_eqz'ProtocolTests.test_generic_protocols_eqP  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   ro  r   rn  r   rp  )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   Nr  rk   r^   r\   r  r  f  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\   rS  zJProtocolTests.test_generic_protocols_special_from_protocol.<locals>.P.methk  rd  r^   Nre  rk   r^   r\   r  r  j  rl  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\   rS  zKProtocolTests.test_generic_protocols_special_from_protocol.<locals>.PG.meths  rd  r^   N)rh   ri   rj   rt  rS  rk   r^   r\   r  r  p  s    Ar^   r  rS  rt  )r*   r'   r   r   r  r   r  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_protocole  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\   r  r    s    r^   r  c                       e Zd ZdZy)<ProtocolTests.test_no_runtime_deco_on_nominal.<locals>.Protorn   Nr  rk   r^   r\   rO  r    r  r^   rO  c                       e Zd Zy)?ProtocolTests.test_no_runtime_deco_on_nominal.<locals>.ConcreteNr|   rk   r^   r\   rU  r    s    r^   rU  )r   r   r*   r'   )rW   r  rO  rU  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>.PNr  rk   r^   r\   r  r    s    Ar^   r  c                       e Zd Zy)4ProtocolTests.test_none_treated_correctly.<locals>.BNr|   rk   r^   r\   rj  r    r   r^   rj  c                       e Zd ZdZy)4ProtocolTests.test_none_treated_correctly.<locals>.Crn   Nr  rk   r^   r\   r  r    r  r^   r  c                       e Zd ZdZy)4ProtocolTests.test_none_treated_correctly.<locals>.DNr  rk   r^   r\   rk  r    r  r^   rk  c                       e Zd Zd Zy)5ProtocolTests.test_none_treated_correctly.<locals>.CIc                     d| _         y r$  rb  r   s    r\   r7  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   rb  r   s    r\   r7  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  rj  r  rk  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>.PNr  rk   r^   r\   r  r    r  r^   r  )r'   rc   r   rU  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   Nr  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   Nr  rk   r^   r\   rl  r    s    r^   rl  )r   r*   r'   r  r   r  r>  r  rr   rs   rt   r%  r$  r   rt  __dict__r   )	rW   r   r  rq   r  rt  r  rk  rl  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]   rR  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__  r  r^   N)rh   ri   rj   r  rk   r^   r\   r  r    s    r^   r  )r]   complexrc   SupportsComplexr`   r   r  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__  s    r^   N)rh   ri   rj   r  rk   r^   r\   rj  r    r  r^   rj  )r]   rx  rc   SupportsBytesr`   r   )rW   rj  s     r\   test_supports_bytesz!ProtocolTests.test_supports_bytes  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]   rR  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   rR  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_reversible  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_index  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__  r  r^   N)rh   ri   rj   r   r  rk   r^   r\   r  r    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   rc   r  r  )rW   r  r  r  s       r\   $test_bundled_protocol_instance_worksz2ProtocolTests.test_bundled_protocol_instance_works  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.close  r   r^   N)rh   ri   rj   r  rk   r^   r\   Customr  
  r  r^   r  c                       e Zd Zy);ProtocolTests.test_collections_protocols_allowed.<locals>.ANr|   rk   r^   r\   r   r    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__  r8  r^   c                      yr3  rk   r   s    r\   r  zAProtocolTests.test_collections_protocols_allowed.<locals>.B.close  r  r^   N)rh   ri   rj   r  r  rk   r^   r\   rj  r    s    r^   rj  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   r  s     r\   __release_buffer__z]ProtocolTests.test_collections_protocols_allowed.<locals>.ReleasableBuffer.__release_buffer__  r   r^   )rh   ri   rj   
memoryviewr  rk   r^   r\   ReleasableBufferr    s    EZEDEr^   r  c                       e Zd Zy);ProtocolTests.test_collections_protocols_allowed.<locals>.CNr|   rk   r^   r\   r  r    r   r^   r  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  )r  )rW   r  s     r\   
__buffer__zFProtocolTests.test_collections_protocols_allowed.<locals>.D.__buffer__  s    !#&r^   r  Nc                      y rb   rk   r  s     r\   r  zNProtocolTests.test_collections_protocols_allowed.<locals>.D.__release_buffer__   rd  r^   )rh   ri   rj   r   r  r  r  rk   r^   r\   rk  r    s(    ' '
 'Z D r^   rk  )
r*   r  r  rU  r'   r]   r`   Bufferr   r   )rW   r  r   rj  r  r  rk  s          r\   "test_collections_protocols_allowedz0ProtocolTests.test_collections_protocols_allowed	  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\   CustomProtocolr  *  r   r^   r  c                       e Zd Zy)KProtocolTests.test_builtin_protocol_allowlist.<locals>.CustomContextManagerNr|   rk   r^   r\   CustomContextManagerr  -  r  r^   r  )r   r   r   r'   rc   ContextManager)rW   r  r  s      r\   test_builtin_protocol_allowlistz-ProtocolTests.test_builtin_protocol_allowlist(  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>.Prt  Nr>  rk   r^   r\   r  r
  1      Fr^   r  z@runtime_checkablern   )r'   r   r   r   rW   r  s     r\   *test_non_runtime_protocol_isinstance_checkz8ProtocolTests.test_non_runtime_protocol_isinstance_check0  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>.Prt  Nr>  rk   r^   r\   r  r  8  r  r^   r  c                        e Zd Z fdZ xZS )/ProtocolTests.test_super_call_init.<locals>.Fooc                 "    t         |           y rb   )rh  r7  )rW   r  s    r\   r7  z8ProtocolTests.test_super_call_init.<locals>.Foo.__init__<  s     "r^   rh   ri   rj   r7  rk  rl  s   @r\   r  r  ;  s    # #r^   r  r  )rW   r  r  s      r\   test_super_call_initz"ProtocolTests.test_super_call_init7  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  r  E  r   r^   r  rn   )r  r  Sized_abc_registry_clearr'   r   rx  s     r\   Dtest_interaction_with_isinstance_checks_on_superclasses_with_ABCMetazRProtocolTests.test_interaction_with_isinstance_checks_on_superclasses_with_ABCMetaA  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  P  r   r^   r  rn   )r  r  r  r  rc   r'   r   rx  s     r\   Ftest_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta_2zTProtocolTests.test_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta_2L  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\   rV  r"  X  s    '*r^   rV  )r&   r*   r'   r]   r;  r   )rW   rV  s     r\   (test_empty_protocol_decorated_with_finalz6ProtocolTests.test_empty_protocol_decorated_with_finalW  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>.ProtocolWithMethodrE  r   c                      y rb   rk   )rW   rE  s     r\   r  zhProtocolTests.test_protocol_decorated_with_final_callable_members.<locals>.ProtocolWithMethod.startswithc  r   r^   Nr  rk   r^   r\   ProtocolWithMethodr&  `  s     ;::r^   r(  r>  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>.ProtocolWithNonCallableMemberrt  Nr>  rk   r^   r\   ProtocolWithNonCallableMemberr,  k  s	     Fr^   r-  c                       e Zd ZdZy)QProtocolTests.test_protocol_decorated_with_final_noncallable_members.<locals>.Foor   Nr  rk   r^   r\   r  r/  p  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_membersj  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>.ProtocolWithMixedMembersrt  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\   ProtocolWithMixedMembersr6    s     F)r^   r8  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   rt  r  rk   r^   r\   r  r:    s
    A)r^   r  r  r   r0  )rW   r8  r  r1  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 	6r3  N)Jrh   ri   rj   rn  ry  r  r  r  r  r  r  r  r  r  r  r  r3  rn  rv  r  r  r  r  r  r  r  r/  r@  rf  rp  r  r  r  r  r  r  r  r  r  r  r  r*  r@  rP  ra  rm  rv  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)  r2  r<  rk   r^   r\   r_  r_  	  sx   ',/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,?r^   r_  c                   P   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 Z8y7)8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   ro  r   r   r"  r   rT   r   r   r   r  rR  )rW   ri  rm  SM1r   s        r\   r  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\   r  rD    r   r^   r  c                       e Zd Zy)4GenericTests.test_generic_errors.<locals>.NewGenericNr|   rk   r^   r\   
NewGenericrF    r   r^   rG  c                       e Zd Zy3GenericTests.test_generic_errors.<locals>.MyGenericNr|   rk   r^   r\   	MyGenericrJ    r   r^   rK  c                       e Zd ZyrI  r|   rk   r^   r\   rK  z3GenericTests.test_generic_errors.<locals>.MyGeneric  r   r^   rk   c                       e Zd ZyrC  r|   rk   r^   r\   r  z+GenericTests.test_generic_errors.<locals>.C  r   r^   )	r   r   r   r#   r   r   r   rT   r  )rW   r   r!  r  rG  rK  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) 	65DGWQZ5	6y) 	BK	!
!y) 	bE	 	'	 		 		1 	1	& 	&	( 	(	+ 	+	9 	9	6 	6	 		 	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_init  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   )rh  __init_subclass__rP  )rX   r<  r  s     r\   rU  z<GenericTests.test_init_subclass.<locals>.X.__init_subclass__  s    )3F3r^   rh   ri   rj   rU  rk  rl  s   @r\   ri  rS    s     r^   ri  c                       e Zd Zy)*GenericTests.test_init_subclass.<locals>.YNr|   rk   r^   r\   rm  rX    r  r^   rm  r   rn   r   c                       e Zd Zy)*GenericTests.test_init_subclass.<locals>.ZNr|   rk   r^   r\   ZrZ    r  r^   r[  c                       e Zd Zy)*GenericTests.test_init_subclass.<locals>.WNr|   rk   r^   r\   Wr]    r  r^   r^  )rc   r#   r   r   rP  r   r  r   )rW   ri  rm  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   r3  r   s    r\   r   zGenericTests.test_repr  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\   r  rc    r  r^   r  z.C[typing.Tuple[str, int]])	r   r#   r   r   r   r   r   r   rC  )rW   r   r!  r  ri  rm  r[  s          r\   test_chain_reprzGenericTests.test_chain_repr  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   rf  r!  s       r\   test_new_reprzGenericTests.test_new_repr  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   rX  r   r   r   )rW   r   ri  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\   r  rm    r   r^   r  )	r   r   r   r#   rc   r'   r    r   __mro__rW   r   r  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\   rj  rs  #  r  r^   rj  r   r>  c                       e Zd Zy)!GenericTests.test_dict.<locals>.CNr|   rk   r^   r\   r  ru  *  r  r^   r  r  r  )r   r#   r>  r   r  r   r  )rW   r   rj  r  r  r  s         r\   	test_dictzGenericTests.test_dict   s{    CL	
 	 CeR[1	# 	 CeU^4r^   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defNr  rk   r^   r\   r  ry  3  s    Ar^   r  rz  changednewc                       e Zd Zy)<GenericTests.test_subscripted_generics_as_proxies.<locals>.DNr|   rk   r^   r\   rk  r~  A  r  r^   rk  zfrom derived zzfrom derived x)	r   r#   r   r   rt  r   r   r  r   rW   r   r  rk  s       r\   $test_subscripted_generics_as_proxiesz1GenericTests.test_subscripted_generics_as_proxies1  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\   r  r  N  r   r^   r  rn   )
r   r  r  rX  r#   r  r   r   r  _abc_caches_clearro  s      r\   test_abc_registry_keptz#GenericTests.test_abc_registry_keptL  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  W  r   r^   r  )r!   r   r   r`   r  )rW   r  s     r\   test_false_subclassesz"GenericTests.test_false_subclassesV  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__]  r  r^   c                      y rb   rk   rW   r  rI  s      r\   r-  z3GenericTests.test_abc_bases.<locals>.MM.__setitem___  rd  r^   c                      y rb   rk   r  s     r\   __delitem__z3GenericTests.test_abc_bases.<locals>.MM.__delitem__a  rd  r^   c                     t        d      S r]  iterr   s    r\   r  z0GenericTests.test_abc_bases.<locals>.MM.__iter__c      Bxr^   c                      yr3  rk   r   s    r\   __len__z/GenericTests.test_abc_bases.<locals>.MM.__len__e  r  r^   Nrh   ri   rj   r)  r-  r  r  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  o  r  r^   r  c                       e Zd Zy)-GenericTests.test_multiple_bases.<locals>.MM2Nr|   rk   r^   r\   MM2r  q  r  r^   r  )r!   r   r  r  r   	__bases__r#   )rW   r  r  s      r\   test_multiple_basesz GenericTests.test_multiple_basesn  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\   r  r  w  r   r^   r  )r   rc   r    r   r   __orig_bases__ro  s      r\   test_orig_baseszGenericTests.test_orig_basesu  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  rI  r   r   s      r\   	<genexpr>zSGenericTests.test_naive_runtime_checks.<locals>.naive_dict_check.<locals>.<genexpr>  s3      1 q"%;*Q*;;s   '*)r   ro  r  rn  allr  )r  tpr   r   s     @@r\   naive_dict_checkz@GenericTests.test_naive_runtime_checks.<locals>.naive_dict_check{  sU    2$$%))){{B  #		   r^   rt  rn   c                 D    t        | d      st        | j                  |k(  S )Nr  )r  r  r  r  r  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  r  c                 ,    t        fd| D              S )Nc              3   j   K   | ]*  }t        |j                  d    j                  d           , yw)r   N)r   r  rn  )r  rt  r  s     r\   r  zXGenericTests.test_naive_runtime_checks.<locals>.naive_list_base_check.<locals>.<genexpr>  s6      % "!R%6%6q%9%B%B1%EF %s   03)r  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\   r  r    r   r^   r  r   r  )r   rc   r    r   r   r   r   r  r   r#   r   )rW   r  r  r  r  r  s         r\   test_naive_runtime_checksz&GenericTests.test_naive_runtime_checksz  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   rf  r  c                       e Zd Zy).GenericTests.test_multi_subscr_base.<locals>.CNr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zy).GenericTests.test_multi_subscr_base.<locals>.DNr|   rk   r^   r\   rk  r    r   r^   rk  rk   )
r   r   r   ro  r   rn  r  r  r#   r  )rW   r   rf  r  r  rk  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\   Metar    r   r^   r  .)	r   r   r   r5   r   r   r"   rn  Ellipsis)rW   r   r  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   r        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   r        r^   r   N)rh   ri   rj   r#   r   r   rk   r^   r\   rj  r    s    GAJ r^   rj  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   rj  r   r   r   r   r   r   rc   	FrozenSetr   r   rC  rW   r   rj  s      r\   test_generic_hashesz GenericTests.test_generic_hashes  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   rf  rk   c                       e Zd Zy)9GenericTests.test_extended_generic_rules_eq.<locals>.BaseNr|   rk   r^   r\   Baser    r   r^   r  c                       e Zd Zy)<GenericTests.test_extended_generic_rules_eq.<locals>.DerivedNr|   rk   r^   r\   Derivedr    r   r^   r  .)r   r   r   r   rc   rU  r   r   r   r   r"   r   r   )rW   r   rf  r  r  s        r\   test_extended_generic_rules_eqz+GenericTests.test_extended_generic_rules_eq  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. 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   rN  s     r\    test_extended_generic_rules_reprz-GenericTests.test_extended_generic_rules_repr  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 )Nrt  CCc                      y rb   rk   rb  s    r\   foobarz5GenericTests.test_generic_forward_ref.<locals>.foobar  r   r^   c                      y rb   rk   rb  s    r\   foobar2z6GenericTests.test_generic_forward_ref.<locals>.foobar2  r   r^   zCC | intc                      y rb   rk   rb  s    r\   foobar3z6GenericTests.test_generic_forward_ref.<locals>.foobar3  r   r^   c                       e Zd Zy)1GenericTests.test_generic_forward_ref.<locals>.CCNr|   rk   r^   r\   r  r    r   r^   r   .c                      y rb   rk   rb  s    r\   barfooz5GenericTests.test_generic_forward_ref.<locals>.barfoo  r   r^   c                      y rb   rk   rb  s    r\   barfoo2z6GenericTests.test_generic_forward_ref.<locals>.barfoo2  r   r^   )r   r  rA   r   r   r+   r  r  r   r   r   r"   )
rW   r  r  r  r  r   ATr  CTr  s
             r\   test_generic_forward_refz%GenericTests.test_generic_forward_ref  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  r    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']]ri  rt  c                      y rb   rk   rb  s    r\   rf   z7GenericTests.test_generic_pep585_forward_ref.<locals>.f6  r   r^   )r   r+   r  r  r  r  r   rQ  textwrapdedentr   rA   )rW   r  r  scoper  ri  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                     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   ro  r   r   rn  rp  r   splitr   r  r  r]   r  r   r   rT   SequencerU  )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_unionY  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rf  )r   r   r   r   r#   r   rc   r'   rN  s     r\   test_fail_with_bare_genericz(GenericTests.test_fail_with_bare_genericc  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	  p  r   r^   r	  c                       e Zd Zy)6GenericTests.test_type_erasure_special.<locals>.MyDictNr|   rk   r^   r\   MyDictr	  s  r   r^   r	  c                       e Zd Zy)5GenericTests.test_type_erasure_special.<locals>.MyDefNr|   rk   r^   r\   MyDefr	  v  r   r^   r	  c                       e Zd Zy)7GenericTests.test_type_erasure_special.<locals>.MyChainNr|   rk   r^   r\   MyChainr	  y  r   r^   r 	  )r   rg   r   r   r   r  r   r  rc   r    DefaultDictr   ChainMap)rW   r   r	  r	  r	  r 	  s         r\   test_type_erasure_specialz&GenericTests.test_type_erasure_speciall  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   )r  els     r\   r  z4GenericTests.test_all_repr_eq_any.<locals>.<genexpr>~  s     =#=s   r  ro  rn   )rc   __all__r   r   r   r&	  r   r   ro  r  r   r   rn  r   rn  )rW   objsr  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\   rj  r.	    r  r^   rj  c                       e Zd Zy)r  Nr|   rk   r^   r\   r  r    r  r^   r  r   r  rn   r  .rk   )r   r#   r   r  r>  r  rr   rs   rt   r%  r$  r   r  r   r   r   r"   r$   r   r   rx  rc   r!	  r  rU  r5   rX  AbstractSet)
rW   r   rj  r  rq   r  rt  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  r4	    r   r^   r  rk   .)r   r   )r   r#   r   r   r   r"   r   rc   rU  r    r   r$   r   rX  r   r   r   )rW   r   r  thingsr2  s        r\   test_copy_and_deepcopyz#GenericTests.test_copy_and_deepcopy  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~  TPBrW  TPVPP)r  rn   TLTLBTLVPL)r   r~  r   r8	  rx  r   r9	  rE   r:	  r   rc   rX  r$   rU  r   r   r   r"   ru   r   r   r   rr   rs   rt   r$  r%  )rW   ri  rq   r;	  r<	  r=	  r>	  s          r\   $test_immutability_by_copy_and_picklez1GenericTests.test_immutability_by_copy_and_pickle  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>.CrP  r   Nc                     || _         y rb   r  r  s     r\   r7  z<GenericTests.test_copy_generic_instances.<locals>.C.__init__  r  r^   r  r  s   r\   r  rB	    s    !Q !4 !r^   r  r   rn   )	r   r#   r   r   rP  r   assertIsNotr   r  )rW   r  r  cir   s       @r\   test_copy_generic_instancesz(GenericTests.test_copy_generic_instances  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   rX  r   r?   rx  rU  r   r  r  )rW   r   r5	  r2  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)potatoNrl  rk   r^   r\   r  rL	    s    #Ir^   r  r   rt  c                      y rb   rk   rb  s    r\   r>  z2GenericTests.test_parameterized_slots.<locals>.foo  r   r^   )r   r#   r   rM	  r   r  tomator   r+   r  r  r   r   )rW   r   r  r  c_intr>  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   Nrl  rk   r^   r\   rk  rT	    s    !2Ir^   rk  yesrE  )r   r#   r   rU	  r   r  r  )rW   r   rk  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\   r  r[	    r   r^   r  )r   r   r%  r"  r   r#   )rW   rj  r  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\   r  r^	  #  r  r^   r  r^	  r
	  r	  zC[int]c                       e Zd Zy)#GenericTests.test_repr_2.<locals>.YNr|   rk   r^   r\   rm  r`	  -  r  r^   rm  r`	  )	r#   r   r   ri   rh   rj   r   r   r	  )rW   r  ri  rm  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  r  r  c                       e Zd Zy),GenericTests.test_repr_3.<locals>.MyCallableNr|   rk   r^   r\   
MyCallablerd	  ;  r  r^   re	  c                       e Zd Zy),GenericTests.test_repr_3.<locals>.DoubleSpecNr|   rk   r^   r\   
DoubleSpecrg	  >  r  r^   rh	  c                       e Zd Zy)%GenericTests.test_repr_3.<locals>.TsPNr|   rk   r^   r\   TsPrj	  A  r  r^   rk	  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])r  expected_repr^z.*\.$)r   rE   r   r#   rF   r  r   r   r  rR  r  ru   assertRegexr   r   r   ri   )rW   r   r  r  r  r  re	  rh	  rk	  object_to_expected_reprr  rl	  s               r\   test_repr_3zGenericTests.test_repr_34  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_1a  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   rv	  h  r  r^   r   c                       e Zd Zy)!GenericTests.test_eq_2.<locals>.BNr|   rk   r^   r\   rj  rx	  k  r  r^   rj  )r#   r   r   r   r  s      r\   	test_eq_2zGenericTests.test_eq_2f  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|	  u  r  r^   r   c                       e Zd Zy)1GenericTests.test_multiple_inheritance.<locals>.BNr|   rk   r^   r\   rj  r~	  x  r  r^   rj  c                       e Zd Zy)1GenericTests.test_multiple_inheritance.<locals>.CNr|   rk   r^   r\   r  r	  {  r  r^   r  )r#   r   r   r   r   ro  )rW   r   rj  r  s       r\   test_multiple_inheritancez&GenericTests.test_multiple_inheritances  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\   rj  r	    r   r^   rj  c                       e Zd Zy)9GenericTests.test_multiple_inheritance_special.<locals>.CNr|   rk   r^   r\   r  r	    r   r^   r  )r   r#   r   r   r   rn  r  r;  )rW   r!  rj  r  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   rh  rU  )rX   r<  r*	  r%   r	  r  s      r\   rU  zMGenericTests.test_init_subclass_super_called.<locals>.Final.__init_subclass__  sD    MM 3D5(Ze-D,T223 )3F3r^   r  rV  )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r	  r|   rk   r^   r\   r	  z>GenericTests.test_init_subclass_super_called.<locals>.Subclass  r   r^   )	Exceptionr#   r   r   r   )rW   r?  r	  r%   r	  s      @@r\   test_init_subclass_super_calledz,GenericTests.test_init_subclass_super_called  s    	Y 		4 	4	71:u 	~. 	4 	 ~. 	49 	 		 		 	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\   r*  z-GenericTests.test_nested.<locals>.Visitor.set  r  r^   c                     | j                   S rb   r  r   s    r\   r1  z-GenericTests.test_nested.<locals>.Visitor.get      vvr^   r   c                     | j                   S rb   r  r   s    r\   visitz/GenericTests.test_nested.<locals>.Visitor.visit  r	  r^   )rh   ri   rj   r   r   r*  r1  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>.IntListVisitorrt  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^   r	  rn   r   )	r#   r   rc   r   r   r*  r  r   r1  )rW   rn  r	  r  r	  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>.NodeNrB  leftNode[T]rightc                 .    || _         || _        || _        y rb   rB  r	  r	  )rW   rB  r	  r	  s       r\   r7  z5GenericTests.test_type_erasure.<locals>.Node.__init__  s     #
 	"
r^   NNr  r  s   r\   r  r	    s%    +/,0#a #(# )#r^   r  rt  c                     |       }    |       } t            |       }j                  t        |             j                  t        |             j                  t        |             j                  |j                  |        j                  |j                  |        j                  |j                  |        y rb   )r   r   r   r   rB  )rt  r   r  r  r  r   rW   s       r\   r>  z+GenericTests.test_type_erasure.<locals>.foo  s    QAQ
AS	!AMM$q'4(MM$q'4(MM$q'4(QWWa(QWWa(QWWa(r^   r   r   r#   )rW   r>  r  r   s   ` @@r\   r  zGenericTests.test_type_erasure  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\   r  r	    r  r^   r  c                       e Zd Zy))GenericTests.test_implicit_any.<locals>.DNr|   rk   r^   r\   rk  r	    r  r^   rk  rk   )r   r#   r   ro  r   r   r   r   r  s       r\   test_implicit_anyzGenericTests.test_implicit_any  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   r	    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   )rh  ri  r   rX   r   r  r  s      r\   ri  z2GenericTests.test_new_with_args.<locals>.B.__new__  s    goc*
r^   rj  rl  s   @r\   rj  r	         r^   rj  c                       e Zd Zy)*GenericTests.test_new_with_args.<locals>.CNr|   rk   r^   r\   r  r	    r  r^   r  r>  )r#   r   r   r   rW   r   rj  r  r  s        r\   test_new_with_argszGenericTests.test_new_with_args  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_arh  r7  rW   r   r  s     r\   r7  z4GenericTests.test_new_with_args2.<locals>.A.__init__  s    ! "r^   r  rl  s   @r\   r   r	    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_crh  r7  r	  s     r\   r7  z4GenericTests.test_new_with_args2.<locals>.C.__init__  s    ! %r^   r  rl  s   @r\   r  r	    s    & &r^   r  r>  )r#   r   r   r	  r	  )rW   r   r  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   r>  c                        e Zd Z fdZ xZS )(GenericTests.test_new_no_args.<locals>.Bc                 4    t         |   |       }d|_        |S )Nr  )rh  ri  from_b)rX   r  r  s     r\   ri  z0GenericTests.test_new_no_args.<locals>.B.__new__      goc* 

r^   rj  rl  s   @r\   rj  r	    r	  r^   rj  c                   $     e Zd Zd Z fdZ xZS )(GenericTests.test_new_no_args.<locals>.Cc                     || _         y rb   r   rR  s     r\   r7  z1GenericTests.test_new_no_args.<locals>.C.__init__  s	    r^   c                 4    t         |   |       }d|_        |S )Nr  )rh  ri  r	  r	  s      r\   ri  z0GenericTests.test_new_no_args.<locals>.C.__new__  r	  r^   )rh   ri   rj   r7  ri  rk  rl  s   @r\   r  r	    s     r^   r  r  r  )r#   r   r   r   r   r   r	  r	  r	  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   rm	  r   rn	  c                       e Zd Zy)4GenericTests.test_subclass_special_form.<locals>.FooNr|   rk   r^   r\   r  r	  4      r^   r  )r$   r   r%   r   rR  r   r   rF   rE   rI   ru   r   r   r   r   )rW   r  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 )	NrZ  Tr[  c                       e Zd Zy)2GenericTests.test_complex_subclasses.<locals>.BaseNr|   rk   r^   r\   r  r	  :  r  r^   r  r   c                       e Zd Zy)1GenericTests.test_complex_subclasses.<locals>.SubNr|   rk   r^   r\   r   r	  @  r  r^   r   r	  )rW   rZ  r  r   r   s        r\   test_complex_subclassesz$GenericTests.test_complex_subclasses7  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   ro  rk   r^   r\   r   r	  F  s	    TNr^   r   )r  subz.* is not a generic class)r   r   r   ro  r  r   r   r   rE   r  r  	UnionTyperu   r   r   r   )rW   r   r   r  s       r\   test_parameter_detectionz%GenericTests.test_parameter_detectionC  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\   rn  r	  V  r  r^   rn  c                       e Zd ZW  fZy)2GenericTests.test_non_generic_subscript.<locals>.AN)rh   ri   rj   ro  r  s   r\   r   r	  X  s
    TNr^   r   )r  r	  )callabler	  )r   r#   r   r   r  r   rE   r  r  r	  r   r  ru   r   r   r   r"   r  r  )rW   rn  r   r  r2  r   r  r   s          @r\   test_non_generic_subscriptz'GenericTests.test_non_generic_subscriptT  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)9rh   ri   rj   r  rN  rP  r_  r   rd  rg  rj  rp  rv  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r	  r	  r#	  r+	  r  r6	  r?	  rF	  rI	  rQ	  rX	  r   ra	  rq	  rs	  ry	  r	  r	  r	  r	  r  r	  r	  r	  r	  r	  r	  r	  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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\   r  zClassVarTests.test_basicsr  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_reprx  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\   r  r	    r   r^   r  c                       e Zd Zyr	  r|   rk   r^   r\   r  z-ClassVarTests.test_cannot_subclass.<locals>.C  r   r^   z Cannot subclass typing\.ClassVarc                       e Zd Zyr	  r|   rk   r^   r\   r  z-ClassVarTests.test_cannot_subclass.<locals>.C  r   r^   z'Cannot subclass typing\.ClassVar\[int\]c                       e Zd Zyr	  r|   rk   r^   r\   r  z-ClassVarTests.test_cannot_subclass.<locals>.C  r   r^   )r   r   r   r   r$   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\   r"  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r$  )r   r   r   r$   r   rT   r   s    r\   r%  z ClassVarTests.test_no_isinstance  e    y) 	)q(3-(	)y) 	&sH%	& 	&	) 	)	& 	&   A)A5)A25A>Nrh   ri   rj   r  r   r   r"  r%  rk   r^   r\   r	  r	  p  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\   r  zFinalTests.test_basics  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\   r  r
    r   r^   r  c                       e Zd Zyr
  r|   rk   r^   r\   r  z*FinalTests.test_cannot_subclass.<locals>.C  r   r^   zCannot subclass typing\.Finalc                       e Zd Zyr
  r|   rk   r^   r\   r  z*FinalTests.test_cannot_subclass.<locals>.C  r   r^   z$Cannot subclass typing\.Final\[int\]c                       e Zd Zyr
  r|   rk   r^   r\   r  z*FinalTests.test_cannot_subclass.<locals>.C  r   r^   )r   r   r   r   r%   r   r  s     r\   r   zFinalTests.test_cannot_subclass  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\   r"  zFinalTests.test_cannot_init  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r$  )r   r   r   r%   r   rT   r   s    r\   r%  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   rb  s    r\   funcz7FinalDecoratorTests.test_final_unmodified.<locals>.func  r   r^   )r   r&   rW   r
  s     r\   test_final_unmodifiedz)FinalDecoratorTests.test_final_unmodified  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>.func      r^   c                       e Zd Zy)2FinalDecoratorTests.test_dunder_final.<locals>.ClsNr|   rk   r^   r\   Clsr"
    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\   r7  z?FinalDecoratorTests.test_dunder_final.<locals>.Wrapper.__init__  r  r^   c                 &     | j                   |i |S rb   r&
  r  s      r\   r  z?FinalDecoratorTests.test_dunder_final.<locals>.Wrapper.__call__  s     tyy$1&11r^   N)rh   ri   rj   rm  r7  r  rk   r^   r\   Wrapperr%
    s    !I!2r^   r)
  c                       y rb   rk   rk   r^   r\   wrappedz6FinalDecoratorTests.test_dunder_final.<locals>.wrapped  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   r  r,
  rk   r^   r\   r  r.
    s    6 6r^   r  c                       e Zd Zy)7FinalDecoratorTests.test_dunder_final.<locals>.WithMetaNr|   rk   r^   r\   WithMetar2
    s    (+r^   r3
  r  r0
  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&   r  r7
  staticmethodr9
  r  r<
  r   r>
  rk   r^   r\   Methodsr5
    s^    #  #     [!  !r^   r@
  r7
  r9
  )r&   r   r,
  r   r  r   r   r   inspectgetattr_staticr<
  fgetr>
  )rW   r
  r#
  r)
  r+
  r  r3
  r@
  s           r\   test_dunder_finalz%FinalDecoratorTests.test_dunder_final  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
  rD
  rk   r^   r\   r
  r
    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   rK
  r  rM
  rO
  r?
  rQ
  rS
  rk   r^   r\   r  rI
    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\   rK
  zCOverrideDecoratorTests.test_override.<locals>.Derived.normal_method(  r  r^   c                      yr   rk   r  s    r\   rM
  zMOverrideDecoratorTests.test_override.<locals>.Derived.class_method_good_order,       r^   c                      yr   rk   r  s    r\   rO
  zLOverrideDecoratorTests.test_override.<locals>.Derived.class_method_bad_order0  rX
  r^   c                       yr   rk   rk   r^   r\   rQ
  zNOverrideDecoratorTests.test_override.<locals>.Derived.static_method_good_order5  rX
  r^   c                       yr   rk   rk   r^   r\   rS
  zMOverrideDecoratorTests.test_override.<locals>.Derived.static_method_bad_order9  rX
  r^   N)rh   ri   rj   r.   rK
  r  rM
  rO
  r?
  rQ
  rS
  rk   r^   r\   r  rU
  '  s               r^   r  r   TF__override__)
r]   r   rK
  r   r\
  rM
  rO
  r  rQ
  rS
  )rW   r  r  instances       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r$  rk   r   s    r\   correctz:OverrideDecoratorTests.test_property.<locals>.Base.correctW      r^   c                      yr$  rk   r   s    r\   wrongz8OverrideDecoratorTests.test_property.<locals>.Base.wrongZ  rd
  r^   N)rh   ri   rj   r  r   rc
  rf
  rk   r^   r\   r  ra
  V  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\   rc
  z;OverrideDecoratorTests.test_property.<locals>.Child.correct_       r^   c                      yrj
  rk   r   s    r\   rf
  z9OverrideDecoratorTests.test_property.<locals>.Child.wrongc  rk
  r^   N)rh   ri   rj   r  r.   r   rc
  rf
  rk   r^   r\   Childrh
  ^  sD       s   r^   rm
  r   r\
  )	r   rc
  r   rC
  r\
  rf
  r   r  fset)rW   r  rm
  r]
  s       r\   test_propertyz$OverrideDecoratorTests.test_propertyU  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rC
  c                     || _         y rb   rs
  )rW   rC
  s     r\   r7  zGOverrideDecoratorTests.test_silent_failure.<locals>.CustomProp.__init__r  r  r^   Nc                 $    | j                  |      S rb   rs
  r  s      r\   r  zFOverrideDecoratorTests.test_silent_failure.<locals>.CustomProp.__get__t  s    yy~%r^   rb   )rh   ri   rj   rm  r7  r  rk   r^   r\   
CustomProprr
  p  s    !I!&r^   rv
  c                   *    e Zd ZeW  d               Zy)@OverrideDecoratorTests.test_silent_failure.<locals>.WithOverridec                      yr$  rk   r   s    r\   r   zEOverrideDecoratorTests.test_silent_failure.<locals>.WithOverride.somex  rk
  r^   N)rh   ri   rj   r.   r   )rv
  s   r\   WithOverriderx
  w  s      r^   rz
  rn   r\
  )r   r   r   r  )rW   rz
  rv
  s     @r\   test_silent_failurez*OverrideDecoratorTests.test_silent_failureo  sJ    	& 	&	 	 	**A.!2!2NCDr^   c                 X   dd l fd G fdd      } |       }| j                  |j                  d      d       | j                  |j                  j                         | j                  |j                  d      d       | j                  |j
                  j                         y )Nr   c                 <     j                          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   	functoolss   ` r\   
with_wrapszCOverrideDecoratorTests.test_multiple_decorators.<locals>.with_wraps  s#    __Q*  *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 r$  rk   r	  s     r\   on_topzLOverrideDecoratorTests.test_multiple_decorators.<locals>.WithOverride.on_top       1ur^   c                     |dz   S rj
  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\   rz
  r
    sS        3 3   r^   rz
  rn   r   r  )r
  r   r
  r   r\
  r
  )rW   rz
  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^
  ro
  r{
  r
  rk   r^   r\   rF
  rF
    s    8TtD4E"9r^   rF
  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   rR  r   r   r   r  r   r   r   r   s    r\   r  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_errors  s    RWbr^   Nrh   ri   rj   r  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   rR  r   rR  s     r\   r  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(   rR  s     r\   r   zAssertTypeTests.test_errors  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
    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    &;;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%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>.NoderB  c                 .    || _         d x| _        | _        y rb   r	  )rW   rB  s     r\   r7  z2ForwardRefTests.test_basics.<locals>.Node.__init__  s    "
)--	DJr^   Nr	  zOptional[Node[T]]r	  r	  stuffc                      || _         || _        y rb   )r	  r	  )rW   r	  r	  r
  blahs        r\   add_bothz2ForwardRefTests.test_basics.<locals>.Node.add_both  s    
 !	"
r^   nodec                 (    | j                  |d        y rb   r
  rW   r
  s     r\   add_leftz2ForwardRefTests.test_basics.<locals>.Node.add_left      dD)r^   c                 (    | j                  d |       y rb   r
  r
  s     r\   	add_rightz3ForwardRefTests.test_basics.<locals>.Node.add_right  r
  r^   )NNNrb   )r
  r	  )
rh   ri   rj   r   r7  r   r
  r   r
  r
  rk   r^   r\   r  r
    sN    .a . -1&*"	#2# )# !$#*Xi%8 **r^   r  r	  r	  r
  r
  r
  )r#   r   r   r+   r
  r  r  r   r   r  r
  r
  )rW   r  r2  
both_hints
left_hintsright_hintss         r\   r  zForwardRefTests.test_basics  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r$  )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   r
  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 )Nr  c                       e Zd Zy)4ForwardRefTests.test_forward_equality_gth.<locals>.CNr|   rk   r^   r\   r  r
  
  r  r^   r   r  c                      y rb   rk   r   r  s     r\   r>  z6ForwardRefTests.test_forward_equality_gth.<locals>.foo  r  r^   r
  )
rc   rA   r   r+   r  r  r   r   r   r   )rW   r  c1_gthr  c2_gthr  r>  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   r
  s     r\   r>  z7ForwardRefTests.test_forward_equality_hash.<locals>.foo  r  r^   r
  r
  )	rc   rA   r+   r  r  r   r  rh   r   )rW   r  r
  r  r
  r>  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
  0  r  r^   r   c                  v    t        j                  d      } d| fd}t        |t               t	                      | S )Nr   rt  c                      y rb   rk   rb  s    r\   rf  zPForwardRefTests.test_forward_equality_namespace.<locals>.namespace1.<locals>.fun4  rd  r^   rc   rA   r+   r  r  )r   rf  s     r\   
namespace1zCForwardRefTests.test_forward_equality_namespace.<locals>.namespace12  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   r
  <  r   r^   rt  c                      y rb   rk   rb  s    r\   rf  zPForwardRefTests.test_forward_equality_namespace.<locals>.namespace2.<locals>.fun>  rd  r^   r
  )r   r   rf  s      r\   
namespace2zCForwardRefTests.test_forward_equality_namespace.<locals>.namespace29  s?    !!#&A q  3	684Hr^   )r   r   )rW   r   r
  r
  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')]modr
  z,typing.List[ForwardRef('int', module='mod')])r   r   r   rA   r   s    r\   test_forward_reprz!ForwardRefTests.test_forward_reprG  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\   r>  z/ForwardRefTests.test_union_forward.<locals>.fooN  r  r^   c                      y rb   rk   r  s    r\   r>  z/ForwardRefTests.test_union_forward.<locals>.fooT  r  r^   )	r   r   r+   r  r  r   r  rA   r   rW   r>  s     r\   test_union_forwardz"ForwardRefTests.test_union_forwardL  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\   r>  z/ForwardRefTests.test_tuple_forward.<locals>.foo\  r  r^   c                      y rb   rk   r  s    r\   r>  z/ForwardRefTests.test_tuple_forward.<locals>.foob  r  r^   )r   r   r+   r  r  r   r  rA   r
  s     r\   test_tuple_forwardz"ForwardRefTests.test_tuple_forwardZ  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\   r>  z0ForwardRefTests.test_double_forward.<locals>.fooi  r  r^   )r   zList['int'])r   r+   r  r  r   r   r
  s     r\   test_double_forwardz#ForwardRefTests.test_double_forwardh  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   rt  c                      y rb   rk   rb  s    r\   rf  zPForwardRefTests.test_forward_recursion_actually.<locals>.namespace1.<locals>.funr  r   r^   r
  r   r   rf  rets       r\   r
  zCForwardRefTests.test_forward_recursion_actually.<locals>.namespace1o  6    !!#&AAq gi:CHr^   c                  z    t        j                  d      } | }d| fd}t        |t               t	                     }| S )Nr   rt  c                      y rb   rk   rb  s    r\   rf  zPForwardRefTests.test_forward_recursion_actually.<locals>.namespace2.<locals>.funz  r   r^   r
  r
  s       r\   r
  zCForwardRefTests.test_forward_recursion_actually.<locals>.namespace2w  r
  r^   c                     | |k(  S rb   rk   )o1o2s     r\   cmpz<ForwardRefTests.test_forward_recursion_actually.<locals>.cmp  s    8Or^   )rD	  r   RecursionError)rW   r
  r
  r
  r1r2s         r\   test_forward_recursion_actuallyz/ForwardRefTests.test_forward_recursion_actuallyn  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>.Cr>  N)rh   ri   rj   r   r   )r
  s   r\   r  r
    s    er^   r  c                   (    e Zd ZU eW  W f   ed<   y)7ForwardRefTests.test_union_forward_recursion.<locals>.Dr>  N)rh   ri   rj   r   r   r
  	ValueLists   r\   rk  r
    s    ui'((r^   rk  c                   .    e Zd ZU eeW     W f   ed<   y)7ForwardRefTests.test_union_forward_recursion.<locals>.Er>  Nrh   ri   rj   r   r   r   r
  s   r\   rl  r     s    tE{I-..r^   rl  c                   2    e Zd ZU eW  eW     W f   ed<   y)7ForwardRefTests.test_union_forward_recursion.<locals>.Fr>  Nr  r
  s   r\   rm  r    s    ud5k9455r^   rm  r>  )r   r   r   r   r+   r  r  )rW   r  rk  rl  rm  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\   r>  z2ForwardRefTests.test_callable_forward.<locals>.foo  r  r^   )r"   r   r+   r  r  r   r
  s     r\   test_callable_forwardz%ForwardRefTests.test_callable_forward  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\   r>  z@ForwardRefTests.test_callable_with_ellipsis_forward.<locals>.foo  r  r^   .)r   zCallable[..., T])r   r+   r  r  r"   r   r
  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>.Cr  )ClassVar[int])r  r  r   )
Final[int]constr  r$   rt  r%   r  N)	rh   ri   rj   r   r@   r   r  rt  r  rk   r^   r\   r  r    s5    45Ay01523Ay./3AzAwNr^   r  c                   "    e Zd ZU dZed   ed<   y)6ForwardRefTests.test_special_forms_forward.<locals>.CFr  r  r  N)rh   ri   rj   r  r   r   rk   r^   r\   CFr    s    $%AtL!%r^   r  r   r  rt  r  )r   r+   r  r$   r   r%   r   r   )rW   r  r  s      r\   test_special_forms_forwardz*ForwardRefTests.test_special_forms_forward  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_error  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\   r>  z6ForwardRefTests.test_delayed_syntax_error.<locals>.foo  r  r^   )r   zNode[T)r   r  r+   r
  s     r\   test_delayed_syntax_errorz)ForwardRefTests.test_delayed_syntax_error  s4    	 {+ 	 3	  	  	 s   /8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\   r>  z,ForwardRefTests.test_name_error.<locals>.foo  r  r^   )r   zNoode[T])r   	NameErrorr+   r  r
  s     r\   test_name_errorzForwardRefTests.test_name_error  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\   r>  z/ForwardRefTests.test_no_type_check.<locals>.foo      r^   )r2   r+   r   )rW   r>  ths      r\   test_no_type_checkz"ForwardRefTests.test_no_type_check  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\   r>  z7ForwardRefTests.test_no_type_check_class.<locals>.C.foo  rd  r^   Nrh   ri   rj   r>  rk   r^   r\   r  r'        { r r^   r  )r2   r+   r>  r   )rW   r  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>.Crt  c                      y rb   rk   r  s     r\   rS  z;ForwardRefTests.test_no_type_check_no_bases.<locals>.C.meth  r   r^   Nr  rk   r^   r\   r  r0    s
    'c'r^   r  c                       e Zd ZW  Zy)6ForwardRefTests.test_no_type_check_no_bases.<locals>.DN)rh   ri   rj   r  r  s   r\   rk  r3    s    Ar^   rk  rt  c                       e Zd ZdefdZy):ForwardRefTests.test_no_type_check_no_bases.<locals>.Childrt  c                      y rb   rk   r  s     r\   r>  z>ForwardRefTests.test_no_type_check_no_bases.<locals>.Child.foo  r   r^   N)rh   ri   rj   r   r>  rk   r^   r\   rm
  r6    s
    &S&r^   rm
  )r2   r   r+   rS  r   r>  )rW   rk  rm
  r  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\   rW  r;    r  r^   rW  c                       e Zd ZU eed<   y):ForwardRefTests.test_no_type_check_nested_types.<locals>.Br  Nr>  rk   r^   r\   rj  r=    r  r^   rj  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\   r  rC    s    Fr^   r  N)rh   ri   rj   r   r   r  rk   r^   r\   rj  rA    s     r^   rj  c                       e Zd ZU eed<   y)<ForwardRefTests.test_no_type_check_nested_types.<locals>.A.Dr  Nr>  rk   r^   r\   rk  rE        r^   rk  N)rh   ri   rj   r   r   rj  rk  rW  rk   r^   r\   r   r?  	  s"    F   Er^   r   )r  )not_modified)r2   rj  r  rk  ru   r   __no_type_check__r   r+   r   r  r   )rW   rW  rj  r   r  rG  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>.Somert  r   c                      y rb   rk   rb  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   rN  r  rP  rk   r^   r\   SomerL  !  s2    &c&c& &+3+3+ +r^   rQ  )r2   r   rN  rH  r   r+   rP  )rW   rQ  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
  rH  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_aliasr  
some_classr?
  some_static)r   s   r\   r   rX  =  s    J$T*J&t,Kr^   r   )r   r   )r   r2   r   r  rH  r   r+   )rW   r   r   s     @r\   $test_no_type_check_foreign_functionsz4ForwardRefTests.test_no_type_check_foreign_functions8  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\   r  z=ForwardRefTests.test_no_type_check_lambda.<locals>.A.<lambda>K  s    C r^   r  N)rh   ri   rj   r  r"   r   r   rk   r^   r\   r   r_  H  s     )8C3%*%7r^   r   )r2   r   r  rH  r   r+   r   s     r\   test_no_type_check_lambdaz)ForwardRefTests.test_no_type_check_lambdaG  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_TypeErrorP  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   r>  N)rh   ri   rj   r>  rc   r$   r   r   rk   r^   r\   r  rf  V  s    ()C%)r^   r  c                   "    e Zd ZU dZee   ed<   y)CForwardRefTests.test_no_type_check_forward_ref_as_string.<locals>.Drg  r>  N)rh   ri   rj   r>  r$   r   r   rk   r^   r\   rk  ri  X  s    !"C#"r^   rk  c                       e Zd ZU dZded<   y)CForwardRefTests.test_no_type_check_forward_ref_as_string.<locals>.Erg  r	  r>  Nrh   ri   rj   r>  r   rk   r^   r\   rl  rk  Z  s    *+C'+r^   rl  c                       e Zd ZU dZded<   y)CForwardRefTests.test_no_type_check_forward_ref_as_string.<locals>.Frg  r  r>  Nrl  rk   r^   r\   rm  rn  \  s    #$C$r^   rm  r>  )rc   r$   r   r   r+   )rW   r  rk  rl  rm  expected_resultclazzs          r\   (test_no_type_check_forward_ref_as_stringz8ForwardRefTests.test_no_type_check_forward_ref_as_stringU  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>.Erg  z%typing.ClassVar[typing.ClassVar[int]]r>  Nrl  rk   r^   r\   rl  rt  d  s    ;<C8<r^   rl  c                   "    e Zd ZU dZed   ed<   y)GForwardRefTests.test_nested_classvar_fails_forward_ref_check.<locals>.Frg  r  r>  N)rh   ri   rj   r>  r$   r   rk   r^   r\   rm  rv  f  s    -.C/*.r^   rm  )r   r   r+   )rW   rl  rm  rp  s       r\   ,test_nested_classvar_fails_forward_ref_checkz<ForwardRefTests.test_nested_classvar_fails_forward_ref_checkc  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_decoratoro  s    Kr^   rz  r   r   r   c                      y rb   rk   r  s    r\   r>  z4ForwardRefTests.test_meta_no_type_check.<locals>.foou  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\   r>  z6ForwardRefTests.test_meta_no_type_check.<locals>.C.foo{  rd  r^   Nr)  rk   r^   r\   r  r}  y  r*  r^   r  r>  )r3   r   rh   r+   r>  )rW   rz  r>  r  r#  r+  r,  s          r\   test_meta_no_type_checkz'ForwardRefTests.test_meta_no_type_checkm  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
r  rk  )r   r   )rQ  r+   r>  r   )rW   r  rS  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 )NrP  )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 rs  )rA   r   r   rj  s     r\   ru  zForwardRefTests.test_or  sC    sOS%3-0q%Q-0r^   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-  r8  rI  rR  rT  r\  ra  rc  rq  rw  r  r  r  ru  rk   r^   r\   r
  r
    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 )Nr  rk   rz  s     r\   cached_funcr    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\   r7
  zMethodHolder.clsmethod  s    r^   c                       y rb   rk   rk   r^   r\   r9
  zMethodHolder.stmethod  r 
  r^   c                      y rb   rk   r   s    r\   r  zMethodHolder.method  r   r^   N)rh   ri   rj   r  r7
  r?
  r9
  r  rk   r^   r\   r  r    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\   r
  z/OverloadTests.test_overload_fails.<locals>.blah  s    r^   )r   r  r   rW   r
  s     r\   test_overload_failsz!OverloadTests.test_overload_fails  s?    23 	  F	 	 	r   c                 0    t         d        }d } |        y )Nc                       y rb   rk   rk   r^   r\   r
  z2OverloadTests.test_overload_succeeds.<locals>.blah  r"  r^   c                       y rb   rk   rk   r^   r\   r
  z2OverloadTests.test_overload_succeeds.<locals>.blah  r  r^   r   r  s     r\   test_overload_succeedsz$OverloadTests.test_overload_succeeds  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\   r  zCOverloadTests.test_overload_on_compiled_functions.<locals>.<lambda>  s    {4'8 r^   )	r
   r   r   rc   _overload_registryr   sumprintr   r   s    r\   #test_overload_on_compiled_functionsz1OverloadTests.test_overload_on_compiled_functions  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\   r
  z,OverloadTests.set_up_overloads.<locals>.blah  r  r^   c                       y rb   rk   rk   r^   r\   r
  z,OverloadTests.set_up_overloads.<locals>.blah  r  r^   c                       y rb   rk   rk   r^   r\   r
  z,OverloadTests.set_up_overloads.<locals>.blah  r  r^   r  )rW   r
  	overload1	overload2s       r\   set_up_overloadszOverloadTests.set_up_overloads  s?    	 		 		 i+++r^   r  c                       t        t              S rb   r  rk   r^   r\   r  zOverloadTests.<lambda>  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  r   r^   c                       y rb   rk   rk   r^   r\   the_only_onez:OverloadTests.test_overload_registry.<locals>.the_only_one  r   r^   )	r   rc   r  r  r   r  r   r   r   )rW   impl	overloadsr  other_overloadr  r  s          r\   test_overload_registryz$OverloadTests.test_overload_registry  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 rj
  )rr   r  r   r  r   )rW   _r  r  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  rL   r  r  r
   r   r  r  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\   r7  zAwaitableWrapper.__init__  	    
r^   r   c              #   *   K   d  | j                   S wrb   r  r   s    r\   	__await__zAwaitableWrapper.__await__  s     zzs   N)rh   ri   rj   r7  rc   Iteratorr  r  rk   r^   r\   r  r    s    6??3/ r^   r  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   r  r  s     r\   r7  zAsyncIteratorWrapper.__init__  r  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   rU  r  r7  AsyncIteratorr  r  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	     r  N)rh   ri   rj   r   r  r  rk   r^   r\   r  r  $  s    # r^   r  c                       e Zd ZU eed<   y)r   r  N)rh   ri   rj   rR  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)rj  Nrt  r  r  )rh   ri   rj   rt  r$   r   r   r   rk   r^   r\   rj  rj  ,  s    !%Ax%
F
Fr^   rj  c                   ,    e Zd ZU  e       Zed    ed<   y)CSubr  N)rh   ri   rj   rj  r  r$   r   rk   r^   r\   r  r  0  s    #Axr^   r  c                   (    e Zd ZU g Zeee      ed<   y)rn  lstN)rh   ri   rj   r  r$   r   r   r   rk   r^   r\   rn  rn  2  s    C$q'	r^   rn  c                       e Zd ZU ed    ed<   y)r  rP  N)rh   ri   rj   r%   r   rk   r^   r\   r  r  5  s    
-r^   r  c                   "    e Zd ZU d ed<   ded<   y)NoneAndForwardparentNmeaningr  rk   r^   r\   r  r  8  s    Mr^   r  c                   "    e Zd ZU eed<   eed<   y)CoolEmployeer:  coolNrh   ri   rj   r   r   r   rk   r^   r\   r  r  <  s    
I
Ir^   r  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)XMethrt  c                      d| j                   z  S rj
  rb  r   s    r\   doublezXMeth.doubleF  s    466zr^   N)rh   ri   rj   r   r   r  rk   r^   r\   r  r  D  s    
Fr^   r  c                   2    e Zd ZU eed<   dZeed<   d Zd Zy)XReprrt  rn   r  c                 8    | j                    d| j                   S )Nz -> rz  r   s    r\   __str__zXRepr.__str__L  s    &&dffX&&r^   c                      yr3  rk   rW   r  s     r\   __add__zXRepr.__add__N  s    r^   N)rh   ri   rj   r   r   r  r  r  rk   r^   r\   r  r  I  s    
FAsJ'r^   r  LabelrB  c                   "    e Zd ZU eed<   eed<   y)Point2Drt  r  Nr>  rk   r^   r\   r  r  S  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  W  s    DDr^   r  c                       e Zd ZU eed<   y)r  r  Nr>  rk   r^   r\   r  r  [  rI  r^   r  Ftotalc                       e Zd ZU eed<   y)
BarGenericr  Nr>  rk   r^   r\   r   r   ^  rI  r^   r   c                       e Zd Zy)LabelPoint2DNr|   rk   r^   r\   r  r  a  r   r^   r  c                   "    e Zd ZU eed<   eed<   y)Options	log_levellog_pathNrF  rk   r^   r\   r  r  c  s    NMr^   r  c                   (    e Zd ZU eed<   ee   ed<   y)
TotalMovietitler;  N)rh   ri   rj   r   r   r7   r   rk   r^   r\   r  r  g  s    J
c
r^   r  c                   (    e Zd ZU ee   ed<   eed<   y)NontotalMovier	  r;  N)rh   ri   rj   r8   r   r   r   rk   r^   r\   r  r  k  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  o  s    C=r^   r  c                       e Zd ZU ee   ed<   y)ChildTotalMovier;  N)rh   ri   rj   r7   r   r   rk   r^   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)ParentDeeplyAnnotatedMovier  another levelr	  N)rh   ri   rj   r@   r8   r   r   rk   r^   r\   r  r  u  s     Yx}h67HIIr^   r  c                   (    e Zd ZU eeedf      ed<   y)ChildDeeplyAnnotatedMovie  r;  N)rh   ri   rj   r7   r@   r   r   rk   r^   r\   r  r  x  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)AnnotatedMovier  r	  r  r;  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)DeeplyAnnotatedMovier  r  r	  r  r;  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]r;  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_aNr  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!  rt  s     r\   g_withr#    s=       Q      s0   :!:%:#::7.7: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.func  s    r^   c                      y rb   rk   r   s    r\   nestedzForRefExample.nested  s     	r^   N)rW   r%  )rh   ri   rj   r  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   rt  r  r  )	r   r   r   rR  r   r   r  r  r  )rW   ann_module_type_hintss     r\   test_get_type_hints_modulesz,GetTypeHintTests.test_get_type_hints_modules  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   rj  r   r   )rW   	mgc_hintss     r\   &test_get_type_hints_modules_forwardrefz7GetTypeHintTests.test_get_type_hints_modules_forwardref  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  r  rz  rt  )r  r  )r  r   some_b)my_inner_a1my_inner_a2
my_outer_a)r   r   r  r  r   r   j_classr  r  r   rk  r   rm  r   h_classr!  r>  r  r  r  rM   r   rj  ri  r   s    r\   test_get_type_hints_classesz,GetTypeHintTests.test_get_type_hints_classes  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   rC  r   r   rk   r^   r\   WithNoneDefaultrB    s    E3r^   rD  rC  )r   r   r   )rW   rD  s     r\   0test_get_type_hints_classes_no_implicit_optionalzAGetTypeHintTests.test_get_type_hints_classes_no_implicit_optional  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\   r7  zKGetTypeHintTests.test_respect_no_type_check.<locals>.NoTpCheck.Inn.__init__  r   r^   N)rt  z
not a typer  rk   r^   r\   InnrJ    s    8r^   rL  N)rh   ri   rj   rL  rk   r^   r\   	NoTpCheckrH    s    9 9r^   rM  c                       e Zd ZdefdZy):GetTypeHintTests.test_respect_no_type_check.<locals>.ABasert  c                      y rb   rk   rb  s    r\   rS  z?GetTypeHintTests.test_respect_no_type_check.<locals>.ABase.meth  r   r^   Nr  rk   r^   r\   ABaserO    s
    !!r^   rQ  c                       e Zd Zy)8GetTypeHintTests.test_respect_no_type_check.<locals>.DerNr|   rk   r^   r\   DerrS    s    r^   rT  rt  )r2   r   rH  rL  r7  r   r   r  NTCrS  r#   r   r   )rW   rM  rQ  rT  s       r\   test_respect_no_type_checkz+GetTypeHintTests.test_respect_no_type_check  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   r+  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   rz  s     r\   testfz6GetTypeHintTests.test_previous_behavior.<locals>.testf  r   r^   r   rt  c                      y rb   rk   rb  s    r\   testgz6GetTypeHintTests.test_previous_behavior.<locals>.testg  r   r^   )rt  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   rb    r   r^   r   c                       e Zd Zy)KGetTypeHintTests.test_get_type_hints_for_object_with_annotations.<locals>.BNr|   rk   r^   r\   rj  rd    r   r^   rj  rt  )r   r   r   r  )rW   r   rj  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  rt  r  )r  r  r  rt  r  )r   r   r  CVr  rc   r$   rj  r  r   r   r  rn  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 )Nrt  ri  c                      y rb   rk   rb  s    r\   r  z>GetTypeHintTests.test_get_type_hints_annotated.<locals>.foobar  r   r^   rn   r5  Tinclude_extrasc                      y rb   rk   rb  s    r\   r  z>GetTypeHintTests.test_get_type_hints_annotated.<locals>.foobar  r   r^   )rn   r   .c                      y rb   rk   rb  s    r\   r  z>GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo&  r   r^   c                      y rb   rk   rb  s    r\   r  z>GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo.  r   r^   r  r  mutablec                      y rb   rk   rz  s     r\   r  z?GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo25  s    DGr^   rz  c                      y rb   rk   rb  s    r\   barfoo3z?GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo3=  r   r^   c                      y rb   rk   rb  s    r\   barfoo4z?GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo4C  r   r^   )r   r@   r   r   r+   r  r  r  rA   r   r   r  rc   r"   r   r   rR  )
rW   r  ri  BAr  r  BA2rx  BA3rz  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 )Nrt  metac                      y rb   rk   rb  s    r\   
with_unionzKGetTypeHintTests.test_get_type_hints_annotated_in_union.<locals>.with_unionN  r   r^   Trp  )r   r  r@   r   r   r+   )rW   r  s     r\   &test_get_type_hints_annotated_in_unionz7GetTypeHintTests.test_get_type_hints_annotated_in_unionM  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>.MySetr  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)r  zConst[MySet[T]]r   r  )rh   ri   rj   r  r  )r  s   r\   MySetr  Z  s     eJ&7 J r^   r  )r  r   Trp  )	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_refsV  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 )Nrt  r  c                      y rb   rk   rb  s    r\   annotated_with_none_defaultzeGetTypeHintTests.test_get_type_hints_annotated_with_none_default.<locals>.annotated_with_none_defaults  r   r^   Trp  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_defaultq  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  rt  N)rh   ri   rj   r   r  r   rk   r^   r\   r  r  ~  s    AFr^   r  rt  )r   r+   r   rx  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\   	BadModuler    r  r^   r  bad)ri   r  sysmodulesr   r+   )rW   r  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>.BadBaser>  N)rh   ri   rj   r  r   rk   r^   r\   BadBaser    s    Jr^   r  c                       e Zd ZU eed<   y)JGetTypeHintTests.test_get_type_hints_annotated_bad_module.<locals>.BadTyper  Nr  rk   r^   r\   BadTyper    s    Ir^   r  r  r  )ri   r  r  r  r   r+   r  r  )rW   r  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+   r  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+   r  r   s    r\   test_top_level_class_varz)GetTypeHintTests.test_top_level_class_var  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	  r;  Trp  r  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  rt  c                      y rb   rk   rb  s    r\   rf   zHGetTypeHintTests.test_get_type_hints_collections_abc_callable.<locals>.f  r   r^   .c                      y rb   rk   rb  s    r\   r  zHGetTypeHintTests.test_get_type_hints_collections_abc_callable.<locals>.g  r   r^   c                      y rb   rk   rb  s    r\   r  zHGetTypeHintTests.test_get_type_hints_collections_abc_callable.<locals>.h  r   r^   )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_callable  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.  r1  r	   r6  r?  rE  rV  rY  r_  re  ri  rl  r~  r  r  r  r  r  r  r  r  r  r  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\   r  r    r   r^   r  r   +   r  r   )r   r   rE   r#   r   r,   r   r$   r   r   r   r%   r   r   r  r@   r  r"   r  r  r  r	  r   r<  r8   r7   r   )rW   r   r  r  r  s        r\   r   z$GetUtilitiesTestCase.test_get_origin  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\   r  r    r   r^   r  rk   r  .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   r  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   r  rk   r^   r\   r  r    s    E>ATr^   r  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_hashableA  *    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   rU  r   r]   r  r   s    r\   test_iterablez!CollectionsAbcTests.test_iterableE  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   r  r   )rW   its     r\   test_iteratorz!CollectionsAbcTests.test_iteratorP  s3    "Xb&//2  V__5r^   c                     i }t        dt               |       |d   } |       }| j                  |t        j                         | j                  |t        j                         |j                  d        y )NzPasync def foo() -> typing.Awaitable[int]:
    return await AwaitableWrapper(42)
r>  )rQ  r  r   rc   	Awaitabler   sendrW   rS  r>  r  s       r\   test_awaitablez"CollectionsAbcTests.test_awaitableU  sd    6Ir	 iEa!1!12  f&6&67	tr^   c                    i }t        dt               |       |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)Nzasync def foo():
    return
r>  )rQ  r  r   rc   	Coroutiner   r   r   r   r   r  StopIterationr  s       r\   test_coroutinez"CollectionsAbcTests.test_coroutinea  s    Ir	 iEa!1!12y) 	1q&**3/0	1  f&6&67	FF4L		1 	1
  		s   "B6$C 6B?	CCc                     t        d      }t        |      }| j                  |t        j                         | j                  |t        j                         | j                  dt        j                         y Nr5  r   )rr   r  r   rc   AsyncIterabler   rW   base_itr  s      r\   test_async_iterablez'CollectionsAbcTests.test_async_iterabler  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 r  )rr   r  r   rc   r  r   r  s      r\   test_async_iteratorz'CollectionsAbcTests.test_async_iteratory  sA    )!'*b&"6"67  V%9%9:r^   c                     | j                  g t        j                         | j                  dt        j                         y r   )r   rc   r  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   r*  rc   r0	  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   r*  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   rX  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_mutablesequence  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	bytearrayr  r  s      r\   test_bytestringz#CollectionsAbcTests.test_bytestring  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    r   r^   r  )r]   r  dequerc   Dequer   r   )rW   r  s     r\   
test_dequezCollectionsAbcTests.test_deque  sE    k//>-fll3'-gi):):;r^   c                 `    | j                  t        j                  t        j                         y rb   )r]   r  Counterrc   r   s    r\   test_counterz CollectionsAbcTests.test_counter  s    k116>>Br^   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rb   )r]   r*  rc   Setr`   r  r   s    r\   test_setzCollectionsAbcTests.test_set  s*    c6::.  FJJ7r^   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rb   )r]   r  rc   r  r`   r*  r   s    r\   test_frozensetz"CollectionsAbcTests.test_frozenset  s.    i)9)9:  f&6&67r^   c                 L    | j                  t        t        j                         y rb   )r]   r  rc   r    r   s    r\   rv  zCollectionsAbcTests.test_dict  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_subscribe  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    r  r^   r  )rc   r   r   r   r	  r]   r  r`   )rW   r  r   s      r\   test_list_subclassz&CollectionsAbcTests.test_list_subclass  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_instantiation  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\   	MyOrdDictr1    r  r^   r2  )rc   r-  r   r   r   r]   r  r`   )rW   r2  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\   CMr7    r   r^   r8  )	r   r   rc   r"	  r  r   r   r   r   )rW   r8  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\   rk  rA  .  r   r^   rk  )r   r   rc   r  r  r  r   r   rW   rk  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\   r  rF  5  r   r^   r  )r   r   rc   r	  r  r   r   r  s     r\   test_counter_instantiationz.CollectionsAbcTests.test_counter_instantiation1  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\   	MyCounterrJ  :  r  r^   rK  )rc   r	  r   r   r  )rW   rK  r  s      r\   #test_counter_subclass_instantiationz7CollectionsAbcTests.test_counter_subclass_instantiation8  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_instantiationB  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  rQ  L  r  r^   r  )rc   r  r   r   )rW   r  r  s      r\   test_set_subclass_instantiationz3CollectionsAbcTests.test_set_subclass_instantiationJ  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   r  r   r   r   s    r\   test_no_frozenset_instantiationz3CollectionsAbcTests.test_no_frozenset_instantiationR  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\   MyFrozenSetrW  \  r  r^   rX  )rc   r  r   r   )rW   rX  r  s      r\   %test_frozenset_subclass_instantiationz9CollectionsAbcTests.test_frozenset_subclass_instantiationZ  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_instantiationb  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\   r>  z/CollectionsAbcTests.test_generator.<locals>.fook  s     H   )r]   r   rc   	Generator)rW   r>  r  s      r\   test_generatorz"CollectionsAbcTests.test_generatorj  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_instantiationp  s    y) 		y) 	(Q1W%'	(y) 	.S#s]+-	. 	.		 		( 	(	. 	.s#   B<'C'C<CCCc                     i }t        dt               |        |d          }| j                  t        |      t        j
                         y )Nzasync def f():
    yield 42
rf   )rQ  r  r]   r   rc   AsyncGenerator)rW   rS  r  s      r\   test_async_generatorz(CollectionsAbcTests.test_async_generatorx  sB     &y"	.BsGI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   rd  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\   MMArj    r  r^   rk  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__  r  r^   c                      y rb   rk   r  s      r\   r-  z=CollectionsAbcTests.test_subclassing.<locals>.MMC.__setitem__  rd  r^   c                      y rb   rk   r  s     r\   r  z=CollectionsAbcTests.test_subclassing.<locals>.MMC.__delitem__  rd  r^   c                     t        d      S r]  r  r   s    r\   r  z:CollectionsAbcTests.test_subclassing.<locals>.MMC.__iter__  r  r^   c                      yr3  rk   r   s    r\   r  z9CollectionsAbcTests.test_subclassing.<locals>.MMC.__len__  r  r^   Nr  rk   r^   r\   MMCrm    r  r^   rs  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__  r  r^   c                      y rb   rk   r  s      r\   r-  z=CollectionsAbcTests.test_subclassing.<locals>.MMB.__setitem__  rd  r^   c                      y rb   rk   r  s     r\   r  z=CollectionsAbcTests.test_subclassing.<locals>.MMB.__delitem__  rd  r^   c                     t        d      S r]  r  r   s    r\   r  z:CollectionsAbcTests.test_subclassing.<locals>.MMB.__iter__  r  r^   c                      yr3  rk   r   s    r\   r  z9CollectionsAbcTests.test_subclassing.<locals>.MMB.__len__  r  r^   Nr  rk   r^   r\   MMBru    r  r^   r{  c                       e Zd Zy)/CollectionsAbcTests.test_subclassing.<locals>.INr|   rk   r^   r\   rp  r}    r   r^   rp  c                       e Zd Zy)/CollectionsAbcTests.test_subclassing.<locals>.GNr|   rk   r^   r\   rn  r    r   r^   rn  c               3      K   d y wr3  rk   rk   r^   r\   r  z/CollectionsAbcTests.test_subclassing.<locals>.g  s
     qr^  )rc   r!   r   r   r   r   r   r	  r  r   rX  r   r   r   r`   r  r]   r  r  rT   rU  r  r_  r   r   )rW   rk  rs  r{  rp  rn  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                 v    G d dt         j                  t        t        f         }i }t        dt	               |       |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   r  s     r\   asendzECollectionsAbcTests.test_subclassing_async_generator.<locals>.G.asend  rd  r^   Nc                      y rb   rk   )rW   typvalr  s       r\   athrowzFCollectionsAbcTests.test_subclassing_async_generator.<locals>.G.athrow  rd  r^   r	  )rh   ri   rj   r  r  rk   r^   r\   rn  r    s    r^   rn  zasync def g(): yield 0r  )rc   rd  r   rQ  r  r]   r  r  r  r`   r   r   r   )rW   rn  rS  r  r]
  s        r\    test_subclassing_async_generatorz4CollectionsAbcTests.test_subclassing_async_generator  s;   	%%c3h/ 	 %wy"5sG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   r  s     r\   r  zPCollectionsAbcTests.test_subclassing_subclasshook.<locals>.Base.__subclasshook__  s    >>U* r^   Nr  rk   r^   r\   r  r    s    ! !r^   r  c                       e Zd Zy)<CollectionsAbcTests.test_subclassing_subclasshook.<locals>.CNr|   rk   r^   r\   r  r    r   r^   r  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   rU  r]   r`   )rW   r  r  r  r  s        r\   test_subclassing_subclasshookz1CollectionsAbcTests.test_subclassing_subclasshook  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   r    r   r^   r   c                       e Zd Zy)8CollectionsAbcTests.test_subclassing_register.<locals>.BNr|   rk   r^   r\   rj  r    r   r^   rj  c                       e Zd Zy)8CollectionsAbcTests.test_subclassing_register.<locals>.CNr|   rk   r^   r\   r  r    r   r^   r  c                       e Zd Zy)8CollectionsAbcTests.test_subclassing_register.<locals>.DNr|   rk   r^   r\   rk  r    r   r^   rk  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!   rX  )rW   r   rj  r  rk  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\   rp  r    r   r^   rp  c                       e Zd Zy)7CollectionsAbcTests.test_collections_as_base.<locals>.ANr|   rk   r^   r\   r   r    r   r^   r   r  c                       e Zd Zy)7CollectionsAbcTests.test_collections_as_base.<locals>.BNr|   rk   r^   r\   rj  r    r   r^   rj  )	r  r  rX  r]   rc   rU  r  r  r  )rW   r  r!  rp  r   rj  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   r  r  r   r  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  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r
  r  r  rv  r  r  r  r  r!  r#  r*  r.  r4  r9  r>  rC  rG  rL  rN  rR  rT  rY  r[  r`  rb  re  rg  r  r  r  r  r  r  rk   r^   r\   r  r  ?  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'0)"1&1$gr^   r  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   r  r   )rW   r  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\   NotACMr  +  r  r^   r  c               3      K   d y wr   rk   rk   r^   r\   r  z8OtherABCTests.test_async_contextmanager.<locals>.manager/  r  r^  r   )r   r  rc   AsyncContextManagerr   r  r  r   r   rn  r   r   r   r   )rW   r  r  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   r  r  rk   r^   r\   r  r    s    <1r^   r  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  A  r   r^   r  c                       e Zd Zy)*TypeTests.test_type_basic.<locals>.ProUserNr|   rk   r^   r\   ProUserr  B  r   r^   r  
user_classr   c                      |        S rb   rk   r  s    r\   new_userz+TypeTests.test_type_basic.<locals>.new_userD  
    <r^   r4   )rW   r  r  r  r  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  r  K  r   r^   r  c                       e Zd Zy).TypeTests.test_type_typevar.<locals>.BasicUserNr|   rk   r^   r\   r  r  L  r   r^   r  c                       e Zd Zy),TypeTests.test_type_typevar.<locals>.ProUserNr|   rk   r^   r\   r  r  M  r   r^   r  rf  rW  r  r   c                      |        S rb   rk   r  s    r\   r  z-TypeTests.test_type_typevar.<locals>.new_userQ  r  r^   )r   r5   )rW   r  r  r  rf  r  s         r\   test_type_typevarzTypeTests.test_type_typevarI  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\   r>  z)TypeTests.test_type_optional.<locals>.fooY  s    ys
r^   )r   r5   BaseExceptionr   KeyboardInterruptassertIsNone)rW   r   r>  s      r\   test_type_optionalzTypeTests.test_type_optionalV  sT    T-()	1 	-0 	 	c"346GH#d)$r^   N)rh   ri   rj   r  r  r  rk   r^   r\   r  r  <  s    	
%r^   r  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_functionsf  s4    __ 	KEWVU3>>	J	Kr^   N)rh   ri   rj   r  r  rk   r^   r\   r  r  c  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.setUpClassl  s1     #.~~c&6&6&DcJr^   c                 
    b | `y rb   )r  r  r  s    r\   tearDownClasszNewTypeTests.tearDownClassr  s     Lr^   c                     | j                  t        d      t               | j                  | j                  d      t               | j                  t        d      dz   d       y )Nr  Joern      )r   r  r   r  r   r   r   s    r\   r  zNewTypeTests.test_basicx  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\   rk  r    r   r^   rk  )r   r   rT   r  r   rB  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\   ru  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  rR  rr   rs   rt   ru   r%  r  r$  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    r  r^   r  )r   r   r   r   r  )rW   r  s     r\   #test_error_message_when_subclassingz0NewTypeTests.test_error_message_when_subclassing  sE    ##II=
 	F 	 	 	s   AAN)rh   ri   rj   r  r  r  r  r   ru  r  r   r  r  r  rk   r^   r\   r  r  k  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    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\   r  zNamedTupleTests.test_basics  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(#  r  r:  r  )r  r   r  r   r:  r  rh   r  r   r  r-  r   r   )rW   tims     r\   test_annotation_usagez%NamedTupleTests.test_annotation_usage  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>.NonDefaultAfterDefaultr  rt  r  N)rh   ri   rj   rt  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_default  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 -> 1r  c                       e Zd ZU eed<   d Zy)DNamedTupleTests.test_annotation_usage_with_methods.<locals>.XMethBadrt  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>.XMethBad2rt  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  rt  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   r1    r  r^   r   c                       e Zd ZU eed<   y4NamedTupleTests.test_multiple_inheritance.<locals>.Xrt  Nr>  rk   r^   r\   ri  r4  
  rF  r^   ri  c                       e Zd ZU eed<   yr3  r>  rk   r^   r\   ri  z4NamedTupleTests.test_multiple_inheritance.<locals>.X  rF  r^   c                       e Zd ZU eed<   yr3  r>  rk   r^   r\   ri  z4NamedTupleTests.test_multiple_inheritance.<locals>.X  rF  r^   c                       e Zd ZU eed<   y)r1  rt  Nr>  rk   r^   r\   r   z4NamedTupleTests.test_multiple_inheritance.<locals>.A  r  r^   c                       e Zd ZU eed<   y)r4  r  NrC  rk   r^   r\   ri  z4NamedTupleTests.test_multiple_inheritance.<locals>.X  rF  r^   )r   r   r6   r  )rW   r   ri  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>.Xrt  Nr  rk   r^   r\   ri  r;        Dr^   ri  c                       e Zd ZU eed<   y)'NamedTupleTests.test_generic.<locals>.Yrt  Nr  rk   r^   r\   rm  r>    r<  r^   rm  r   rk   r  )r6   r#   r   r   r  r  r  rn  r;  ru   ro  rn  r-   r   r   rp  r   rt  r   r   r   )rW   ri  rm  rn  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>.Xrt  Nr  r  s   r\   ri  rD  8  
     Dr^   ri  )r6   r  s    @@r\   z<generic parameters of X>zFNamedTupleTests.test_generic_pep695.<locals>.<generic parameters of X>8  s     	 	: 	r^   r   rk   )rs  r   r   r   rh   r  r  r#   r  r6   rn  r;  ro  r   rn  )rW   ri  r   s      r\   test_generic_pep695z#NamedTupleTests.test_generic_pep6957  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\   GrouprI  G  s    F7Nr^   rK  rk   rn   r   )r6   r   r   rp  ro  rn  r   r   )rW   rK  r   r   s       r\   r	  z*NamedTupleTests.test_non_generic_subscriptD  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   Namert  r  )r6   r   r   r   r  r   r:  rh   r  r   r  r   r   )rW   rM  nicks      r\   test_namedtuple_keyword_usagez-NamedTupleTests.test_namedtuple_keyword_usageR  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   r>  r  )r6   r   r;  r   r  r   rh   r  r  rX   rW   rU  rV  )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\   CNTrZ  j  r  r^   r[  )structrk   )r6   ru   r   r  r   r   r   )rW   r[  r[  r\  s       r\   test_empty_namedtuplez%NamedTupleTests.test_empty_namedtupleg  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)rU  r:  r  )r   r   r6   ri  r   r  r   r   s    r\   test_namedtuple_errorsz&NamedTupleTests.test_namedtuple_errorst  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  r  r  ru   rr   rs   rt   r%  r$  r   r   r   r   )rW   rX   rb  rq   r  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\   SimpleNamedTuplerh    r  r^   ri  c                       e Zd Zy):NamedTupleTests.test_orig_bases.<locals>.GenericNamedTupleNr|   rk   r^   r\   GenericNamedTuplerk    r  r^   rl  CallNamedTuple)r   r6   r#   r   r  )rW   r   ri  rl  rm  s        r\   r  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  r  r  r#  r.  r	  r@  rF  r	  rS  rW  r]  r`  re  r  rk   r^   r\   r	  r	    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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__r*  rW   r  r  s      r\   test_basics_functional_syntaxz,TypedDictTests.test_basics_functional_syntax  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rq  )r  r  r9   r   r   r]   r  rc   r!   r`   r  r  r	  r   r   r   rh   ri   r  r   rr  ru  s      r\   test_basics_keywords_syntaxz*TypedDictTests.test_basics_keywords_syntax  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   rU  	_typenamerV  r  r   r>  5   r  r  rX   rW   rU  r{  rV  r  )r  r  r9   r   r;  r   r   r  r  r   rh   r   r  r*  )rW   rz  r   s      r\   $test_typeddict_special_keyword_namesz3TypedDictTests.test_typeddict_special_keyword_names  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   ri  r   r   r   s    r\   test_typeddict_create_errorsz+TypedDictTests.test_typeddict_create_errors  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   Hirt  r  )
r9   r   r   r   ri   r   r   r   rT   r  ru  s      r\   test_typeddict_errorsz$TypedDictTests.test_typeddict_errors  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  ru  Tr   rn   rz  rt  r  hirB  )r   r  rh   ri   r   r   r   r  r  rr  r`   rc   r	  r  )rW   
not_originr  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  rb  rc  rn   )
r9   r   r   r  rr   rs   rt   r%  r$  r   )rW   rb  rq   r  rd  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      @r
  rn   )r  rr   rs   rt   r%  r$  r   )rW   pointrq   r  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 )Nrk  rt  Fr  rn   rb  r   )r  r  r  )	r9   r   r   rr  rs  r  r   rt  r  rB  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>.Point2Dor3Dr  Nr>  rk   r^   r\   Point2Dor3Dr  )  r  r^   r  Fr  rt  r  r  )r  r   rs  r  r   rt  )rW   r  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:  NrC  rk   r^   r\   
BaseAnimalr  2  r'  r^   r  c                   "    e Zd ZU eed<   eed<   y)4TypedDictTests.test_keys_inheritance.<locals>.AnimalvoicerF  N)rh   ri   rj   r   r   r  rk   r^   r\   Animalr  5  s    JJr^   r  Fr  c                       e Zd ZU eed<   y)1TypedDictTests.test_keys_inheritance.<locals>.Cat	fur_colorNrC  rk   r^   r\   Catr  9  s    Nr^   r  r:  rF  r  )r:  rF  r  r  )r  r:  rF  r  )r9   r   rs  r  rt  r   r   r  )rW   r  r  r  s       r\   test_keys_inheritancez$TypedDictTests.test_keys_inheritance1  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                    | 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	  r;  r   )r   r  rs  r  rt  r  rN   r  r  r  r  r  r   s    r\   test_required_notrequired_keysz-TypedDictTests.test_required_notrequired_keysQ  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>.Oner  Nr>  rk   r^   r\   Oner  v      Hr^   r  c                       e Zd ZU eed<   y)5TypedDictTests.test_multiple_inheritance.<locals>.TwotwoNrC  rk   r^   r\   Twor  x  r  r^   r  c                       e Zd ZU eed<   y)9TypedDictTests.test_multiple_inheritance.<locals>.UntotaluntotalNrC  rk   r^   r\   Untotalr  z  s    Lr^   r  Fr  Inlineinlinec                       e Zd Zy)9TypedDictTests.test_multiple_inheritance.<locals>.RegularNr|   rk   r^   r\   Regularr  }  r  r^   r  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\   rm
  r        Kr^   rm
  )r  r  r  c                       e Zd ZU eed<   y)CTypedDictTests.test_multiple_inheritance.<locals>.ChildWithOptionalr  Nr  rk   r^   r\   ChildWithOptionalr    r  r^   r  r  r  r  )r  r  r  c                       e Zd ZU eed<   y)ETypedDictTests.test_multiple_inheritance.<locals>.ChildWithTotalFalser  Nr  rk   r^   r\   ChildWithTotalFalser    r  r^   r  c                       e Zd ZU eed<   y)LTypedDictTests.test_multiple_inheritance.<locals>.ChildWithInlineAndOptionalr  Nr  rk   r^   r\   ChildWithInlineAndOptionalr    r  r^   r  )r  r  r  )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    r	  r^   r  )r9   r  r   rs  r  rt  r   r   r   ru   r   r   )rW   r  r  r  r  r  rm
  r  r  r  wrong_basesr  r  s                r\   r	  z(TypedDictTests.test_multiple_inheritanceu  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   Nr  r  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\   rG  r    rE  r^   rG  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   rG  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 )Nr
  )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 )Nr
  c                       e Zd ZU eed<   y)ATypedDictTests.test_get_type_hints_generic.<locals>.FooBarGenericr  NrC  rk   r^   r\   FooBarGenericr    r  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    rE  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   )rs  r   r   r   rh   r  r#   r  r  r9   rn  r;  ro  r   rn  )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\   rj  r        Er^   rj  Fr  r  r   c                       e Zd ZU eed<   y)2TypedDictTests.test_generic_inheritance.<locals>.Cr  Nr>  rk   r^   r\   r  r  +  r  r^   r  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>.Point3DS  s    r^   )r9   r#   r   r   r  r  r  rn  r;  ro  r   rn  r   rr  rt  r  rs  rp  r   r   r   r   r  )rW   r   r  rj  r  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  W  r<  r^   r   c                       e Zd ZU eed<   y)7TypedDictTests.test_implicit_any_inheritance.<locals>.Br  Nr  rk   r^   r\   rj  r  Z  r  r^   rj  Fr  c                       e Zd ZU eed<   y)ETypedDictTests.test_implicit_any_inheritance.<locals>.WithImplicitAnyr  Nr>  rk   r^   r\   WithImplicitAnyr  ]  r  r^   r  rk   Tr  r   r  r  )r9   r#   r   r   r   r  r  rn  r;  ro  rr  rt  r  rs  r   r   r   r   r   )rW   r   rj  r  s       r\   test_implicit_any_inheritancez,TypedDictTests.test_implicit_any_inheritanceV  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\   rz  r  r  r<  r^   rz  rk   rn   r  r   )	r9   r   r   rp  ro  rn  r   r   r  )rW   rz  r   r   s       r\   r	  z)TypedDictTests.test_non_generic_subscripto  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    r  r^   r  c                       e Zd Zy)-TypedDictTests.test_orig_bases.<locals>.ChildNr|   rk   r^   r\   rm
  r    r  r^   rm
  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    r  r^   r  c                       e Zd Zy)4TypedDictTests.test_orig_bases.<locals>.GenericChildNr|   rk   r^   r\   GenericChildr    r  r^   r  c                       e Zd Zy)9TypedDictTests.test_orig_bases.<locals>.OtherGenericChildNr|   rk   r^   r\   OtherGenericChildr    r  r^   r  c                       e Zd Zy)9TypedDictTests.test_orig_bases.<locals>.MixedGenericChildNr|   rk   r^   r\   MixedGenericChildr    r  r^   r  c                       e Zd Zy)<TypedDictTests.test_orig_bases.<locals>.MultipleGenericBasesNr|   rk   r^   r\   MultipleGenericBasesr    r  r^   r  CallTypedDict)r   r9   r#   r   r   rR  r   r  )rW   r   r  rm
  r  r
  r  r  r  r  r  r  s               r\   r  zTypedDictTests.test_orig_bases|  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   rv  rx  r}  r  r  r  r  r  r[  r  r  r  r  r	  r  r   r  r  r  r  r	  r  rk   r^   r\   ro  ro    s}    @&. 591/H	MCO H@".HUn62

2M^!2&)Er^   ro  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\   r  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_repr  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\   r  r$    r   r^   r  c                       e Zd Zyr#  r|   rk   r^   r\   r  z-RequiredTests.test_cannot_subclass.<locals>.C  r   r^   z Cannot subclass typing\.Requiredc                       e Zd Zyr#  r|   rk   r^   r\   r  z-RequiredTests.test_cannot_subclass.<locals>.C  r   r^   z'Cannot subclass typing\.Required\[int\]c                       e Zd Zyr#  r|   rk   r^   r\   r  z-RequiredTests.test_cannot_subclass.<locals>.C  r   r^   )r   r   r   r   r8   r   r  s     r\   r   z"RequiredTests.test_cannot_subclass  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\   r"  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r$  )r   r   r   r8   r   rT   r   s    r\   r%  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\   r  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\   r  r1    r   r^   r  c                       e Zd Zyr0  r|   rk   r^   r\   r  z0NotRequiredTests.test_cannot_subclass.<locals>.C  r   r^   z#Cannot subclass typing\.NotRequiredc                       e Zd Zyr0  r|   rk   r^   r\   r  z0NotRequiredTests.test_cannot_subclass.<locals>.C  r   r^   z*Cannot subclass typing\.NotRequired\[int\]c                       e Zd Zyr0  r|   rk   r^   r\   r  z0NotRequiredTests.test_cannot_subclass.<locals>.C  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\   r"  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r$  )r   r   r   r7   r   rT   r   s    r\   r%  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\   r
  zIOTests.test_io.<locals>.stuff      ::<r^   )r;   r   r   r   ro  rW   r
  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\   r
  z"IOTests.test_textio.<locals>.stuff  r=  r^   rk   )r<   r   r   r   ro  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\   r
  z$IOTests.test_binaryio.<locals>.stuff  r=  r^   rk   )r=   rx  r   r   ro  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   r*  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?  rB  rE  rP  rk   r^   r\   r8  r8    s    6//	(r^   r8  c                   0    e 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   compilerp  r]   r  r>   r   r   searchr?   r   r   rx  )rW   r  mats      r\   r  zRETests.test_basics1  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   rx  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   rx  r   r   r   r>   rT   )rW   r  s     r\   r   zRETests.test_errorsF  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   rx  r?   r   s    r\   r   zRETests.test_reprQ  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)NTrG  r.  rI  r   )r?   r>   r(	  rh   r?   r>   z	typing.rern   )rK  rL  rM  r  	typing.rer?   r>   r(	  rh   r   rc   r   r*  r   )rW   rO  r?   r>   r(	  rh   s         r\   test_re_submodulezRETests.test_re_submoduleY  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                    | 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   ra  h  r   r^   r   z1type 're\.Pattern' is not an acceptable base typec                       e Zd Zyr`  r|   rk   r^   r\   r   z'RETests.test_cannot_subclass.<locals>.An  r   r^   )r   r   rc   r?   r>   r   s     r\   r   zRETests.test_cannot_subclassc  s{    ##>
 	FLL 		 ##@
 	FNN 		 		 		 	s   A2A>2A;>BN)	rh   ri   rj   r  rX  r   r   r]  r   rk   r^   r\   rR  rR  .  s!    !/	5D(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)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_newt  s2    ##3
 	 K		 	 	s   +4c                     | j                  t        t        t        ddf         d       | j                  t        t        t        t           ddf         d       y )Nr  r  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)Nr  )rn  ro  rp  __metadata__r(  )r*  r+  r@   r   ru   r,  r-  s      r\   r/  zAnnotatedTests.test_dir  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 )Nr  r  r  )r@   r   r   rj  rp  r   s     r\   r  zAnnotatedTests.test_flatten  s]    iQ'*+Ic1ai010s+r^   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)rm  )
r@   r   r   r   r   rj  rp  r   r   rR  )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           	      B   | 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       y )Nr  r  rn   )r   r   r@   r   r   r   r   r   s    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	
r^   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>.Cr  c                     || _         y rb   rb  r  s     r\   r7  z3AnnotatedTests.test_instantiate.<locals>.C.__init__  r  r^   c                 Z    t        |      st        S |j                  | j                  k(  S rb   )r   NotImplementedrt  )rW   r  r  s     r\   __eq__z1AnnotatedTests.test_instantiate.<locals>.C.__eq__  s&    !%+))ww$&&((r^   N)rh   ri   rj   classvarr7  rx  r4  s   r\   r  rt    s    H)r^   r  a decorationr  )r@   r   rt  ry  )rW   r   r   r  r  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 )Nrm  )r  r  r  r   rn   r  )r@   rc   r	  r   r   r   )rW   MyCounts     r\   test_instantiate_genericz'AnnotatedTests.test_instantiate_generic  sR    FNN1->?+q\:i0aA,?r^   c                 z    t         d   }| j                  t              5   |d       d d d        y # 1 sw Y   y xY w)N)r   r  r  r  )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)Nr  r  )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)r  rg  )r   r  r@   r   rt  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>.Cr  N)rh   ri   rj   ry  rk   r^   r\   r  r    s    Hr^   r  rz  r  r  )r@   r   ry  rt  )rW   r  r   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>.Cr  rz  ry  r  r  N)
rh   ri   rj   ry  r@   r$   r   r   r  r%   rk   r^   r\   r  r    s2    ABHi~ =>B45E9U3Z015r^   r  ry  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\   r  r    r   r^   r  rf  r  s     r\   r   z#AnnotatedTests.test_cannot_subclass  s4    ##I/LM 	I 	 	 	r  c                     | j                  t              5  t        dt        t        df          d d d        y # 1 sw Y   y xY w)Nr  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)Nr  )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   Nr  rk   r^   r\   r  r     r  r^   r  zA decorationr   r  )rc   r   r   r   r   r   r   r"   rx  r@   rr   rs   rt   ru   r%  r$  r   r#   r   r  r>  r  rt  )
rW   r  r2  rt  protr  restoredrn  rq   r  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)Nrz  zanother decoration)r@   r   r   r   r   r   r   rc   r    r   r   r   )rW   r)  dec2r!  r  rk  Itrn  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)
Nrz  r  r   r  r  rk   r  r  T4)r   r   r@   r  r   r   r   r   r   r   r   rR  r  )rW   r)  r  r   r  r  r   rj  r  rk  rl  rm  rn  ro  r  r  r  rp  r  rt  r  s                        r\   test_typevar_substz!AnnotatedTests.test_typevar_subst,   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 )Nr  )r   r@   r   r   r   rj  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\   ri  r     r   r^   ri  ro  z Annotated should be transparent.)r@   r   r   rn  r;  rj  s     r\   test_annotated_mroz!AnnotatedTests.test_annotated_mro   s3    -	#w,'-QV$4;	=r^   N)rh   ri   rj   rg  r   r/  r  ro  rq  r{  r~  r  r  r  r  r  r   r  r  r  r  r  r  r  r  rk   r^   r\   rd  rd  r  st    
8,	
1&@


#!L
68%<:pd:=r^   rd  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	 	 	r7  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\   r%  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   Nr  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\   r  r     r   r^   r  c                       e Zd Zyr  r|   rk   r^   r\   r  z.TypeAliasTests.test_cannot_subclass.<locals>.C   r   r^   )r   r   rD   r   r   r  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   r%  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   r  s     r\   rO  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  )rQ  r   rE   r   rh   r   ri   )rW   rS  r  s      r\   rT  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   rn  ro  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,  r+  r   r   rG   r<  rH   r   rp  r   r   r   )rW   r  r  s      r\   test_args_kwargszParamSpecTests.test_args_kwargs   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\   r>  z-ParamSpecTests.test_stringized.<locals>.C.foo!  rd  r^   N)r   r  r<  r  )rh   ri   rj   r"   r   r   r>  rk   r^   r\   r  r  !  s    38$$r^   r  r
  r  )rE   r#   r   r   r  r  r"   r   r>  r   r<  r  s      r\   test_stringizedzParamSpecTests.test_stringized
!  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   rt  Nrh   ri   rj   r"   r   r   )r  r   s   r\   ri  r  !  s    3Dr^   ri  r  r  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  2!  s    3r^   r[  )r   rE   r#   r   r   rn  ro  r   r   r   rF   r  r  rp  )rW   r  ri  rf  ri  G3G4r[  G5G6G7r  r   s              @@r\   test_user_genericsz!ParamSpecTests.test_user_generics!  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  r  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  r  s   r\   ri  r  P!  s!    3C  r^   ri  )rE   r#   r   r   rx  r   r   rn  )rW   ri  rf  ri  r  r  s       @@r\   )test_multiple_paramspecs_in_user_genericsz8ParamSpecTests.test_multiple_paramspecs_in_user_genericsL!  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\   ri  r  ^!      3SbSzMr^   ri  )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\   rm  r  m!  r  r^   rm  )
r   rE   r#   r   rx  r   rn  r   r   r   )	rW   ri  rf  ri  r  r  rm  r  r  s	          @@r\   1test_typevartuple_and_paramspecs_in_user_genericsz@ParamSpecTests.test_typevartuple_and_paramspecs_in_user_genericsZ!  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\   ri  r  !  r  r^   ri  c                       e Zd Zy)MParamSpecTests.test_typevartuple_and_paramspecs_in_generic_aliases.<locals>.YNr|   rk   r^   r\   rm  r  !  r  r^   rm  )rE   r   r   r"   r  r  ru   r   r   r   rx  rR  r   rn  r#   )	rW   r  r   r  r  r   rj  ri  rm  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  r  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  "  r  r^   r  )r   rE   r   r#   r   ro  rn  r   r   r  r  r   rR  rx  )rW   r   r  r  r  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   ro  r   rR  )rW   r   r  r  rf  ri  r  r  s           r\   !test_paramspec_in_nested_genericsz0ParamSpecTests.test_paramspec_in_nested_generics%"  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  r  rk   .)rE   r"   r   r   ro  r   r   rF   )rW   r  r  r  r  s        r\   test_paramspec_gets_copiedz)ParamSpecTests.test_paramspec_gets_copied7"  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\   r  r  N"  r   r^   r  rG   c                       e Zd Zyr  r|   rk   r^   r\   r  z.ParamSpecTests.test_cannot_subclass.<locals>.CP"  r   r^   rH   c                       e Zd Zyr  r|   rk   r^   r\   r  z.ParamSpecTests.test_cannot_subclass.<locals>.CR"  r   r^   r  c                       e Zd Zyr  r|   rk   r^   r\   r  z.ParamSpecTests.test_cannot_subclass.<locals>.CV"  r   r^   c                       e Zd Zyr  r|   rk   r^   r\   r  z.ParamSpecTests.test_cannot_subclass.<locals>.CY"  r   r^   c                       e Zd Zyr  r|   rk   r^   r\   r  z.ParamSpecTests.test_cannot_subclass.<locals>.C\"  r   r^   )	r   r   r  rE   rG   rH   r  r   r<  )rW   r  r  s      r\   r   z#ParamSpecTests.test_cannot_subclassL"  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   rO  rT  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!  b"  r   r^   r  )rE   rF   r   )rW   r  r  r  s       r\   r  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  r'  r(  )rE   r*  r+  rF   r   ru   r,  )rW   r  r.  r)  s       r\   r/  zConcatenateTests.test_dirf"  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   rn  ro  r  r  r  s          r\   r  z ConcatenateTests.test_valid_useso"  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  r  .)r   rE   rF   r   r   r   rR  )rW   r   r  r  r  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   r  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\   r>  z'TypeGuardTests.test_basics.<locals>.foo"  r   r^   )rI   r   r   r   r   r   r   r
  s     r\   r  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\   r  r-  "  r   r^   r  c                       e Zd Zyr,  r|   rk   r^   r\   r  z.TypeGuardTests.test_cannot_subclass.<locals>.C"  r   r^   z!Cannot subclass typing\.TypeGuardc                       e Zd Zyr,  r|   rk   r^   r\   r  z.TypeGuardTests.test_cannot_subclass.<locals>.C"  r   r^   z(Cannot subclass typing\.TypeGuard\[int\]c                       e Zd Zyr,  r|   rk   r^   r\   r  z.TypeGuardTests.test_cannot_subclass.<locals>.C"  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\   r"  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r$  )r   r   r   rI   r   rT   r   s    r\   r%  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)>Nr0	  r  rd  r  r  r  r  r"   r"	  r  r	  r  r  r	  r!	  r  r    r  r_  r  	ItemsViewrU  r  KeysViewr   rX  MappingViewr!   r  r  r-  r  r	  r  r  r   r5   
ValuesView.r@   r   r$   rF   r%   rA   r   r  r   r   r   rD   rI   r   r   rB   
Annotationr  r  r  rc   rn   )Grc   r0	  r  rd  r  r  r  r  r"   r"	  r  r	  r  r  r	  r!	  r  r    r  r_  r  r8  rU  r  r9  r   rX  r:  r!   r  r  r-  r  r	  r  r  r   r5   r;  r   r@   r$   rF   r%   rA   r   r  r   r   r   rD   rI   r   r   rB   r   r3  rR  r  ru   r   rh   r   rj   ri   rr   rs   rt   r%  r$  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>  r4  r3  )rc   rA   r   r  r   ri   rr   rs   rt   r   r   r%  r6  r@  rh   rj   r$  r   r4  r3  )rW   r
  rq   r  r  s        r\   test_special_attrs2z%SpecialAttrsTests.test_special_attrs2M#  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#  rd  r^   r  r  N)rh   ri   rj   r  r  	__magic__rk   r^   r\   r  rD  #  s    CIr^   r  )r  r  rn  ro  rp  r(  rF  )r#   r   r*  r+  r   ru   r,  r  )rW   r  r.  r)  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@  rA  rG  rk   r^   r\   r6  r6  "  s)    |/| v~~:C@H01d1r^   r6  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;  rK   r   r0   r   getvalue)rW   r  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   rM  rk   r^   r\   rI  rI  #  s    Jr^   rI  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_onlyrR  rS  c                     d S )Nc                     | S rb   rk   r  s    r\   r  zNDataclassTransformTests.test_decorator.<locals>.create_model.<locals>.<lambda>#  s    s r^   rk   rQ  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\   CustomerModelrZ  #      Gr^   r[  rk   
eq_defaultrX  rW  frozen_defaultfield_specifiersr<  )r  r1   r   r   __dataclass_transform__)rW   rV  	decoratedr[  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rR  rR  c                     y rb   rk   )rX   rR  s     r\   rU  zLDataclassTransformTests.test_base_class.<locals>.ModelBase.__init_subclass__#  r   r^   N)rh   ri   rj   r  rU  rk   r^   r\   	ModelBaserf  #  s    9>D$Dr^   ri  T)r^  rX  make_everything_awesomec                       e Zd ZU eed<   y)>DataclassTransformTests.test_base_class.<locals>.CustomerModelr  Nr>  rk   r^   r\   r[  rl  #  r\  r^   r[  rg  Frk   rj  r]  )r1   r   r   ra  r]   )rW   ri  	Decoratedr[  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\   Fieldrq  #  r   r^   rr  c                   *     e Zd Zdddef fdZ xZS )9DataclassTransformTests.test_metaclass.<locals>.ModelMetaTinitrv  c                (    t         |   | |||      S rb   )rh  ri  )rX   r:  r  	namespacerv  r  s        r\   ri  zADataclassTransformTests.test_metaclass.<locals>.ModelMeta.__new__#  s     wsD%CCr^   )rh   ri   rj   r  ri  rk  rl  s   @r\   	ModelMetart  #  s    =AD6:D Dr^   ry  T)rX  r_  r`  c                       e Zd Zy)9DataclassTransformTests.test_metaclass.<locals>.ModelBaseNr|   rk   r^   r\   ri  r{  #  r   r^   ri  r  c                       e Zd ZU eed<   y)=DataclassTransformTests.test_metaclass.<locals>.CustomerModelr  Nr>  rk   r^   r\   r[  r}  #  r\  r^   r[  Fru  r]  )r   r1   r   r   ra  r   )rW   rr  ry  rm  ri  r[  s         r\   test_metaclassz&DataclassTransformTests.test_metaclass#  s    	D 	D
'tuh

	 	2)1	IE 	 	i+--"!%#("&%*H
	
 	mY7r^   N)rh   ri   rj   rc  rn  r~  rk   r^   r\   rO  rO  #  s    
4888r^   rO  c                       e Zd Z	 d Zd Zy)AllTestsc                    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(	  r0	  r;  r)   r   r  r  ior   osr  Textr  r  )rc   r(	  r,  r  r	  s     r\   test_allzAllTests.test_all#  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 )Nr  >   r  r   )r  _contra_cori   )r*  rc   r(	  r  r  r  rC  upperr&	  rh   assertSetEqual)rW   
actual_allr  rI  computed_alls        r\   test_all_exported_namesz AllTests.test_all_exported_names$  s    (
v,,,.
!QJLL%%JJ9:GGIN<.&//A 
 
 	L*5
s   A'B7N)rh   ri   rj   r  r  rk   r^   r\   r  r  #  s    ,,6r^   r  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_typer  s       r\   test_cannot_iteratez&TypeIterationTests.test_cannot_iterate-$  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  rU  )rW   type_to_tests     r\    test_is_not_instance_of_iterablez3TypeIterationTests.test_is_not_instance_of_iterable9$  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  __main__)r  r  collections.abcr   r
  r   r   rs  rA
  r  rs   r   r  rK  unittestr   r   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   rL   rX  rM   rN   r   r  r  rP   ry   r{   r   r   r   r   r   r   r   r   r   r/  rG  r  r   r  r  r  r  r  r"  rA  r!  r5  rz  r  r  r  r  rx  r"  r#  r%  r3  r=  rA  rE  rH  rK  rM  rO  rU  rW  r[  r]  r_  r>  r	  r
  r
  rF
  r
  r
  r
  r
  r
  r
  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   rj  r  rn  r  r  r  r  r  r  r  r  r  r  r  
FooGenericr   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	  ro  r  r+  r8  rR  rd  r  r  r  r&  r3  rR  r  r4  r6  rI  rO  r  r  rh   rk   r^   r\   <module>r     s      # & 	    	 
  5 5   5 5 ; ; 8 8   + + 4 4  < < 7 7 ! '    & 9  ? ? ' ' ! ( &  I I  
     E E # # @ C> 8 *		 		h 		h 		gw 	/| /d&% &%R-(, -(8%| 8 
| 
&65 65r5> 5>n~< ~BA,S	 A,c49n9M A,RVW\]`WaRb A,H+| +B@L @H#=, #=JB< B<J.$ .$b|G |G~)' )'Xd dL		?+\ 	?(0, (x=< x=v T3T]	GBFO 	mBF+ $  J   
H H  	ueX 	 	 H  
	u 	   h  v?L v?r/T< Tn+&L +&Z0# 0#fG6, G6T}9\ }9@ $6l 6" 0 0 0 < < <R1l R1j   YCL YC| P O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]g, ]g@1L 1:$% $%NK( KR< RjbGl bGJ@E\ @EF-&L -&`-)| -)`#(l #(LAl AHs=\ s=l	*\ *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 Ye    s   0\ \#\#