
    7bhT]                       d dl Z d dlZd dlZd dlmZ d dlmZmZmZ d dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlZd dlZd dlmZmZmZ d dlmZ d dlmZmZ d dlmZmZmZmZ d dlmZmZmZ d d	lm Z m!Z!m"Z"m#Z# d d
lm$Z$m%Z%m&Z& d dlm'Z'm(Z(m)Z) d dlm*Z*m+Z+m,Z,m-Z- d dlm.Z. d dlm/Z/m0Z0m1Z1m2Z2m3Z3 d dlm4Z4m5Z5m6Z6 d dlm7Z7 d dlm8Z8m9Z9 d dlm:Z: d dlm;Z; d dlm<Z< d dlm=Z= d dlm>Z>m?Z? d dlm@Z@ d dlmAZAmBZBmCZCmDZD d dlmEZEmFZFmGZG d dlmHZHmIZI d dlmJZJmKZK d dlmLZLmMZM d dlmNZN d dlmOZOmPZPmQZQmRZR d dlmSZS d dlTZTd dlUZUd dlZd dlVZVd dlWZWd d lXmYZYmZZZ d d!l[m\Z\ d d"l]m^Z^m_Z_m`Z` d#Zad$Zbd%Zc G d& d'ee\      Zdd( Ze G d) d*      Zf G d+ d,ef      Zg G d- d.ef      Zh G d/ d0egeh      Zi G d1 d2ed      Zj G d3 d4      Zk G d5 d6eked      Zl G d7 d8eked      Zm G d9 d:ed      Zn G d; d<ed      Zo G d= d>ed      Zp G d? d@ed      ZqdAeres   dBeteseres   f   dCereues      fdDZv G dE dFed      Zw G dG dHed      Zx G dI dJed      Zy G dK dLed      Zz G dM dNed      Z{ G dO dPed      Z| G dQ dRed      Z} G dS dT      Z~ G dU dVe~ed      Z G dW dXe~ed      Z G dY dZed      Z e d[ese      Z e d\      Z G d] d^e/eef         Z G d_ d`eeef         Z G da dbe3      Ze6 G dc ddee3             Z G de df      Z G dg dhe3      Z G di dje3      Ze6 G dk dleee3             Ze6 G dm dne3             Z G do dpe      Z G dq dr      Z G ds dteA      Ze6 G du dve3             Z G dw dxed      Z G dy dzed      Z G d{ d|ed      Z G d} d~ed      Z G d ded      Z G d ded      Z G d ded      Z G d ded      Zd dl]mZ e> G d d             Ze> G d d             Z G d ded      Z e       d        Z G d d      Z G d ded      Zd dl]mZmZmZmZmZ  e d      Z G d dejN                  e         Z G d dejR                  e         Z G d d      Z G d d      Z G d de      Z G d de      Z G d de/e$         Z G d d      Z G d d      Z G d deA      Z G d deA      Z G d deA      Z G d deA      Z eDddesfg      Z G d deD      Z G d de/e$   eD      Z G d de`jr                  d      Z G d de`jv                  e$   d      Z G d dee      Z G d deDd      Z G d deD      Z G d deDd      Z G dÄ deDd      Z G dń de      Z G dǄ deD      Z G dɄ deë      Z G d˄ deD      Z G d̈́ deD      Z G dτ deD      Z G dф de_jX                        Zdej                  e   fdԄZ	  e e             j                  d       e7Z G dք d׫      Z G d؄ ded      Z G dڄ de      Z G d܄ ded      Z G dބ ded      Z G d ded      Z G d de      Z G d ded      Z G d ded      Z G d ded      Z G d ded      Z G d ded      Z G d ded      Z G d ded      Z G d ded      Z G d ded      Z G d ded      Z G d ded      Z G d ded      Z ej                  d      Z ej@                  deee      Z G d ded      Z G d  ded      Z G d ded      Z G d ded      Z G d ded      Zd Zed	k(  r e        yy# e$ r Zeΐj                  d    dk(  sJ Y dZ[ΐkdZ[ww xY w(
      N)defaultdict)	lru_cachewrapsreduce)TestCasemainskip)patch)copydeepcopy)AnyNoReturnNeverassert_never)overloadget_overloadsclear_overloads)TypeVarTypeVarTupleUnpackAnyStr)TKTVT)UnionOptionalLiteral)TupleListDictMutableMapping)Callable)GenericClassVarFinalfinalProtocol)assert_typecastruntime_checkable)get_type_hints)
get_originget_args)override)is_typeddict)reveal_type)dataclass_transform)no_type_checkno_type_check_decoratorType)
NamedTupleNotRequiredRequired	TypedDictIOTextIOBinaryIO)PatternMatch)	Annotated
ForwardRef)SelfLiteralString)	TypeAlias)	ParamSpecConcatenateParamSpecArgsParamSpecKwargs)	TypeGuard)captured_stderrcpython_only)ExtraAssertions)ann_module695mod_generics_cache_typed_dict_helperz&Cannot subclass special typing classesz/type 'typing.%s' is not an acceptable base typez!Cannot subclass an instance of %sc                       e Zd Zd Zy)BaseTestCasec                 <    t         j                  D ]	  } |         y N)typing	_cleanupsselffs     :/opt/python-3.12.12/usr/lib/python3.12/test/test_typing.pyclear_cacheszBaseTestCase.clear_caches=   s    !!AC "    N)__name__
__module____qualname__rZ    r[   rY   rQ   rQ   ;   s    r[   rQ   c                 .     t                fd       }|S )z:Runs `test_func` with various values for `proto` argument.c                     t        t        j                  dz         D ]'  }| j                  |      5   | |       d d d        ) y # 1 sw Y   4xY w)N   )pickle_protoproto)rangepickleHIGHEST_PROTOCOLsubTest)rW   re   	test_funcs     rY   wrapperz%all_pickle_protocols.<locals>.wrapperE   sD    622Q67E51$e, 21 811s   A		A	r   )rj   rk   s   ` rY   all_pickle_protocolsrm   B   s#     9- -
 Nr[   c                       e Zd Zy)EmployeeNr\   r]   r^   r_   r[   rY   ro   ro   N       r[   ro   c                       e Zd Zy)ManagerNrp   r_   r[   rY   rs   rs   R   rq   r[   rs   c                       e Zd Zy)FounderNrp   r_   r[   rY   ru   ru   V   rq   r[   ru   c                       e Zd Zy)ManagingFounderNrp   r_   r[   rY   rw   rw   Z   rq   r[   rw   c                   <    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
y	)
AnyTestsc                 x    | j                  t              5  t        dt               d d d        y # 1 sw Y   y xY wN*   )assertRaises	TypeError
isinstancer   rW   s    rY   test_any_instance_type_errorz%AnyTests.test_any_instance_type_error`   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>.SubNrp   r_   r[   rY   Subr   g       r[   r   <class 'z".AnyTests.test_repr.<locals>.Sub'>)assertEqualreprr   r\   rW   r   s     rY   	test_reprzAnyTests.test_reprd   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~   r   r   intr   s    rY   test_errorszAnyTests.test_errorsm   sL    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                  t        ||             | j                  t        ||             | j                  t        ||              |       }| j                  ||       | j                  ||       | j                  ||       y )Nc                       e Zd Zy)(AnyTests.test_can_subclass.<locals>.MockNrp   r_   r[   rY   Mockr   t   r   r[   r   c                       e Zd Zy)-AnyTests.test_can_subclass.<locals>.SomethingNrp   r_   r[   rY   	Somethingr   x   r   r[   r   c                       e Zd Zy)1AnyTests.test_can_subclass.<locals>.MockSomethingNrp   r_   r[   rY   MockSomethingr   |   r   r[   r   )r   
assertTrue
issubclassassertIsInstanceassertFalseassertNotIsInstance)rW   r   r   r   mss        rY   test_can_subclasszAnyTests.test_can_subclasss   s    3
4-.dfd+Is34  d32It2
=#67
=-@A
=)<=
=$78_b-0b),b$'r[   c                 6     G d dt               } |dd       y )Nc                       e Zd Zd Zy)>AnyTests.test_subclassing_with_custom_constructor.<locals>.Subc                      y rS   r_   rW   argskwargss      rY   __init__zGAnyTests.test_subclassing_with_custom_constructor.<locals>.Sub.__init__   s    r[   Nr\   r]   r^   r   r_   r[   rY   r   r      s    5r[   r   r    )s)r   r   s     rY   (test_subclassing_with_custom_constructorz1AnyTests.test_subclassing_with_custom_constructor   s    	6# 	6 	Ar[   c                      G d d      } G d dt         |      } |dd      }| j                  |j                  d       | j                  |j                  d       y )Nc                       e Zd Zd Zy)HAnyTests.test_multiple_inheritance_with_custom_constructors.<locals>.Fooc                     || _         y rS   xrW   r   s     rY   r   zQAnyTests.test_multiple_inheritance_with_custom_constructors.<locals>.Foo.__init__   	    r[   Nr   r_   r[   rY   Foor          r[   r   c                        e Zd Z fdZ xZS )HAnyTests.test_multiple_inheritance_with_custom_constructors.<locals>.Barc                 2    || _         t        | 	  |       y rS   )ysuperr   )rW   r   r   	__class__s      rY   r   zQAnyTests.test_multiple_inheritance_with_custom_constructors.<locals>.Bar.__init__   s     #r[   r\   r]   r^   r   __classcell__r   s   @rY   Barr      s    $ $r[   r   rb      )r   r   r   r   )rW   r   r   bs       rY   2test_multiple_inheritance_with_custom_constructorsz;AnyTests.test_multiple_inheritance_with_custom_constructors   sO    	 		$#s 	$
 1Ia a r[   c                     | j                  t              5  t                d d d        | j                  t              5   t        t                      d d d        y # 1 sw Y   <xY w# 1 sw Y   y xY wrS   )r}   r~   r   typer   s    rY   test_cannot_instantiatez AnyTests.test_cannot_instantiate   sK    y)E *y)DIK *) *)))   AA(A%(A1c                     t         j                  t            t         j                  t            t         j                  t            y rS   )rT   r?   r   r>   r;   r   s    rY   test_any_works_with_aliasz"AnyTests.test_any_works_with_alias   s%    Ss		#r[   N)r\   r]   r^   r   r   r   r   r   r   r   r   r_   r[   rY   ry   ry   ^   s*     
(&!r[   ry   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 rS   )r   r   assertIsassertNotEqualr   s    rY   test_equalityz"BottomTypeTestsMixin.test_equality   sN    ))4+;+;<d&&(8(89D,,d3r[   c                 N    | j                  t        | j                        d        y rS   )r   r,   r   r   s    rY   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    rY   test_instance_type_errorz-BottomTypeTestsMixin.test_instance_type_error   s,    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rS   )r}   r~   r   ro   r   r   r   s    rY   test_subclass_type_errorz-BottomTypeTestsMixin.test_subclass_type_error   s[    y)x!1!12 *y)x!1!12 *) *)))s   A2A>2A;>Bc                 ~    | j                  t              5  | j                  t            d d d        y # 1 sw Y   y xY wrS   )r}   r~   r   r   r   s    rY   test_not_genericz%BottomTypeTestsMixin.test_not_generic   s*    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>.ANrp   r_   r[   rY   Ar          r[   r   c                       e Zd Zy)4BottomTypeTestsMixin.test_cannot_subclass.<locals>.BNrp   r_   r[   rY   Br      r   r[   r   )assertRaisesRegexr~   reescapestrr   CANNOT_SUBCLASS_TYPEr   rW   r   r   s      rY   test_cannot_subclassz)BottomTypeTestsMixin.test_cannot_subclass   s    ##I"RYYs43C3C/D%EEGD$$ G ##I/CDD))*  ED	G G EDs    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rS   )r}   r~   r   r   r   s    rY   r   z,BottomTypeTestsMixin.test_cannot_instantiate   sZ    y) *y)"D!!"$ *) *)))s   A(A4(A14A=N)r\   r]   r^   r$   r   __annotations__r   r   r   r   r   r   r   r_   r[   rY   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    rY   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 rS   r_   r   s    rY   somez/NoReturnTests.test_get_type_hints.<locals>.some   s    Sr[   c                      y rS   r_   r   s    rY   some_strz3NoReturnTests.test_get_type_hints.<locals>.some_str       Cr[   r   r   target)r   r   r   r   )r   ri   r   gthrW   r   r   expectedr   s        rY   test_get_type_hintsz!NoReturnTests.test_get_type_hints   s\    0h080?#x8X&FV,  Vh7 -, ',,   A""A+	c                 l    | j                  t        t               | j                  t        t               y rS   )r   r   r   r   s    rY   test_not_equalityzNoReturnTests.test_not_equality   s"    He,E8,r[   N)r\   r]   r^   r   r   r   r   r  r_   r[   rY   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    rY   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 rS   r_   r   s    rY   r   z,NeverTests.test_get_type_hints.<locals>.some   s    sr[   c                      y rS   r_   r   s    rY   r   z0NeverTests.test_get_type_hints.<locals>.some_str       cr[   r   r   )r   r   r   r  )r   ri   r   r   r   s        rY   r   zNeverTests.test_get_type_hints   s\    *e**9 E2X&FV,  Vh7 -, ',,r   N)r\   r]   r^   r   r   r   r   r_   r[   rY   r  r     s    K68r[   r  c                       e Zd Zd Zy)AssertNeverTestsc                    | j                  t              5  t        d        d d d        d}| j                  t        |      5  t        |       d d d        ddz  }| j                  t              5 }t        |       d d d        | j	                  t        j                  j                  d         t        j                  dz         y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   exY w)Nz
some valueai'  r   r   )
r}   AssertionErrorr   r   
assertLesslen	exceptionr   rT   _ASSERT_NEVER_REPR_MAX_LENGTH)rW   value
huge_valuecms       rY   test_exceptionzAssertNeverTests.test_exception   s    ~. / ##NE: ; 5[
~."$ /!!!$%0014	
 /. ;:
 /.s#   CC0C CC C)N)r\   r]   r^   r  r_   r[   rY   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 rS   )r   rB   r   r   r   s    rY   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 rS   r_   r   s    rY   barz&SelfTests.test_basics.<locals>.Foo.bar      3r[   N)r\   r]   r^   rB   r  r_   r[   rY   r   r    s
    &T&r[   r   c                       e Zd ZddZy)%SelfTests.test_basics.<locals>.FooStrc                      y rS   r_   r   s    rY   r  z)SelfTests.test_basics.<locals>.FooStr.bar      Sr[   N)r   rB   r\   r]   r^   r  r_   r[   rY   FooStrr"    s    (r[   r&  c                       e Zd ZddZy)+SelfTests.test_basics.<locals>.FooStrTypingc                      y rS   r_   r   s    rY   r  z/SelfTests.test_basics.<locals>.FooStrTyping.bar      Cr[   N)r   typing.Selfr%  r_   r[   rY   FooStrTypingr(    s    /r[   r,  r   r   )ri   r   r   r  rB   r   r,   rW   r   r&  r,  r   s        rY   test_basicszSelfTests.test_basics  s    	' 	'	) 	)	0 	0 FL1FV,  VZZ8T2BC -, 2 	j&- -,   ,BB	c                 B    | j                  t        t              d       y )Nr+  )r   r   rB   r   s    rY   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rS   )r}   r~   rB   r   r   s    rY   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>.CNrp   r_   r[   rY   Cr6  #  r   r[   r7  zCannot subclass typing\.Selfc                       e Zd Zy))SelfTests.test_cannot_subclass.<locals>.DNrp   r_   r[   rY   Dr9  '  r   r[   r:  )r   r~   r   r   rB   rW   r7  r:  s      rY   r   zSelfTests.test_cannot_subclass!  si    ##I/CDDJ  E ##I/1D 1 1 ED1 1   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rS   )r}   r~   rB   r   r   s    rY   test_cannot_initzSelfTests.test_cannot_init*  sK    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Nrb   )r}   r~   r   rB   r   r   r   s    rY   test_no_isinstancezSelfTests.test_no_isinstance0  sO    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 rS   )r   rB   r   r$   r   r-   rW   alias_1alias_2alias_3s       rY   
test_aliaszSelfTests.test_alias6  si    d
#t*4.'*T4L9'*TG4'*TG4r[   Nr\   r]   r^   r   r.  r   r2  r   r>  rA  rH  r_   r[   rY   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 rS   )r   rC   r   r   r   s    rY   r   z LiteralStringTests.test_equalityA  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 rS   r_   r   s    rY   r  z/LiteralStringTests.test_basics.<locals>.Foo.barH  r*  r[   N)r\   r]   r^   rC   r  r_   r[   rY   r   rO  G  s
    /]/r[   r   c                       e Zd ZddZy).LiteralStringTests.test_basics.<locals>.FooStrc                      y rS   r_   r   s    rY   r  z2LiteralStringTests.test_basics.<locals>.FooStr.barJ      cr[   N)r   rC   r%  r_   r[   rY   r&  rR  I  s    1r[   r&  c                       e Zd ZddZy)4LiteralStringTests.test_basics.<locals>.FooStrTypingc                      y rS   r_   r   s    rY   r  z8LiteralStringTests.test_basics.<locals>.FooStrTyping.barL      Sr[   N)r   typing.LiteralStringr%  r_   r[   rY   r,  rV  K  s    8r[   r,  r   r   )ri   r   r   r  rC   r   r,   r-  s        rY   r.  zLiteralStringTests.test_basicsF  s    	0 	0	2 	2	9 	9 FL1FV,  VZZ8]2KL -, 2 	j/6 -,r/  c                 B    | j                  t        t              d       y )NrY  )r   r   rC   r   s    rY   r   zLiteralStringTests.test_reprS  s    m,.DEr[   c                 r    | j                  t              5  t        t            d d d        y # 1 sw Y   y xY wrS   )r}   r~   rC   r   r   s    rY   r2  z(LiteralStringTests.test_cannot_subscriptV  s$    y)# *))r3  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>.CNrp   r_   r[   rY   r7  r^  \  r   r[   r7  z%Cannot subclass typing\.LiteralStringc                       e Zd Zy)2LiteralStringTests.test_cannot_subclass.<locals>.DNrp   r_   r[   rY   r:  r`  `  r   r[   r:  )r   r~   r   r   rC   r;  s      rY   r   z'LiteralStringTests.test_cannot_subclassZ  sj    ##I/CDD'  E ##I8:M : : ED: :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rS   )r}   r~   rC   r   r   s    rY   r>  z#LiteralStringTests.test_cannot_initc  sM    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   r   r   r   s    rY   rA  z%LiteralStringTests.test_no_isinstancei  sO    y)q-( *y)sM* *) *)))rB  c                 (   t         t        t        f   }t        t           }t        t           }| j	                  t        |      t        t        f       | j	                  t        |      t        f       | j	                  t        |      t        f       y rS   )r   rC   r   r$   r   r-   rD  s       rY   rH  zLiteralStringTests.test_aliaso  so    }45}%=)'*]M,JK'*],<='*],<=r[   NrI  r_   r[   rY   rK  rK  @  s+    1
7F"+>r[   rK  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)TypeVarTestsc                    t        d      }| j                  ||       | j                  |t                | j                  |j                  d       | j                  |j                  d       | j                  |j                  d        | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  t               y )Nr   r_   F)r   r   r   r\   __constraints__r   	__bound____covariant____contravariant____infer_variance__r]   rW   r   s     rY   test_basic_plainzTypeVarTests.test_basic_plainx  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   r_   F)execr   r   r   r\   rg  r   rh  floatri  rj  rk  r]   )rW   nsr   s      rY   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boundr_   T_constraintsT_coT	covariantFT_contracontravariantT_infer)infer_variance)r   r   r   r\   rg  r   rh  r   ri  rj  rk  )rW   rt  rw  rx  r{  r~  s         rY   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   rl  s     rY    test_typevar_instance_type_errorz-TypeVarTests.test_typevar_instance_type_error  s/    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~   r   r   rl  s     rY    test_typevar_subclass_type_errorz-TypeVarTests.test_typevar_subclass_type_error  sX    CLy)sA *y)q# *) *)))s   A)A5)A25A>c                 |    | j                  t              5  t        dt              }| d d d        y # 1 sw Y   y xY w)NX)r}   r~   r   r   rW   r  s     rY   test_constrained_errorz#TypeVarTests.test_constrained_error  s+    y)S!A *))s   2;c                    t        d      }t        d      }| j                  ||       | j                  t        |   |       | j                  t        |   t        ||f          | j                  t        ||f   |       | j                  t        |t        f   t        |          | j                  t        |t        f   t        t                  | j                  t        |t        f   j
                  |t        f       | j                  t        |t        f   j                  |f       | j                  t        |t        f   j                  t               y )Nr  Y)	r   r   r   r   r   __args____parameters__r   
__origin__)rW   r  r  s      rY   test_union_uniquezTypeVarTests.test_union_unique  s   CLCLAq!q1%E!HeAqDk2q!ta(E!S&M584E!S&M5:6q#v//!S:q#v55t<eAsFm..6r[   c                 6   t        d      }| j                  |dz  t        |df          | j                  d|z  t        d|f          | j                  t        |dz        |t	        d      f       | j                  t        d|z        t	        d      |f       y Nr  r   )r   r   r   r-   rA   r  s     rY   test_orzTypeVarTests.test_or  s    CL 	S%3-0q%Q-0!c'*Q
3,@A#'*Z_a,@Ar[   c                 z    t        dt        t              }| j                  t        |t        f   t        |          y Nr   )r   r   bytesr   r   rW   r   s     rY   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~AnyStrrx  Try  z+T_cor{  r|  z	-T_contra)r   r   r   r   r   r   r   )rW   rx  r{  s      rY   r   zTypeVarTests.test_repr  s    a$'b5)b5)fy1v.dW-:T:h5r[   c                     | j                  t        d      t        d             | j                  t        dt        t              t        dt        t                     y r  )r   r   r   r   r   s    rY   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>.VNrp   r_   r[   rY   Vr    r   r[   r  r   c                       e Zd Zy),TypeVarTests.test_cannot_subclass.<locals>.WNrp   r_   r[   rY   Wr    r   r[   r  )r   r~   NOT_A_BASE_TYPEr   CANNOT_SUBCLASS_INSTANCE)rW   r  r   r  s       rY   r   z!TypeVarTests.test_cannot_subclass  sm    ##I/JK"G" LCL##I(946A6 6 LK6 6s   A3A?3A<?Bc                 x    | j                  t              5   t        d              d d d        y # 1 sw Y   y xY wr  )r}   r~   r   r   s    rY   test_cannot_instantiate_varsz)TypeVarTests.test_cannot_instantiate_vars  s'    y)GCLN *))r   c                 t   | j                  t              5  t        dt               d d d        | j                  t              5  t        dt        t
        t               d d d        | j                  t        d      5  t        dd       d d d        y # 1 sw Y   oxY w# 1 sw Y   BxY w# 1 sw Y   y xY w)Nr  ru  z%Bound must be a type\. Got \(1, 2\)\.rb   r   )r}   r~   r   r   r   rp  ro   r   r   s    rY   test_bound_errorszTypeVarTests.test_bound_errors  s    y)Cu% *y)Ce84 *##I$LNCv&N N	 *)))N Ns#   BB"?B.B"B+.B7c                      d}t        |i        y )Nz&import typing
T = typing.TypeVar('T')
ro  rW   codes     rY   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)rz  r}  r}   
ValueErrorr   r   s    rY   test_no_bivariantzTypeVarTests.test_no_bivariant  s(    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)rz  r  )r}  r  r  r   s    rY   &test_cannot_combine_explicit_and_inferz3TypeVarTests.test_cannot_combine_explicit_and_infer
  sS    z*C4= +z*CtDA +* +***s   AA&A#&A/c                    t        d      }|j                  }| j                   |t              t               | j	                   |t
        t                 t
        t                  | j	                   |t        t                 t        t                  | j	                   |t              t               | j                   |t              t               | j                   |d       t        d              | j                   ||      |       | j	                   |t        t        z        t        t        z         | j	                   |t        t        t        f         t        t        t        f          y r  )r   __typing_subst__r   r   r   listr   r   r   r   r   )rW   r   substs      rY   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   r_   r   )r   r   r   r   r#   r'   r%   r$   ri   r}   r~   r  r   r  )rW   r   bad_argsr   s       rY   test_bad_var_substitutionz&TypeVarTests.test_bad_var_substitution  s    CLc
EWQZ8A;5:x#

 C#&&&y1&A&&s+ 2&&y1GCL 2&&y1GCL 2 '& 111111 '&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cls
   )rE   r   r   ri   weakrefWeakValueDictionaryrf   r   )rW   r  valsr   s       rY   test_many_weakrefszTypeVarTests.test_many_weakrefs-  s`    |W5C#&224rA!#a&kDG # '& 6&&s   :A,,A5	c                 $   t        d      }| j                  |j                  d       | j                  |j                  d       | j	                  |j
                  d        | j	                  |j                  d       | j	                  |j                  d       | j	                  |j                  d       t        dt              }| j                  |j                  d       | j                  |j                  d       | j	                  |j
                  t               | j	                  |j                  d       | j	                  |j                  d       | j	                  |j                  d       t        dd      }| j                  |j                  d       | j                  |j                  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       | j	                  |j                  d       | j	                  |j                  d       t        dd	      }| j                  |j                  d       | j                  |j                  d       | j	                  |j
                  d        | j	                  |j                  d       | j	                  |j                  d       | j	                  |j                  d       y )
Nr   )namer_   F)r  rv  T)r  rz  )r  r}  )r  r  )
r   r   r\   rg  r   rh  ri  rj  rk  r   rl  s     rY   test_constructorzTypeVarTests.test_constructor7  s   S)**B/akk4(aoou-a))51a**E2D)S)**B/akk4(aoou-a))51a**E2-S)**B/akk4(aoot,a))51a**E2D1S)**B/akk4(aoou-a))40a**E2T2S)**B/akk4(aoou-a))51a**D1r[   N)r\   r]   r^   rm  rr  r  r  r  r  r  r  r  r   r  r   r  r  r  r  r  r  r  r  r  r_   r[   rY   re  re  w  so    1*8:

7B56L'=BB! '2r[   re  	templatesreplacementsr   c                    g }|j                         D ]2  \  }}g }|D ]  }|j                  ||f        |j                  |       4 g }t        j                  | D ]R  }g }	| D ]/  }
|D ]  \  }}|
j	                  ||      }
 |	j                  |
       1 |j                  t        |	             T g }|D ]  }||vs|j                  |        |S )a  Renders templates with possible combinations of replacements.

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

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

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

    For variadic cases, these tests should be regarded as the source of truth,
    since we hadn't realised the full complexity of variadic substitution
    at the time of finalizing PEP 646. For full discussion, see
    https://github.com/python/cpython/issues/91162.
    c           	         t        d      }t        d      }t        d      } G d dt        |         }g d}ddg}g d	}|D ]  \  }}	}
t        ||	|
g||d
      }|D ]|  \  }}}| j	                  |||      5  |dk(  r-| j                  t              5  t        ||z          d d d        n'| j                  t        ||z         t        |             d d d        ~  y # 1 sw Y   xY w# 1 sw Y   xY w)Nr   TsTs2c                       e Zd Zy);GenericAliasSubstitutionTests.test_one_parameter.<locals>.CNrp   r_   r[   rY   r7  r    r   r[   r7  )r7  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  ri   r}   r~   evalr   )rW   r   r  r  r7  genericstuple_typestestsalias_templateargs_templateexpected_templater  	alias_strargs_strexpected_strs                  rY   test_one_parameterz0GenericAliasSubstitutionTests.test_one_parameter  s
   CL$5!!
!((
. AF<NM+<!1-}>OP-5[!Q" 6H1	8\\\	<\X#{2!..y9 X!56 :9 (( X!56 . YX 6H AF :9 YXs$   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>.CNrp   r_   r[   rY   r7  r    r   r[   r7  )r7  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  r7  r  r  r  r  r  r  r  r  r  r  s                  rY   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 X!56 :9 (( X!56 . YX 6H AF :9 YX$   ;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>.CNrp   r_   r[   rY   r7  r,  G  r   r[   r7  r  r   )generic[T1, bool, T2]r  generic[int, bool, str])r-  r  r.  r  r  r	  r~   )r   r#   r  ri   r}   r~   r  r   )rW   r  r  r*  r7  r  r  r  r  r  r  r  r  r  r  s                  rY   test_three_parametersz3GenericAliasSubstitutionTests.test_three_parametersB  s   T]T]T]*B
#*5( G G
 AF<NM+<!1)=:KL)1M" 6H1	8\\\	<\X#{2!..y9 X!56 :9 (( X!56 . YX 6H AF :9 YXr(  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>.CNrp   r_   r[   rY   r7  r2  g  r   r[   r7  )r7  r  r   r  r   )@)generic[*Ts]r  zgeneric[()])r3  r  r  )r3  r  r  )r3  r   r  )r3  z[*tuple_type[*Ts]]r3  )r3  r  r  )r3  z"[str, *tuple_type[int, ...], bool])generic[str, *tuple_type[int, ...], bool])r3  r  r  )r3  r   r!  )r3  r  zgeneric[*tuple_type[int, ...]])r3  r#  r~   )r3  r  r3  )r3  r  generic[T, *Ts])r3  r  generic[*Ts, T])r5  r  r~   )r5  r  r  )r5  r  r  )r5  r  generic[int, str, bool])generic[list[T], *Ts]r  r~   )r8  r  generic[list[int]])r8  r  zgeneric[list[int], str])r8  r  zgeneric[list[int], str, bool])r6  r  r~   )r6  r  r  )r6  r  r  )r6  r  r7  )generic[*Ts, list[T]]r  r~   )r:  r  r9  )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  r7  )r;  [int, str, bool, bytes]generic[int, str, bool, bytes])generic[*Ts, T1, T2]r  r~   )r>  r  r~   )r>  r  r  )r>  r  r7  )r>  r<  r=  )generic[T1, *Ts, T2]r  r~   )r?  r  r~   )r?  r  r  )r?  r  r7  )r?  r<  r=  )r5  r  z#generic[int, *tuple_type[int, ...]])r5  [str, *tuple_type[int, ...]]r%  )r5  r"  z(generic[int, *tuple_type[int, ...], str])r6  r  z#generic[*tuple_type[int, ...], int])r6  r@  z(generic[str, *tuple_type[int, ...], int])r6  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])r8  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]rB  r4  )rC  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  rA  )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                  rY   test_variadic_parametersz6GenericAliasSubstitutionTests.test_variadic_parametersb  s   T]T]$##*(J
X AF<NM+<!1-}>OP-5[!Q" 6H1	8\\\	<\X#{2!..y9 X!56 :9 (( X!56 . YX 6H AF :9 YXs$   <C/C#	&0C/#C,(C//C8N)r\   r]   r^   __doc__r  r'  r/  rD  r_   r[   rY   r  r    s    /d?B@dr[   r  c                   <    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
y	)
UnpackTestsc                 L    g t         t            t        t        t               y rS   )r  r   r   r   r   s    rY   test_accepts_single_typez$UnpackTests.test_accepts_single_type  s    %*uSzr[   c                     t        t        t        t        t                          }dD ]/  }| j                  |      5  | j                  ||       d d d        1 y # 1 sw Y   <xY wNr  r  r  required_item)setdirr   r   r   ri   assertInrW   	dir_itemsrN  s      rY   test_dirzUnpackTests.test_dir  sU    F5:./0	
M M:mY7 ;:
 ;:s   AA%	c                     | j                  t              5  t        t        t           t        t
           f    d d d        y # 1 sw Y   y xY wrS   )r}   r~   r   r   r   r   r   s    rY   test_rejects_multiple_typesz'UnpackTests.test_rejects_multiple_types  s1    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    rY   &test_rejects_multiple_parameterizationz2UnpackTests.test_rejects_multiple_parameterization  si    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rS   )r}   r~   r   r   s    rY   test_cannot_be_calledz!UnpackTests.test_cannot_be_called  s!    y)H *))   *3c                     t        dt        t        d      }dt        |   fd}| j	                  t        |j                  d         dt         d       y )NMovie)r  yearr   c                       y rS   r_   )r   s    rY   fooz/UnpackTests.test_usage_with_kwargs.<locals>.foo      #r[   ztyping.Unpack[z.Movie])r9   r   r   r   r   r   r   r\   )rW   r^  ra  s      rY   test_usage_with_kwargsz"UnpackTests.test_usage_with_kwargs  sK    'C#=>-&--c11(;<)(7;	=r[   c                    t        d      } G d dt        g |         } d        }|t        g|   }| j                  |t           j
                  t        t        f       | j                  |g t        t              j
                  t        t        f       | j                  |g t        t              j
                  t        t        f       | j                  |t        t        t                 j
                  t        t        f       | j                  |t        t        t                 j
                  t        t        f       |t        g|   }| j                  |t           j
                  t        t        f       | j                  |g t        t              j
                  t        t        f       | j                  |g t        t              j
                  t        t        f       | j                  |t        t        t                 j
                  t        t        f       | j                  |t        t        t                 j
                  t        t        f       y )Nr  c                       e Zd Zy)+UnpackTests.test_builtin_tuple.<locals>.OldNrp   r_   r[   rY   Oldrf    r   r[   rg  c                  0    d 	x} f G fdd
}|      S )r  c                       e Zd ZW  Zy)+UnpackTests.test_builtin_tuple.<locals>.NewNr\   r]   r^   __type_params__.type_paramss   rY   Newrj         r[   ro  r_   r  .generic_basern  s     @rY   z<generic parameters of New>zCUnpackTests.test_builtin_tuple.<locals>.<generic parameters of New>      #r[   )	r   r#   r   r   r   r  r  r   r   )rW   r  rg  ro  PartOldPartNews         rY   test_builtin_tuplezUnpackTests.test_builtin_tuple  s   $$'#2#,$chBh-..c
;%*-66c
C%*-66c
Cc
!34==SzJc
!34==SzJchBh-..c
;%*-66c
C%*-66c
Cc
!34==SzJc
!34==SzJr[   c                 v   t        d      } d        }|t        g|   }t        j                  d      }| j	                  t
        |      5  |t        t        t                  d d d        | j	                  t
        |      5  |t        t        t                  d d d        y # 1 sw Y   @xY w# 1 sw Y   y xY w)Nr  c                  0    d 	x} f G fdd
}|      S )r  c                       e Zd ZW  Zy)/UnpackTests.test_unpack_wrong_type.<locals>.GenNrk  rm  s   rY   Genrz    rp  r[   r{  r_   rq  s     @rY   z<generic parameters of Gen>zGUnpackTests.test_unpack_wrong_type.<locals>.<generic parameters of Gen>  rs  r[   z*Unpack[...] must be used with a tuple type)	r   r   r   r   r   r~   r   r  r   )rW   r  r{  PartGenbad_unpack_params        rY   test_unpack_wrong_typez"UnpackTests.test_unpack_wrong_type  s    $chBh-99%QR##I/?@F49%& A##I/?@F49%& A@ A@@@s   B#B/#B,/B8N)r\   r]   r^   rI  rT  rV  rY  r[  rc  rv  r~  r_   r[   rY   rG  rG    s+    8++=K(	'r[   rG  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$)%TypeVarTupleTestsc                     t        d      }| j                  |j                  d       t        d      }| j                  |j                  d       y )Nr  r  )r   r   r\   )rW   r  r  s      rY   	test_namezTypeVarTupleTests.test_name  s>    $d+5!u-r[   c                 Z    t        d      }| j                  |j                  t               y Nr  )r   r   r]   r\   rW   r  s     rY   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  )ro  r   r\   r   r]   )rW   rq  r  s      rY   	test_execzTypeVarTupleTests.test_exec  sA    GLXd+bmmT*r[   c                 >    t        d      }| j                  ||       y r  )r   r   r  s     rY    test_instance_is_equal_to_itselfz2TypeVarTupleTests.test_instance_is_equal_to_itself"  s    $R r[   c                 L    | j                  t        d      t        d             y r  )r   r   r   s    rY   &test_different_instances_are_differentz8TypeVarTupleTests.test_different_instances_are_different&  s    L.T0BCr[   c                 F    t        d      }| j                  |t                y r  )r   r   r  s     rY   (test_instance_isinstance_of_typevartuplez:TypeVarTupleTests.test_instance_isinstance_of_typevartuple)  s    $b,/r[   c                 |    t        d      }| j                  t              5   |        d d d        y # 1 sw Y   y xY wr  )r   r}   r~   r  s     rY   test_cannot_call_instancez+TypeVarTupleTests.test_cannot_call_instance-  s+    $y)D *))s   2;c                     t        d      }| j                  g |d   g |d          | j                  t        |   t        |          y )Nr  r   )r   r   r   r  s     rY   -test_unpacked_typevartuple_is_equal_to_itselfz?TypeVarTupleTests.test_unpacked_typevartuple_is_equal_to_itself2  sD    $2FbF1I.VBZ0r[   c                     t        d      }| j                  t        g |   t        g |          | j                  t        t        |      t        t        |             y r  )r   r   r  r   r   r  s     rY   +test_parameterised_tuple_is_equal_to_itselfz=TypeVarTupleTests.test_parameterised_tuple_is_equal_to_itself7  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      rY    tests_tuple_arg_ordering_mattersz2TypeVarTupleTests.tests_tuple_arg_ordering_matters<  s~    5!5!*3***3**	
 	&+vc{*+&+vc{*+	
r[   c                 L   t        d      }t        g |   }| j                  |j                  g |       | j                  |j                  |f       t
        t        |      }| j                  |j                  t        |   f       | j                  |j                  |f       y r  )r   r  r   r  r  r   r   )rW   r  t1t2s       rY   *test_tuple_args_and_parameters_are_correctz<TypeVarTupleTests.test_tuple_args_and_parameters_are_correctH  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>.G1Nrp   r_   r[   rY   G1r  U  r   r[   r  c                       e Zd Zy)3TypeVarTupleTests.test_var_substitution.<locals>.G2Nrp   r_   r[   rY   G2r  V  r   r[   r  r_   )r   r   r#   r   r   r  r   rp  r   r  r   r}   r~   r   r  )rW   r  r   r  r  r  r   r   r7  r:  EFGHIs                  rY   r  z'TypeVarTupleTests.test_var_substitutionQ  s   $CLT]$"$+$+R%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} &, .--- .--- .--- .---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>.G1Nrp   r_   r[   rY   r  r    r   r[   r  c                       e Zd Zy)7TypeVarTupleTests.test_bad_var_substitution.<locals>.G2Nrp   r_   r[   rY   r  r    r   r[   r  )
r   r   r#   r   r   r  r}   r~   r   r   )	rW   r  r   r  r  r  r   r   r7  s	            rY   r  z+TypeVarTupleTests.test_bad_var_substitution  s   $CLT]$"$+$+R%A"A""9-#s( . !R%A""9-#2# .""9-&* . !/b/#/r/"A""9-#(( .""9-#--R-  . !VBZb()A""9-#vbz/" .""9-#vbz6":-. .-) &-- .--- .--- .---sT   <G0	G!G.G;<H=H-HG	!G+	.G8	;H	H	H	H)	c                 r   t        d      } G d dt        g |         } G d dt        t        |            }| j                  t	        |      d       | j                  t	        g |d         d       | j                  t	        t        |         d       | j                  t	        t
        g |         d       | j                  t	        t        t        |            d	       | j                  t	        t
        g |    d
       | j                  t	        t        t        t        |               d       y )Nr  c                       e Zd Zy)2TypeVarTupleTests.test_repr_is_correct.<locals>.G1Nrp   r_   r[   rY   r  r    r   r[   r  c                       e Zd Zy)2TypeVarTupleTests.test_repr_is_correct.<locals>.G2Nrp   r_   r[   rY   r  r    r   r[   r  r   ztyping.Unpack[Ts]ztuple[typing.Unpack[Ts]]ztyping.Tuple[typing.Unpack[Ts]]z*tuple[typing.Unpack[Ts]]z.typing.Unpack[typing.Tuple[typing.Unpack[Ts]]])r   r#   r   r   r   r  r   )rW   r  r  r  s       rY   test_repr_is_correctz&TypeVarTupleTests.test_repr_is_correct  s    $$"$+$+b4(ffQi*=>fRj)+>?eCRCj)+EFeF2J/02STuSbSz*,GHfU6":%678:jkr[   c           
      p   t        d      } G d dt        g |         } G d dt        t        |            }| j                  t	        |d         d       | j                  t	        |d         d       | j                  t	        |t
                 d	       | j                  t	        |t
                 d
       | j                  t	        |t
        t        f         d       | j                  t	        |t
        t        f         d       | j                  t	        |g t        t        df            d       | j                  t	        |t        t        t        df               d       | j                  t	        |t
        gt        t        df            d       | j                  t	        |t
        t        t        t        df      f         d       | j                  t	        |g t        t        df   t                 d       | j                  t	        |t        t        t        df      t        f         d       | j                  t	        |t
        gt        t        df   t                 d       | j                  t	        |t
        t        t        t        df      t        f         d       y )Nr  c                       e Zd Zy)@TypeVarTupleTests.test_variadic_class_repr_is_correct.<locals>.ANrp   r_   r[   rY   r   r    r   r[   r   c                       e Zd Zy)@TypeVarTupleTests.test_variadic_class_repr_is_correct.<locals>.BNrp   r_   r[   rY   r   r    r   r[   r   r_   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   assertEndsWithr   rp  r   r  r   r   )rW   r  r   r   s       rY   #test_variadic_class_repr_is_correctz5TypeVarTupleTests.test_variadic_class_repr_is_correct  sD   $##*r
#*D2K1D2K1D5NJ7D5NJ7D5#:/AD5#:/AD#3E#s(O#3!451	3D6%S/#:!;<F	H 	D5#:5c?#:!;<8	:D5&sCx*A#A!BCM	O 	D#8E#s(O#8S#8!9:6	8D6%S/#:C#?!@AK	M 	D5#?5c?#?C#?!@A=	?D5&sCx*A3#F!GHR	Tr[   c                    t        d      } G d dt        t        |            }|g |   }| j                  t	        |      d       | j                  t	        |d         d       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |t        |      }| j                  t	        |      d       | j                  t	        |d         d       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |g |t           }| j                  t	        |      d	       | j                  t	        |d         d
       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |t        |   t        f   }| j                  t	        |      d	       | j                  t	        |d         d
       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |t        g|   }| j                  t	        |      d       | j                  t	        |d         d
       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |t        t        |   f   }| j                  t	        |      d       | j                  t	        |d         d
       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |t        g|t           }	| j                  t	        |	      d       | j                  t	        |	d         d       | j                  t	        |	t
                 d       | j                  t	        |	t
        t        f         d       |t        t        |   t        f   }
| j                  t	        |
      d       | j                  t	        |
d         d       | j                  t	        |
t
                 d       | j                  t	        |
t
        t        f         d       |g |t        t        df      }| j                  t	        |      d       | j                  t	        |d         d       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       |t        |   t        t        t        df      f   }| j                  t	        |      d       | j                  t	        |d         d       | j                  t	        |t
                 d       | j                  t	        |t
        t        f         d       y )Nr  c                       e Zd Zy)FTypeVarTupleTests.test_variadic_class_alias_repr_is_correct.<locals>.ANrp   r_   r[   rY   r   r    r   r[   r   zA[typing.Unpack[Ts]]r_   r  r  r  zA[typing.Unpack[Ts], int]zA[int]zA[float, int]zA[float, str, int]zA[int, typing.Unpack[Ts]]zA[int, float]zA[int, float, str]zA[int, typing.Unpack[Ts], str]zA[int, str]zA[int, float, str, str].z&A[typing.Unpack[Ts], *tuple[str, ...]]zA[*tuple[str, ...]]zA[float, *tuple[str, ...]]zA[float, str, *tuple[str, ...]]z;A[typing.Unpack[Ts], typing.Unpack[typing.Tuple[str, ...]]]z(A[typing.Unpack[typing.Tuple[str, ...]]]z/A[float, typing.Unpack[typing.Tuple[str, ...]]]z4A[float, str, typing.Unpack[typing.Tuple[str, ...]]])
r   r#   r   r  r   rp  r   r   r  r   )rW   r  r   r   r7  r:  r  r  r  r  r  JKs                rY   )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>.CNrp   r_   r[   rY   r7  r  *  r   r[   r7  r  c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.DNrp   r_   r[   rY   r:  r  .  r   r[   r:  c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.ENrp   r_   r[   rY   r  r  0  r   r[   r  c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.FNrp   r_   r[   rY   r  r  2  r   r[   r  c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.GNrp   r_   r[   rY   r  r  4  r   r[   r  zCannot subclass typing\.Unpackc                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.HNrp   r_   r[   rY   r  r  7  r   r[   r  z#Cannot subclass typing.Unpack\[Ts\]c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.INrp   r_   r[   rY   r  r  9  r   r[   r  c                       e Zd Zy)1TypeVarTupleTests.test_cannot_subclass.<locals>.JNrp   r_   r[   rY   r  r  ;  r   r[   r  )r   r~   r  r   r  r   r   r   )
rW   r7  r  r:  r  r  r  r  r  r  s
             rY   r   z&TypeVarTupleTests.test_cannot_subclass(  sx   ##I/OP'L' Q$##I(>9;B; ##I/CD'DL' E##I/CD$D"I$ E##I/CD+D$+ E##I$EG!F!G ##I/UVR W##I/UV%F2J% WV# QP; ; EDDDDDG G WVVVs_   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>.ANrp   r_   r[   rY   r   r  @  r   r[   r   c                       e Zd Zy)ATypeVarTupleTests.test_variadic_class_args_are_correct.<locals>.BNrp   r_   r[   rY   r   r  A  r   r[   r   r_   )r   r   r#   r   r   r  r   r   )rW   r   r  r   r   r7  r:  r  r  r  r  r  r  r  LMNOPs                      rY   $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>.CNrp   r_   r[   rY   r7  r  i  r   r[   r7  c                       e Zd Zy)BTypeVarTupleTests.test_variadic_class_origin_is_correct.<locals>.DNrp   r_   r[   rY   r:  r  n  r   r[   r:  )r   r#   r   r   r  r   r   )rW   r  r7  r:  s       rY   %test_variadic_class_origin_is_correctz7TypeVarTupleTests.test_variadic_class_origin_is_correctf  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 rS   r_   r   s    rY   func1zCTypeVarTupleTests.test_get_type_hints_on_unpack_args.<locals>.func1v      tr[   c                       y rS   r_   r  s    rY   func2zCTypeVarTupleTests.test_get_type_hints_on_unpack_args.<locals>.func2y  s    Dr[   c                       e Zd Zy)LTypeVarTupleTests.test_get_type_hints_on_unpack_args.<locals>.CustomVariadicNrp   r_   r[   rY   CustomVariadicr  |  r   r[   r  c                       y rS   r_   r  s    rY   func3zCTypeVarTupleTests.test_get_type_hints_on_unpack_args.<locals>.func3~  s    Tr[   r   r   r   r   r  r   r   r#   rW   r  r  r  r  r  s         rY   "test_get_type_hints_on_unpack_argsz4TypeVarTupleTests.test_get_type_hints_on_unpack_argss  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 rS   r_   r  s    rY   r  zJTypeVarTupleTests.test_get_type_hints_on_unpack_args_string.<locals>.func1  s    r[   )localnsc                       y rS   r_   r  s    rY   r  zJTypeVarTupleTests.test_get_type_hints_on_unpack_args_string.<locals>.func2  s    dr[   c                       e Zd Zy)STypeVarTupleTests.test_get_type_hints_on_unpack_args_string.<locals>.CustomVariadicNrp   r_   r[   rY   r  r    r   r[   r  c                       y rS   r_   r  s    rY   r  zJTypeVarTupleTests.test_get_type_hints_on_unpack_args_string.<locals>.func3  s    tr[   )r   z*Ts)r   z*tuple[int, str])r   z*CustomVariadic[int, str]r  r  s         rY   )test_get_type_hints_on_unpack_args_stringz;TypeVarTupleTests.test_get_type_hints_on_unpack_args_string  s    $%UT2J7,	. 	3UffU38_.E%FG0WSbS\0;U-=~,NO &S)A"BC	Er[   c                 n   t        d      }| j                  t        g |   j                  g |       | j                  t        t
        |      j                  t
        |   f       | j                  t        g |t           j                  g |t               | j                  t        t
        |   t        f   j                  t
        |   t        f       | j                  t        t        g|   j                  t        g|       | j                  t        t        t
        |   f   j                  t        t
        |   f       | j                  t        t        g|t           j                  t        g|t               | j                  t        t        t
        |   t        f   j                  t        t
        |   t        f       | j                  t        g |t           j                  g |t               | j                  t        t
        |      j                  t
        |   f       y r  )r   r   r  r  r   r   r   r   r  s     rY   test_tuple_args_are_correctz-TypeVarTupleTests.test_tuple_args_are_correct  s   $ss,,ff5vbz*33fRj]CxxCx11:R::>vbz3/886":s:KLsxRx11C:":>sF2J/883r
:KLs}R}}-66C	*sF2J34==vbz3/	1 	xxCx11:R::>vbz*33fRj]Cr[   c           	         t        d      }t        d      }t        d      }t        g |d f   }t        t        |   gd f   }| j                  |j                  g |t        d              | j                  |j                  t        |   t        d       f       t        t        g|d f   }t        t        t        |   gd f   }| j                  |j                  t        g|t        d              | j                  |j                  t        t        |   t        d       f       t        g |t        d f   }t        t        |   t        gd f   }	| j                  |j                  g |t        t        d              | j                  |	j                  t        |   t        t        d       f       t        t        g|t        d f   }
t        t        t        |   t        gd f   }| j                  |
j                  t        g|t        t        d              | j                  |j                  t        t        |   t        t        d       f       t        d gg|   }t        d gt        |   f   }| j                  |j                  t        d       g|       | j                  |j                  t        d       t        |   f       t        d gt        t        g|   f   }t        d gt        t        t        |   f   f   }| j                  |j                  t        d       t        t        g|   f       | j                  |j                  t        d       t        t        t        |   f   f       t        d gt        g |t           f   }t        d gt        t        |   t        f   f   }| j                  |j                  t        d       t        g |t           f       | j                  |j                  t        d       t        t        |   t        f   f       t        d gt        t        g|t           f   }t        d gt        t        t        |   t        f   f   }| j                  |j                  t        d       t        t        g|t           f       | j                  |j                  t        d       t        t        t        |   t        f   f       t        g |g|   }t        t        |   gt        |   f   }| j                  |j                  g ||       | j                  |j                  t        |   t        |   f       t        g |g|   }t        t        |   gt        |   f   }| j                  |j                  g ||       | j                  |j                  t        |   t        |   f       y )Nr  r  r  )
r   r"   r   r   r  r   r   r   r  r   )rW   r  r  r  r  r   cderX   ghijklmnopqrr   us                           rY   test_callable_args_are_correctz0TypeVarTupleTests.test_callable_args_are_correct  s   $5!5! UrUD[!fRj\4'(%6r%64:%67fRj$t*%=>cZBZ%&c6":&,-c%;B%;T
%;<c6":tDz%BCZrZ3Z%&fRj#&,-%;r%;3%;T
%;<fRj#tDz%BCc_B__d*+c6":s+T12c%@B%@%@T$Z%@Ac6":sDJ%GH dV[b[!dVVBZ'(d4j%62%67d4j&*%=>dVU388_,-dVU3r
?334d4j%b/%BCd4j%VBZ2H%IJdVU8B88_,-dVU6":s?334d4j%S/%BCd4j%r
C2H%IJdVU3==S=112dVU3r
C#7889d4j%b#2F%GHd4j%VBZ8L2M%NO UrUZRZ fRj\6":-.ZrZBZ0fRj&*%=>VsV\c\"fSk]F3K/0\s\S\2fSk6#;%?@r[   c           
      x   t        d      }t        d      }| j                  t              5   G d dt        g ||         }d d d        | j                  t              5   G d dt        t        |   t        |   f         }d d d        | j                  t              5   G d dt        g |||         }d d d        | j                  t              5   G d	 d
t        t        |   t        |   t        |   f         }d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   jxY w# 1 sw Y   y xY w)Nr  r  c                       e Zd Zy)STypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails.<locals>.CNrp   r_   r[   rY   r7  r    r   r[   r7  c                       e Zd Zy)STypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails.<locals>.DNrp   r_   r[   rY   r:  r    r   r[   r:  c                       e Zd Zy)STypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails.<locals>.ENrp   r_   r[   rY   r  r    r   r[   r  c                       e Zd Zy)STypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails.<locals>.FNrp   r_   r[   rY   r  r    r   r[   r  )r   r}   r~   r#   r   )rW   r  r  r7  r:  r  r  s          rY   6test_variadic_class_with_duplicate_typevartuples_failszHTypeVarTupleTests.test_variadic_class_with_duplicate_typevartuples_fails  s    5!5!y).GJSJ3J'. *y)<GF3K45< * y)4G,S,3,,-4 *y)IGF3KfSkABI *) *))) *)))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>.CNrp   r_   r[   rY   r7  r    r   r[   r7  )r   r#   r   r   r   boolrp  rW   r  r7  s      rY   @test_type_concatenation_in_variadic_class_argument_list_succeedszRTypeVarTupleTests.test_type_concatenation_in_variadic_class_argument_list_succeeds  s    $*r
#*	#((	#vbz/	(2(s(	&*c/	#--C-	#vbz3
	#t
$b
$%
$
$%	#tVBZ
+,r[   c                    t        d      }t        t        g|    t        g |t            t        t        g|t            t        t        t        g|t
        t            t        t        t        |   f    t        t        |   t        f    t        t        t        |   t        f    t        t        t        t        |   t
        t        f    y r  )r   r  r   r   r  rp  r   r   r  s     rY   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>.CNrp   r_   r[   rY   r7  r$    r   r[   r7  )r   r}   r~   r#   r  s      rY   >test_variadic_class_definition_using_packed_typevartuple_failszPTypeVarTupleTests.test_variadic_class_definition_using_packed_typevartuple_fails  s2    $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>.FNrp   r_   r[   rY   r  r(    r   r[   r  c                       e Zd Zy)VTypeVarTupleTests.test_variadic_class_definition_using_concrete_types_fails.<locals>.ENrp   r_   r[   rY   r  r*    r   r[   r  )r   r}   r~   r#   r   r   )rW   r  r  r  s       rY   9test_variadic_class_definition_using_concrete_types_failszKTypeVarTupleTests.test_variadic_class_definition_using_concrete_types_fails  so    $y),GHRHH%, *y)3GF2JO,3 *) *)))s   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>.ANrp   r_   r[   rY   r   r.    r   r[   r   c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.BNrp   r_   r[   rY   r   r0  #  r   r[   r   c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.CNrp   r_   r[   rY   r7  r2  (  r   r[   r7  c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.DNrp   r_   r[   rY   r:  r4  -  r   r[   r:  c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.ENrp   r_   r[   rY   r  r6  2  r   r[   r  c                       e Zd Zy)WTypeVarTupleTests.test_variadic_class_with_2_typevars_accepts_2_or_more_args.<locals>.FNrp   r_   r[   rY   r  r8  7  r   r[   r  )r   r   r#   r   r   rp  r  r   )
rW   r  r  r  r   r   r7  r:  r  r  s
             rY   :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 rS   r_   r  s    rY   rX   zGTypeVarTupleTests.test_variadic_args_annotations_are_correct.<locals>.f?  s    $r[   c                       y rS   r_   r  s    rY   r  zGTypeVarTupleTests.test_variadic_args_annotations_are_correct.<locals>.g@      4r[   r   )r   r   r   r   )rW   r  rX   r  s       rY   *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 rS   r_   r  s    rY   r  zUTypeVarTupleTests.test_variadic_args_with_ellipsis_annotations_are_correct.<locals>.aE      r[   r   c                       y rS   r_   r  s    rY   r   zUTypeVarTupleTests.test_variadic_args_with_ellipsis_annotations_are_correct.<locals>.bI  s    tr[   )r  r   r   r   r   r   )rW   r  r   s      rY   8test_variadic_args_with_ellipsis_annotations_are_correctzJTypeVarTupleTests.test_variadic_args_with_ellipsis_annotations_are_correctD  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 rS   r_   r  s    rY   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.aR  rA  r[   r   c                       y rS   r_   r  s    rY   r   zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.bX  rA  r[   c                       y rS   r_   r  s    rY   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.c^  s    Tr[   c                       y rS   r_   r  s    rY   r   zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.dd  s    $r[   c                       y rS   r_   r  s    rY   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.el      dr[   c                       y rS   r_   r  s    rY   rX   zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.fr  rJ  r[   c                       y rS   r_   r  s    rY   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.gx  s    4r[   c                       y rS   r_   r  s    rY   r  zXTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correct.<locals>.h~  s    r[   )
r   r  r   r   r   r   r  rp  r   r   )
rW   r  r  r   r  r   r  rX   r  r  s
             rY   ;test_concatenation_in_variadic_args_annotations_are_correctzMTypeVarTupleTests.test_concatenation_in_variadic_args_annotations_are_correctM  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>.CNrp   r_   r[   rY   r7  rQ    r   r[   r7  c                       e Zd Zy)MTypeVarTupleTests.test_variadic_class_same_args_results_in_equalty.<locals>.DNrp   r_   r[   rY   r:  rS    r   r[   r:  r  r  )r   r#   r   r   r   rW   r  r7  r:  r  r  s         rY   0test_variadic_class_same_args_results_in_equaltyzBTypeVarTupleTests.test_variadic_class_same_args_results_in_equalty  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>.CNrp   r_   r[   rY   r7  rX    r   r[   r7  c                       e Zd Zy)ETypeVarTupleTests.test_variadic_class_arg_ordering_matters.<locals>.DNrp   r_   r[   rY   r:  rZ    r   r[   r:  r  r  )r   r#   r   r   r   r   rT  s         rY   (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>.CNrp   r_   r[   rY   r7  r^    r   r[   r7  c                       e Zd Zy)RTypeVarTupleTests.test_variadic_class_arg_typevartuple_identity_matters.<locals>.DNrp   r_   r[   rY   r:  r`    r   r[   r:  )r   r#   r   r   )rW   r  r  r  r7  r:  s         rY   5test_variadic_class_arg_typevartuple_identity_matterszGTypeVarTupleTests.test_variadic_class_arg_typevartuple_identity_matters  s    $5!5!##*r
#*AdsdGQttW-AfSkNAfSkN;r[   N)&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+  r9  r>  rC  rN  rU  r[  ra  r_   r[   rY   r  r    s    .2+!D0
1
?


3FKP/<l"T@>i@&*'6R3QE D(;AzJ- 1'
4!!FA<5
n$
L
4	<r[   r  c                   <    e Zd Zed        Zed        Zed        Zy)TypeVarTuplePicklingTestsc                     t        d      at        j                  t        j                  t        |            }| j                  t        |       y )N
global_Ts1)r   re  rg   loadsdumpsr   )rW   re   
global_Ts2s      rY   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   rk  rg   rf  rg  r   r   )rW   re   	unpacked1	unpacked2	unpacked3	unpacked4s         rY   ?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_Trk  )r   rr  r   rk  r  r   r   r   r   rg   rf  rg  r   )rW   re   tuplestr  s        rY   >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)r\   r]   r^   rm   ri  rp  ru  r_   r[   rY   rc  rc    s>     . . 
, 
, $ $r[   rc  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y)
UnionTestsc                 V    t         t        t        f   }| j                  |t                y rS   )r   r   rp  r   rW   r  s     rY   r.  zUnionTests.test_basics  s     #u*Au%r[   c           	         | j                  t        dt        t        t        f                | j                  t        dt        t        t        f                | j                  t        dt        t        t        f                | j                  t        dt        t        t        t           f                | j                  t        dt        t        t        f                y )Nr|   abcgQ	@)r   r   r   r   r   r   r  r   r   s    rY   test_union_isinstancez UnionTests.test_union_isinstance  s    
2uS#X78
5%S/:;D%S/:;
2uS$s)^'<=>
2uS#X78r[   c                    | j                  t              5  t        dt        t        t
        t           f          d d d        | j                  t              5  t        dt        t
        t           t        f          d d d        | j                  t              5  t        dt        t
        t           t        f          d d d        | j                  t              5  t        dt        t        t        f          d d d        | j                  t              5  t        dt        t        t        f          d d d        | j                  t              5  t        d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   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   r  r   r   r   s    rY    test_union_isinstance_type_errorz+UnionTests.test_union_isinstance_type_error  s   y)r5d3i01 *y)r5cC01 *y)r5cC01 *y)r5c?+ *y)r5c?+ *y)r5c?+ *) *)))))))))))sG   %E9%F%FFF+F79FFFF(+F47G c                     | j                  t        dt        t                        | j                  t        d t        t                        | j	                  t        dt        t                        y )Nr|   r{  )r   r   r   r   r   r   s    rY   test_optional_isinstancez#UnionTests.test_optional_isinstance  sI    
2x}56
4#78E8C=9:r[   c                 (   | j                  t              5  t        dt        t        t
                     d d d        | j                  t              5  t        d t        t        t
                     d d d        | j                  t              5  t        dt        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   xY w# 1 sw Y   WxY w# 1 sw Y   y xY wr{   )r}   r~   r   r   r  r   r   r   s    rY   #test_optional_isinstance_type_errorz.UnionTests.test_optional_isinstance_type_error!  s    y)r8DI./ *y)tXd3i01 *y)r8C=) *y)tXc]+ *) *)))))))s/   C$C0C<D$C-0C9<DDc           	         | j                  t        t        t        t        t        f                | j                  t        t        t        t        t        f                | j                  t        t        t        t        t        f                | j                  t        t        t        t        t        t           f                | j                  t        t        t        t        t        f                | j                  t        t        t        t        t        f                | j                  t        t        t        t        t        f                | j                  t        t        t        t        t        f                y rS   )	r   r   r   r   r   r   rp  r  r   r   s    rY   test_union_issubclassz UnionTests.test_union_issubclass+  s    
3c3h89
3c3h89E5c?;<
3c49n(=>?
3c3h89CsCx9:
3c3h89CsCx9: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        | j                  t              5  t        t        t        t
        t        t           f          d d d        | j                  t              5  t        t        t        t        t           t        f          d d d        | j                  t              5  t        t        t        t        t           t
        f          d d d        y # 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   y xY wrS   )r}   r~   r   r   r   r   r  r   s    rY    test_union_issubclass_type_errorz+UnionTests.test_union_issubclass_type_error5  s   y)sE" *y)uc" *y)uS#X, *y)sE#tCy.12 *y)sE$s)S.12 *y)sE$s)S.12 *) *)))))))))))sG   E7F:"F9)F?)F))F57FFFF&)F25F>c                    | j                  t        t        t        t                        | j                  t        t	        d       t        t                        | j                  t        t        t        t                        | j                  t        t        t        t                        | j                  t        t	        d       t        t                        | j                  t        t        t        t                        y rS   )r   r   r   r   r   r   r   r   r   s    rY   test_optional_issubclassz#UnionTests.test_optional_issubclassC  s    
367
4:x}=>C#78
367
4:x}=>C#78r[   c                    | j                  t              5  t        t        t           t
        t        t                     d d d        | j                  t              5  t        t        d       t
        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rS   )r}   r~   r   r  r   r   r   r   s    rY   #test_optional_issubclass_type_errorz.UnionTests.test_optional_issubclass_type_errorK  s    y)tCy(49"56 *y)tDz8DI#67 *y)sHT#Y/0 *)	 *)))))s#   *C(C"#C&CC#&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 rS   )r   r   r   r   objectr   )rW   r  u1u2u3s        rY   test_union_anyzUnionTests.test_union_anyS  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 rS   )r   r  r   r   r   )rW   r  r  r  s       rY   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 rS   )r   r   rp  r   )rW   r  r  s      rY   test_unorderedzUnionTests.test_unorderedg  s.    3:5#:R r[   c                 J    t         t           }| j                  |t               y rS   )r   ro   r   )rW   rt  s     rY   test_single_class_disappearsz'UnionTests.test_single_class_disappearsl  s    (Oa"r[   c                     t         t        t        f   }| j                  |t               | j	                  t        |j
                         | j	                  t        |j
                         y rS   )r   ro   rs   r   rQ  r  ry  s     rY   test_base_class_keptzUnionTests.test_base_class_keptp  sE    (G#$Ax(h

+gqzz*r[   c                     t         t        t        f   }t         |t        f   }| j	                  |t         t        t        t        f          y rS   )r   r   rp  ro   r   )rW   r  vs      rY   test_union_unionzUnionTests.test_union_unionv  s:    #u*!X+E#uh"678r[   c                 0    G d dt               } G d d|      } G d d|      }| j                  t        ||f   j                  ||f       t        ||f   }| j	                  t
              5  t        |       d d d        t        t        |f   }| j	                  t
              5  t        |       d d d        t        |t        f   }| j	                  t
              5  t        |       d d d        y # 1 sw Y   zxY w# 1 sw Y   NxY w# 1 sw Y   y xY w)Nc                       e Zd ZdZy);UnionTests.test_union_of_unhashable.<locals>.UnhashableMetaNr\   r]   r^   __hash__r_   r[   rY   UnhashableMetar  |      Hr[   r  c                       e Zd Zy).UnionTests.test_union_of_unhashable.<locals>.ANrp   r_   r[   rY   r   r    r   r[   r   	metaclassc                       e Zd Zy).UnionTests.test_union_of_unhashable.<locals>.BNrp   r_   r[   rY   r   r    r   r[   r   )r   r   r   r  r}   r~   hashr   )rW   r  r   r   union1union2union3s          rY   test_union_of_unhashablez#UnionTests.test_union_of_unhashable{  s    	T 	 	/.....q!t--1v6q!ty)L * sAvy)L * q#vy)L *) *) *) *)s$   /C4'D D4C= D	Dc                 J   | j                  t        t              d       t        t        t        f   }| j                  t        |      dt
        z         t        t        t        f   }| j                  t        |      dt
        z         t        d      }t        |t        f   t           }| j                  t        |      t        t                     t        t        t           t        f   }| j                  t        |      d       t        t        t           t        t        t        f   f   }| j                  t        |      d       t        t        t        z     }| j                  t        |      d       t        d t        f   }| j                  t        |      d       t        t        d f   }| j                  t        |      d       t        d t        t        f   }| j                  t        |      d	       t        t           }| j                  t        |      d       y )
Nztyping.Unionztyping.Union[%s.Employee, int]ztyping.Union[int, %s.Employee]r   z#typing.Union[typing.List[int], int]z)typing.Union[list[int], dict[str, float]]ztyping.Union[int, float]ztyping.Optional[str]z typing.Union[NoneType, str, int])r   r   r   ro   r   r\   r   r   r  r  r   rp  r   )rW   r  r   s      rY   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rK  )rO  rP  r   r   r   ri   rQ  rR  s      rY   rT  zUnionTests.test_dir  sT    E#s(O,-	
M M:mY7 ;:
 ;:s   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>.CNrp   r_   r[   rY   r7  r    r   r[   r7  c                       e Zd Zy)*UnionTests.test_cannot_subclass.<locals>.DNrp   r_   r[   rY   r:  r    r   r[   r:  z)Cannot subclass typing\.Union\[int, str\]c                       e Zd Zy)*UnionTests.test_cannot_subclass.<locals>.ENrp   r_   r[   rY   r  r    r   r[   r  )r   r~   r   r   r   r   r   )rW   r7  r:  r  s       rY   r   zUnionTests.test_cannot_subclass  s    ##I02E 2 ##I/CDDK  E ##I<>E#s(O > >2 2 ED> >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rS   )r}   r~   r   r   r   rp  ry  s     rY   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 rS   )r   r   r   rT   Iterabler   rQ  r  r   s    rY   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 rS   )	r   r   r  r   r$   r   rT   Mappingr!   r   s    rY   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 rS   )r   r   r   r   )rW   r
  r  s      rY   test_optionalzUnionTests.test_optional  s)    SM#t)Ar[   c                 j    | j                  t              5  t        d    d d d        y # 1 sw Y   y xY wNr_   )r}   r~   r   r   s    rY   
test_emptyzUnionTests.test_empty  s#    y)"I *))   
)2c                 r    t         t        t        f   }d|fd}| j                  t	        |      d   |       y )Nr   c                      y rS   r_   r   s    rY   rX   z(UnionTests.test_no_eval_union.<locals>.f      Sr[   )r   r   r   r   r+   )rW   r  rX   s      rY   test_no_eval_unionzUnionTests.test_no_eval_union  s/    #s(OnQ',a0r[   c                 h    dt         fd}| j                  t        t        |t         f         d       y )Nr   c                       y rS   r_   r_   r[   rY   funz0UnionTests.test_function_repr_union.<locals>.fun  s    #r[   ztyping.Union[fun, int])r   r   r   r   )rW   r  s     rY   test_function_repr_unionz#UnionTests.test_function_repr_union  s(    SeCHo.0HIr[   c                 .    t         t        t        f   }| y rS   )r   r   r>   r  s     rY   test_union_str_patternz!UnionTests.test_union_str_pattern  s    #w,	r[   c                 X    ddl m t        t        f    fd}t        |t        f    y )Nr   )Elementc                       |  S rS   r_   )r   r  s    rY   Elemz#UnionTests.test_etree.<locals>.Elem  s    D>!r[   )xml.etree.ElementTreer  r   r   )rW   r  r  s     @rY   
test_etreezUnionTests.test_etree  s'     	2gsl	" 	dCir[   c                    | j                  t        t        d   t        d   f   j                  t        d   t        d   f       | j                  t        t        d   t        d   f   t        d          | j                  t        t        d   t        d   f   j                  t        d   t        d   f       | j                  t        t        d   t        d   f   j                  t        d   t        d   f       dd l} G d d|j
                        }| j                  t        t        |j                     t        |j                     f   t        |j                            | j                  t        t        |j                     t        |j                     f   t        |j                            | j                  t        t        |j                     t        |j                     f   j                  t        |j                     t        |j                     f       | j                  t        t        d   t        |j                     t        d   f   j                  t        d   t        |j                     t        d   f       | j                  t        t        d   t        |j                     t        d   f   j                  t        d   t        |j                     t        d   f       y )Nrb   r   Fr   Tc                       e Zd ZdZdZy)/UnionTests.test_union_of_literals.<locals>.Intsr   rb   Nr\   r]   r^   r   r   r_   r[   rY   Intsr        AAr[   r  )r   r   r   r  enumIntEnumr   r   )rW   r  r  s      rY   test_union_of_literalsz!UnionTests.test_union_of_literals  s<   wqz71:56??!!*gaj1	3wqz71:56 	% 	wu~wqz9:CC!%.'!*5	7wt}gaj89BB!$-4	6 		4<< 	 	wtvv?@ 	*wtvv?@ 	* 	wtvv?@II!$&&/7466?;	= 	wqz7466?GENJKTT!!*gdffowu~F	Hwqz7466?GDMIJSS!!*gdffowt}E	Gr[   N) r\   r]   r^   r.  r|  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r   rT  r   r   r  r  r  r  r  r  r  r  r  r_   r[   rY   rw  rw    s    &9,;
,;391	%(!
#+9
(:28	WD
1
J


Gr[   rw  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>.TPNrp   r_   r[   rY   TPr     r   r[   r  )r}   r~   r   r   r   r   r  assertIsSubclass)rW   r  s     rY   r.  zTupleTests.test_basics  s    y)ueCHo. *y)ueCHo. * 	eU+b%( *)))s   "B?"C?CCc                 \   | j                  t        t           t        t                  | j                  t        t        df   t        t        df          | j                  t        t           t        t        t        f          | j                  t        t           t        t        df          y N.)r   r   r   r   r   s    rY   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>.MyTupleNrp   r_   r[   rY   MyTupler  +      r[   r  )r  r  r   )rW   r  s     rY   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    rY   test_tuple_instance_type_errorz)TupleTests.test_tuple_instance_type_error1  s@    y)vuS#X/ *fe, *)s   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.Tupler_   ztyping.Tuple[()]ztyping.Tuple[int, float].ztyping.Tuple[int, ...]ztyping.Tuple[list[int]])r   r   r   r   rp  r  r   s    rY   r   zTupleTests.test_repr6  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~   r   r   r   r   s    rY   r   zTupleTests.test_errors=  sS    y)r5! *y)r5:& *) *)))s   A%A1%A.1A:N)	r\   r]   r^   r.  r   r  r  r   r   r_   r[   rY   r  r    s!    )9,-
L'r[   r  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)BaseCallableTestsc                 $   | j                   }| j                  t              5  t        t        j
                  |t        gt        f          d d d        | j                  t        j
                  |       | j                  ||       y # 1 sw Y   <xY wrS   )r"   r}   r~   r   typesFunctionTyper   r  rW   r"   s     rY   test_self_subclassz$BaseCallableTests.test_self_subclassF  sh    ==y)u))8SE3J+?@ *e00(;h1 *)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 )Nrb   .)r"   r   r   r  r   r   )rW   r"   r7  s      rY   test_eq_hashzBaseCallableTests.test_eq_hashM  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.rL  rM  )r"   rO  rP  r   ri   rQ  )rW   r"   rS  rN  s       rY   rT  zBaseCallableTests.test_dirY  s^    ==HS#X./0	
M M:mY7 ;:
 ;:s   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rS   )r"   r}   r~   r   r   r   )rW   r"   r  s      rY   r   z)BaseCallableTests.test_cannot_instantiateb  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rS   )r"   r}   r~   r   r  s     rY   test_callable_wrong_formsz+BaseCallableTests.test_callable_wrong_formsn  s,    ==y)SM *))s   
5>c                 j    | j                   }d }| j                  ||       | j                  d |       y )Nc                       y rS   r_   r_   r[   rY   rX   z9BaseCallableTests.test_callable_instance_works.<locals>.fu      r[   )r"   r   r   rW   r"   rX   s      rY   test_callable_instance_worksz.BaseCallableTests.test_callable_instance_workss  s0    ==	a*  x0r[   c                 
   | j                   }d }| j                  t              5  t        ||g d f          d d d        | j                  t              5  t        ||g t        f          d d d        | j                  t              5  t        d |g d f          d d d        | j                  t              5  t        d |g t        f          d d d        y # 1 sw Y   xY w# 1 sw Y   xxY w# 1 sw Y   UxY w# 1 sw Y   y xY w)Nc                       y rS   r_   r_   r[   rY   rX   z>BaseCallableTests.test_callable_instance_type_error.<locals>.f|  r  r[   )r"   r}   r~   r   r   r   s      rY   !test_callable_instance_type_errorz3BaseCallableTests.test_callable_instance_type_errorz  s    ==	y)q(2t8,- *y)q(2s7+, *y)tXb$h/0 *y)tXb#g./ *) *)))))))s/   CC!C-6C9C!C*-C69Dc                    | j                   }|j                   d}|g t        f   }| j                  t	        |      | d       |t
        t        gt        f   }| j                  t	        |      | d       |dt
        f   }| j                  t	        |      | d       |t
        t        gt        t           f   }| j                  t	        |      | d       y )N	.Callablez
[[], bool]z[[str, float], int].z
[..., str]z[[str, float], list[int]])	r"   r]   r  r   r   r   rp  r   r  )rW   r"   fullnamect0ct2ctvct3s          rY   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 rS   r_   r  s    rY   ra  z:BaseCallableTests.test_callable_with_ellipsis.<locals>.foo  r  r[   )r"   r   r   r+   globalslocals)rW   r"   ra  s      rY   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"   rT   r   r   r  s     rY   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 rS   )r"   r   r   r   r  s     rY   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   rp  collectionsr{  r   r  GenericAliasr   r  r   r  r  rW   r"   r
  s      rY   
test_basiczBaseCallableTests.test_basic  s    ==#sU*+{///!!%););<e&&(@(@A#sE):;--r2r[   c                     | j                   }|t        t        gt        f   }| j	                   t        j                  |             |       y rS   )r"   r   r   rp  r   r  refr  s      rY   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_picklerb   )r
  re   )r"   r   r  rE   r   r   r!  r   r   rp  rF   rf   rg   rh   ri   rg  rf  r   r  r  r  )rW   r"   samplesr
  re   r   loadeds          rY   test_picklezBaseCallableTests.test_pickle  sL   ==:&Z( -	 c3Z&'Xs]#Xx'([h/45[!5)!5X!56;<
 Ev66:;\\U\;UE2A#\\!_F$$U%5%5v7H7HI$$U^^V__E$$U%9%96;P;PQ <; <  h	 <;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"   r]   r   r   r   r   r   r   r   rp  r   r   r  rT   r   r  )rW   r"   r  C1C2C3C4C5s           rY   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        rY   test_type_subst_errorz'BaseCallableTests.test_type_subst_error  sR    ==cNCLQ##Is3QTN1c6" 433s   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 rS   r_   r   s    rY   __call__z8BaseCallableTests.test_type_erasure.<locals>.C1.__call__      r[   Nr\   r]   r^   r2  r_   r[   rY   r&  r0    s    r[   r&  )r"   r   r   r   r   r   __orig_class__)rW   r"   r&  r  s       rY   test_type_erasurez#BaseCallableTests.test_type_erasure  s^    ==	 	 uaxLacmmR(++Rq\:r[   c                    | j                   }|j                   d}t        d      }t        d      }||t        f   }| j	                  |t
        gt        f   |t
        gt        f          | j	                  |t
        t        gt        f   |t
        t        gt        f          | j	                  |g t        f   |g t        f          | j	                  |dt        f   |dt        f          | j	                  ||t        f   ||t        f          | j	                  |t        t
        |f   t        f   |t        t
        |f   t        f          | j	                  t        |      | d       | j	                  t        |t
        t        gt        f         | d       | j                  t              5  |t
        t        f    d d d        ||t
        f   }| j	                  |t
        g   |t
        gt
        f          | j	                  |t
        t        g   |t
        t        gt
        f          | j	                  |g    |g t
        f          | j	                  |d   |dt
        f          | j	                  ||   ||t
        f          | j	                  |t        t
        |f      |t        t
        |f   t
        f          | j	                  |t
           |t
        gt
        f          | j	                  |t
        t        f   |t
        t        gt
        f          | j	                  t        |      | d       | j	                  t        |t
        t        f         | d       y # 1 sw Y   xY w)	Nr  r  P2.z[~P, ~T]z[[int, str], str]z	[~P, int]z[[int, str], int])r"   r]   rE   r   r   r   r   rF   r   r}   r~   )rW   r"   r  r  r8  r&  r'  s          rY   test_paramspecz BaseCallableTests.test_paramspec  s   ==))*)4cNt_ad^SE3J3%*)=>S#JO,hSz3.GHBGhr3w&78CHxS'9:BGhr3w&78KR0#56!+c2g"6";<	>bhZx#89b#sS12xj@Q4RSy)sCxL * afSEHcUCZ$89S#J3*c/)BCB"c'!23C(38"45B"c'!23KR01!+c2g"6";<	> 	C(C5#:"67CHxc
C'@AbhZy#9:bcl+z9J-KL! *)s   1M##M-c                    | j                   }|j                   d}t        d      }t        d      }t        d      }|t        t
        |f   |f   }| j                  t        |      | d       | j                  ||t
        f   |t        t
        |f   t
        f          | j                  |t        t        gt
        f   |t
        t        t        gt
        f          | j                  |g t
        f   |t
        gt
        f          | j                  |t        t        |f   t
        f   |t        t
        t        |f   t
        f          | j                  |dt
        f   |t        t
        df   t
        f          |t        t
        |f   t
        f   }| j                  t        |      | d       | j                  ||   |t        t
        |f   t
        f          | j                  |t        t        g   |t
        t        t        gt
        f          | j                  |t        t        f   |t
        t        t        gt
        f          | j                  |g    |t
        gt
        f          | j                  |t        t        |f      |t        t
        t        |f   t
        f          | j                  |d   |t        t
        df   t
        f          y )Nr  r   r  r8  z![typing.Concatenate[int, ~P], ~T].z"[typing.Concatenate[int, ~P], int])
r"   r]   r   rE   rF   r   r   r   r   rp  )rW   r"   r  r   r  r8  r7  s          rY   test_concatenatez"BaseCallableTests.test_concatenate	  s   ==))*)4CLcNt_[a(!+,a$:%FG	I2s7Xk#r'.BC.G%HIC<,-xc58I38N/OP2s7XseSj%9:;sBw/45!+c3l";S"@A	C38h{38/Dc/I&JK[a(#-.a$:%GH	J2S"W)=s)B CDC<(Ce3Dc3I*JK3:#sE1BC1G(HI2# 45;sBw/0!+c3l";S"@A	C3+c3h*?*D!EFr[   c           	      n   | j                   }t        d      }t        d      }t        d      }t        d      }t        d      } G d dt        ||f         }| j                  |j                  ||f       |t        |g|||f   f   }| j                  |j                  t        |f|||f   f       | j                  |j                  ||f       | j                  |t        t        t           t        gf   |t        t        g|t        t           t        gt        f   f          |||gt        f   t        |   gt        f   }	| j                  |	j                  ||gt        f   t        |   ft        f       | j                  |	j                  |f       | j                  |	t        t              ||t        t           gt        f   t        t        t              gt        f          ||||f   |g|f   }
| j                  |
j                  |||f   |f|f       | j                  |
j                  ||f       | j                  |
g t        f   ||g t        f   t        gt        f          | j                  |
t        t        gt        f   ||t        t        gt        f   t        gt        f          | j                  |
t        t        g|f   t           ||t        t        gt        f   t        gt        f          ||t        g|t        |f   |g|f   }| j                  |j                  |t        g|t        |f   |f|f       | j                  |j                  ||f       | j                  |t        t        t        f   ||t        t        t        t        gt        f   t        gt        f          y )Nr  r8  r   r  r  c                       e Zd Zy)3BaseCallableTests.test_nested_paramspec.<locals>.MyNrp   r_   r[   rY   Myr>  =	  r  r[   r?  )r"   rE   r   r   r#   r   r  r   r  r   r  r  r  rp  )rW   r"   r  r8  r   r  r  r?  r&  r'  r(  r)  s               rY   test_nested_paramspecz'BaseCallableTests.test_nested_paramspec4	  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   rp  r   r~   rE   r   )rW   r"   r
  r  r&  s        rY   r   zBaseCallableTests.test_errors^	  s    ==#sU*+##I/GH#J IcNad^##I/CDsC} E##I/BCsG DC IH EDCCs#   
B<6C)
C<CCCN)r\   r]   r^   r  r  rT  r   r  r  r  r   r  r  r  r  r  r$  r  r-  r6  r9  r;  r@  r   r_   r[   rY   r  r  D  ss    2
)8

10
L2(
C
36
*2T0#; MDG6(WT
r[   r  c                   *    e Zd Zej                  Zd Zy)TypingCallableTestsc                 `   t         j                  t        t        gt        f   }t
        j                  j                  t        t        gt        f   }| j                  |j                  |j                         | j                  t        |j                        t        |j                               y rS   )
rT   r"   r   r   r  r  r{  r   r  r  )rW   c1c2s      rY   test_consistencyz$TypingCallableTests.test_consistencym	  sr     __c3Z-.__%%sCj$&67bkk2bkk*D,=>r[   N)r\   r]   r^   rT   r"   rI  r_   r[   rY   rE  rE  j	  s    H?r[   rE  c                   8    e Zd Zej                  j
                  Zy)CollectionsCallableTestsN)r\   r]   r^   r  r{  r"   r_   r[   rY   rK  rK  v	  s    ''Hr[   rK  c                   f    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zy)LiteralTestsc                     t         d    t         d    t         d    t         d     t         d    t         d    t         t         d   t         d   f    t         d    y )	Nrb   rb   r      r   r   zT)rb   2Fr        )s   foor  )r   r   s    rY   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)r\   r]   r^   r   r_   r[   rY   r?  rY  	  s    Ar[   r?  )r  Enumr   r   r   r  )rW   r  r?  s      rY   	test_enumzLiteralTests.test_enum	  s;    	 	 	//"$$9r[   c                 b    t         t            t         d    t         ddd    t         t            y )N)y       @      @.r_   rP  rU  ra  r  )r   r   r   r   s    rY   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 )NrO  )ra  r  baz)r   r   r   s    rY    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 )
Nrb   ztyping.Literal[1])rb   Tra  ztyping.Literal[1, True, 'foo']ztyping.Literal[int]ztyping.Literalztyping.Literal[None]rb   r   rP  rP  ztyping.Literal[1, 2, 3])r   r   r   r   r   s    rY   r   zLiteralTests.test_repr	  s    gaj)+>?gn568XYgcl+-BCg(89gdm,.DEgj124MNr[   c                     t        t        t        d               }dD ]/  }| j                  |      5  | j	                  ||       d d d        1 y # 1 sw Y   <xY w)NrO  rL  rM  )rO  rP  r   ri   rQ  rR  s      rY   rT  zLiteralTests.test_dir	  sQ    GG,-.	
M M:mY7 ;:
 ;:s   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    rY   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   r   r   s    rY    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>.FooNrp   r_   r[   rY   r   rj  	  r   r[   r   rb   c                       e Zd Zy)-LiteralTests.test_no_subclassing.<locals>.BarNrp   r_   r[   rY   r   rl  	  r   r[   r   r}   r~   r   rW   r   r   s      rY   test_no_subclassingz LiteralTests.test_no_subclassing	  sO    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@  rm  r   s    rY   test_no_multiple_subscriptsz(LiteralTests.test_no_multiple_subscripts	  s'    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   FTrb   r   )rb   T)rb   rb   r  Tr   r   rb   rO  rc  )r   r   r   r   s    rY   
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 )Nrb   r  rt  rO  rc  )r   r  r   r   s    rY   	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 )NrO  rc  rb   r   )rP  rU  )rb   r   rP  rU  )r   r   r  r   s    rY   	test_argszLiteralTests.test_args	  s    )22I>,55yAGAJ!=>GGVR11B8<r[   c                    t         t         d   t         d   t         d   f   }t         t         d   df   }t         t         d      }|||fD ]7  }| j                  |t         d          | j                  |j                  d       9 y )Nrb   r   rP  r  rO  )r   r   r  )rW   l1l2l3r  s        rY   test_flattenzLiteralTests.test_flatten	  sz    WQZWQZ78WT]A%&WW%&RAQ 01QZZ3 r[   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>.Intsrb   r   Nr  r_   r[   rY   r  r  	  r  r[   r  rb   r   )r  r  r   r   r   r   r  )rW   r  r  r  s       rY   test_does_not_flatten_enumz'LiteralTests.test_does_not_flatten_enum	  sq    	4<< 	 DFFODFFOAJAJ
 	dffdffa%;<r[   N)r\   r]   r^   r.  r[  r^  ra  r   rT  r>  rg  ro  rq  ru  rw  ry  r~  r  r_   r[   rY   rM  rM  z	  sP    	 :-O8(%	@L
=4=r[   rM  XKXVc                   B    e Zd ZdedefdZdedefdZd	dededefdZy)
SimpleMappingkeyr   c                      y rS   r_   rW   r  s     rY   __getitem__zSimpleMapping.__getitem__	      r[   r  c                      y rS   r_   rW   r  r  s      rY   __setitem__zSimpleMapping.__setitem__	  r  r[   Ndefaultc                      y rS   r_   rW   r  r  s      rY   getzSimpleMapping.get
  r  r[   rS   )r\   r]   r^   r  r  r  r  r  r_   r[   rY   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 rS   storer   s    rY   r   zMySimpleMapping.__init__
  s	    
r[   r  c                      | j                   |   S rS   r  r  s     rY   r  zMySimpleMapping.__getitem__

  s    zz#r[   c                 "    || j                   |<   y rS   r  r  s      rY   r  zMySimpleMapping.__setitem__
  s    

3r[   Nc                 D    	 | j                   |   S # t        $ r |cY S w xY wrS   )r  KeyErrorr  s      rY   r  zMySimpleMapping.get
  s)    	::c?" 	N	s    rS   )r\   r]   r^   r   r   r  r  r  r_   r[   rY   r  r  
  s+    s  s  s r[   r  c                   "    e Zd ZU eed<   eed<   y)
Coordinater   r   Nr\   r]   r^   r   r   r_   r[   rY   r  r  
      
F
Fr[   r  c                       e Zd ZU eed<   y)PointlabelNr\   r]   r^   r   r   r_   r[   rY   r  r  
  s    Jr[   r  c                   ,    e Zd ZU eed<   eed<   eed<   y)MyPointr   r   r  Nr\   r]   r^   r   r   r   r_   r[   rY   r  r  
  s    
F
FJr[   r  c                       e Zd ZU eed<   y)XAxisr   Nr  r_   r[   rY   r  r  $
      
Fr[   r  c                       e Zd ZU eed<   y)YAxisr   Nr  r_   r[   rY   r  r  '
  r  r[   r  c                       e Zd Zy)PositionNrp   r_   r[   rY   r  r  *
  s    r[   r  c                   (    e Zd ZU eed<   dedefdZy)Protoattrr   r   c                      y rS   r_   rW   r   s     rY   methz
Proto.meth1
  r  r[   N)r\   r]   r^   r   r   r   r  r_   r[   rY   r  r  .
  s    
I  r[   r  c                       e Zd Zy)ConcreteNrp   r_   r[   rY   r  r  4
  rq   r[   r  c                   ,    e Zd ZU dZeed<   dedefdZy)Otherrb   r  r   r   c                     |dk(  ryy)Nthisrb   r   r_   r  s     rY   r  z
Other.meth9
  s    &=r[   N)r\   r]   r^   r  r   r   r   r  r_   r[   rY   r  r  7
  s    D#M  r[   r  c                   "    e Zd ZU eed<   eed<   y)NTr   r   Nr  r_   r[   rY   r  r  >
  r  r[   r  c                   ,    e Zd ZU ej                  ed<   y)HasCallProtocolr2  N)r\   r]   r^   rT   r"   r   r_   r[   rY   r  r  B
  s    oor[   r  c                      e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&d% Z'd& Z(d' Z)d( Z*d) Z+d* Z,d+ Z-d, Z.d- Z/d. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4 Z6d5 Z7d6 Z8d7 Z9d8 Z:d9 Z;d: Z<d; Z=d< Z>d= Z?d> Z@d? ZAd@ ZBdA ZCdB ZDdC ZEdD ZFdE ZGdF ZHdG ZIdH ZJdI ZKyJ)KProtocolTestsc                 j   t          G d dt                     } G d d      } G d d      }d }| j                  ||       | j                   |       |       | j	                  ||       | j                   |       |       | j	                  t        j                  |       | j                  ||       y )Nc                       e Zd Zd Zy),ProtocolTests.test_basic_protocol.<locals>.Pc                      y rS   r_   r   s    rY   r  z1ProtocolTests.test_basic_protocol.<locals>.P.methK
      r[   Nr\   r]   r^   r  r_   r[   rY   r  r  I
      r[   r  c                       e Zd Zy),ProtocolTests.test_basic_protocol.<locals>.CNrp   r_   r[   rY   r7  r  N
  r   r[   r7  c                       e Zd Zd Zy),ProtocolTests.test_basic_protocol.<locals>.Dc                      y rS   r_   r   s    rY   r  z1ProtocolTests.test_basic_protocol.<locals>.D.methQ
  r  r[   Nr  r_   r[   rY   r:  r  P
      r[   r:  c                       y rS   r_   r_   r[   rY   rX   z,ProtocolTests.test_basic_protocol.<locals>.fT
  r  r[   )r*   r'   r  r   assertNotIsSubclassr   r  r  )rW   r  r7  r:  rX   s        rY   test_basic_protocolz!ProtocolTests.test_basic_protocolH
  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>.FooNrk  rm  s   rY   r   r  d
  s    r[   r   r_   r   rr  rn  s     @rY   z<generic parameters of Foo>z^ProtocolTests.test_runtime_checkable_generic_non_protocol.<locals>.<generic parameters of Foo>d
  s    r[   )r   r~   r*   rW   r   s     rY   +test_runtime_checkable_generic_non_protocolz9ProtocolTests.test_runtime_checkable_generic_non_protocol^
  s6    ##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 rS   r_   r   s    rY   r  z>ProtocolTests.test_runtime_checkable_generic.<locals>.Foo.methj
      r[   Nr\   r]   r^   rl  r  rn  r   s   rY   r   r  h
  s    $a$r[   r   r'   rr  rn  r   s    @@rY   z<generic parameters of Foo>zQProtocolTests.test_runtime_checkable_generic.<locals>.<generic parameters of Foo>h
  s     	% 	%X 	%r[   c                       e Zd ZdefdZy):ProtocolTests.test_runtime_checkable_generic.<locals>.Implr   c                      y rS   r_   r   s    rY   r  z?ProtocolTests.test_runtime_checkable_generic.<locals>.Impl.methm
  r   r[   Nr\   r]   r^   r   r  r_   r[   rY   Implr  l
  s
    &c&r[   r  c                       e Zd ZdefdZy)=ProtocolTests.test_runtime_checkable_generic.<locals>.NotImplr   c                      y rS   r_   r   s    rY   methodzDProtocolTests.test_runtime_checkable_generic.<locals>.NotImpl.methodr
  r$  r[   N)r\   r]   r^   r   r  r_   r[   rY   NotImplr  q
  s
    ((r[   r  )r*   r  r  )rW   r   r  r  s       rY   test_runtime_checkable_genericz,ProtocolTests.test_runtime_checkable_genericg
  sL    		% 
	%	' 	' 	dC(	) 	) 	  #.r[   c                     t          G d dt                     } d        } d        }| j                   |d      |       | j                   |d      |       y )Nc                       e Zd ZU eed<   y)IProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.HasXr   Nr  r_   r[   rY   HasXr  w
      Fr[   r  c                  4    d xf G fdd
} |       S )r   c                   (    e Zd ZW  ZU W ed<   d Zy)HProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.Barr   c                     || _         y rS   r   r   s     rY   r   zQProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.Bar.__init__}
  r   r[   N)r\   r]   r^   rl  r   r   r  s   rY   r   r  {
  s     Dr[   r   r_   r  s    @@rY   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 rS   r   )rW   r   s     rY   r   zVProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.Capybara.__init__
  r   r[   N)r\   r]   r^   rl  r   r   r   rm  s   rY   Capybarar  
  s     Fr[   r  r_   r  s     @rY   z <generic parameters of Capybara>zeProtocolTests.test_pep695_generics_can_be_runtime_checkable.<locals>.<generic parameters of Capybara>
  s    q 	 	 	r[   rb   r  r*   r'   r   r   )rW   r  r   r  s       rY   -test_pep695_generics_can_be_runtime_checkablez;ProtocolTests.test_pep695_generics_can_be_runtime_checkablev
  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>.EmptyNrp   r_   r[   rY   Emptyr  
      r[   r   c                       e Zd Zy)BProtocolTests.test_everything_implements_empty_protocol.<locals>.CNrp   r_   r[   rY   r7  r  
  r  r[   r7  c                       y rS   r_   r_   r[   rY   rX   zBProtocolTests.test_everything_implements_empty_protocol.<locals>.f
  r  r[   rb   r_   )
r*   r'   r  r   r  r  r  r  rT   r   )rW   r   r7  rX   things        rY   )test_everything_implements_empty_protocolz7ProtocolTests.test_everything_implements_empty_protocol
  s    		H 	 
		 		 dE1e.@.@AE!!%/ Bh2vq1E!!%/ 2r[   c                 6    d }| j                  |t               y )Nc                       y rS   r_   r_   r[   rY   rX   z:ProtocolTests.test_function_implements_protocol.<locals>.f
  r  r[   )r   r  rV   s     rY   !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>.CNrp   r_   r[   rY   r7  r  
  r   r[   r7  c                       e Zd Zy):ProtocolTests.test_no_inheritance_from_nominal.<locals>.BPNrp   r_   r[   rY   BPr  
  r   r[   r  c                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.PNrp   r_   r[   rY   r  r  
  r   r[   r  c                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.QNrp   r_   r[   rY   Qr  
  r   r[   r  c                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.RNrp   r_   r[   rY   Rr  
  r   r[   r  c                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.DNrp   r_   r[   rY   r:  r  
  r   r[   r:  c                       e Zd Zy)9ProtocolTests.test_no_inheritance_from_nominal.<locals>.ENrp   r_   r[   rY   r  r  
  r   r[   r  )r'   r}   r~   r   )rW   r7  r  r  r  r  r:  r  s           rY    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>.PNrp   r_   r[   rY   r  r  
  r   r[   r  c                       e Zd Zy).ProtocolTests.test_no_instantiation.<locals>.CNrp   r_   r[   rY   r7  r!  
  r   r[   r7  r|   r   c                       e Zd Zy)/ProtocolTests.test_no_instantiation.<locals>.PGNrp   r_   r[   rY   PGr#  
  r   r[   r$  c                       e Zd Zy)/ProtocolTests.test_no_instantiation.<locals>.CGNrp   r_   r[   rY   CGr&  
  r   r[   r'  )r'   r}   r~   r   r   r   )rW   r  r7  r   r$  r'  s         rY   test_no_instantiationz#ProtocolTests.test_no_instantiation
  s>   y)C * 	ac1%y)bE * CL#!#y)D *y)BsGI *y)BqEG * 	Agbgi,y)BsGBK *)/ *) *) *))))) *)sG   E-,	E:/FF FF+-E7:FFFF(+F4c                      G d dt               } G d d      } |       }|j                  |d       | j                  |j                  d       y )Nc                   (    e Zd ZU eed<   deddfdZy)LProtocolTests.test_protocol_defining_init_does_not_get_overridden.<locals>.Pr   r   Nc                     || _         y rS   r   r   s     rY   r   zUProtocolTests.test_protocol_defining_init_does_not_get_overridden.<locals>.P.__init__
  r   r[   r\   r]   r^   r   r   r   r_   r[   rY   r  r+  
      F# $ r[   r  c                       e Zd Zy)LProtocolTests.test_protocol_defining_init_does_not_get_overridden.<locals>.CNrp   r_   r[   rY   r7  r0  
  r   r[   r7  rb   )r'   r   r   r   rW   r  r7  r  s       rY   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>.Pr   r   Nc                     || _         y rS   r   r   s     rY   r   zSProtocolTests.test_concrete_class_inheriting_init_from_protocol.<locals>.P.__init__
  r   r[   r-  r_   r[   rY   r  r5  
  r.  r[   r  c                       e Zd Zy)JProtocolTests.test_concrete_class_inheriting_init_from_protocol.<locals>.CNrp   r_   r[   rY   r7  r8  
  r   r[   r7  rb   )r'   r   r   r   r1  s       rY   1test_concrete_class_inheriting_init_from_protocolz?ProtocolTests.test_concrete_class_inheriting_init_from_protocol
  sE    	 	
 	aDa#a r[   c                     t          G d dt                     } G d d|      } G d d|      }| j                  t              5   |        d d d        | j	                   |       |       y # 1 sw Y   !xY w)Nc                   6    e Zd Zej                  defd       Zy)9ProtocolTests.test_cannot_instantiate_abstract.<locals>.Pr   c                     t         rS   )NotImplementedErrorr   s    rY   amethz?ProtocolTests.test_cannot_instantiate_abstract.<locals>.P.ameth
  s    ))r[   N)r\   r]   r^   r{  abstractmethodr   r?  r_   r[   rY   r  r<  
  s!    *s *  *r[   r  c                       e Zd Zy)9ProtocolTests.test_cannot_instantiate_abstract.<locals>.BNrp   r_   r[   rY   r   rB  
  r  r[   r   c                       e Zd ZdefdZy)9ProtocolTests.test_cannot_instantiate_abstract.<locals>.Cr   c                      y)N   r_   r   s    rY   r?  z?ProtocolTests.test_cannot_instantiate_abstract.<locals>.C.ameth
      r[   N)r\   r]   r^   r   r?  r_   r[   rY   r7  rD  
  s    s r[   r7  )r*   r'   r}   r~   r   )rW   r  r   r7  s       rY    test_cannot_instantiate_abstractz.ProtocolTests.test_cannot_instantiate_abstract
  sh    		* 	* 
	*
	 		 	 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 rS   r_   r   s    rY   meth1z;ProtocolTests.test_subprotocols_extending.<locals>.P1.meth1
  r  r[   Nr\   r]   r^   rM  r_   r[   rY   P1rK  
  r  r[   rO  c                       e Zd Zd Zy)5ProtocolTests.test_subprotocols_extending.<locals>.P2c                      y rS   r_   r   s    rY   meth2z;ProtocolTests.test_subprotocols_extending.<locals>.P2.meth2  r  r[   Nr\   r]   r^   rS  r_   r[   rY   r8  rQ    r  r[   r8  c                       e Zd Zd Zd Zy)4ProtocolTests.test_subprotocols_extending.<locals>.Cc                      y rS   r_   r   s    rY   rM  z:ProtocolTests.test_subprotocols_extending.<locals>.C.meth1  r  r[   c                      y rS   r_   r   s    rY   rS  z:ProtocolTests.test_subprotocols_extending.<locals>.C.meth2  r  r[   Nr\   r]   r^   rM  rS  r_   r[   rY   r7  rV        r[   r7  c                       e Zd Zd Zy)5ProtocolTests.test_subprotocols_extending.<locals>.C1c                      y rS   r_   r   s    rY   rM  z;ProtocolTests.test_subprotocols_extending.<locals>.C1.meth1  r  r[   NrN  r_   r[   rY   r&  r\    r  r[   r&  c                       e Zd Zd Zy)5ProtocolTests.test_subprotocols_extending.<locals>.C2c                      y rS   r_   r   s    rY   rS  z;ProtocolTests.test_subprotocols_extending.<locals>.C2.meth2  r  r[   NrT  r_   r[   rY   r'  r_    r  r[   r'  r'   r*   r   r  r   r  )rW   rO  r8  r7  r&  r'  s         rY   test_subprotocols_extendingz)ProtocolTests.test_subprotocols_extending
  s    	 	 
	X 	 
		 		 		 	 	  r*  r*  R(  R(ac2&a$r[   c                     G d dt               } G d dt               }t         G d d||t                      } G d d      } G d	 d
      } G d d      }| j                   |       |       | j                   |       |       | j                  ||       | j                  ||       | j	                   |       |       | j                  ||       y )Nc                       e Zd Zd Zy)3ProtocolTests.test_subprotocols_merging.<locals>.P1c                      y rS   r_   r   s    rY   rM  z9ProtocolTests.test_subprotocols_merging.<locals>.P1.meth1  r  r[   NrN  r_   r[   rY   rO  re    r  r[   rO  c                       e Zd Zd Zy)3ProtocolTests.test_subprotocols_merging.<locals>.P2c                      y rS   r_   r   s    rY   rS  z9ProtocolTests.test_subprotocols_merging.<locals>.P2.meth2#  r  r[   NrT  r_   r[   rY   r8  rh  "  r  r[   r8  c                       e Zd Zy)2ProtocolTests.test_subprotocols_merging.<locals>.PNrp   r_   r[   rY   r  rk  &  r  r[   r  c                       e Zd Zd Zd Zy)2ProtocolTests.test_subprotocols_merging.<locals>.Cc                      y rS   r_   r   s    rY   rM  z8ProtocolTests.test_subprotocols_merging.<locals>.C.meth1+  r  r[   c                      y rS   r_   r   s    rY   rS  z8ProtocolTests.test_subprotocols_merging.<locals>.C.meth2.  r  r[   NrY  r_   r[   rY   r7  rm  *  rZ  r[   r7  c                       e Zd Zd Zy)3ProtocolTests.test_subprotocols_merging.<locals>.C1c                      y rS   r_   r   s    rY   rM  z9ProtocolTests.test_subprotocols_merging.<locals>.C1.meth12  r  r[   NrN  r_   r[   rY   r&  rq  1  r  r[   r&  c                       e Zd Zd Zy)3ProtocolTests.test_subprotocols_merging.<locals>.C2c                      y rS   r_   r   s    rY   rS  z9ProtocolTests.test_subprotocols_merging.<locals>.C2.meth26  r  r[   NrT  r_   r[   rY   r'  rt  5  r  r[   r'  ra  )rW   rO  r8  r  r7  r&  r'  s          rY   test_subprotocols_mergingz'ProtocolTests.test_subprotocols_merging  s    	 		 	 
	B 	 
		 		 		 	 	  q)  q)  Q'  Q'ac1%a#r[   c                    t        d      }t         G d dt                     }t         G d dt        |                } G d dt              } G d d	t        |         } G d
 d      }| j                  ||       | j                  ||       | j                  ||       d}| j	                  t
        |      5  t        |||          d d d        | j	                  t
        |      5  t        |||          d d d        d}| j	                  t
        |      5  t        ||       d d d        | j	                  t
        |      5  t        ||       d d d        | j	                  t
        |      5  t        |||          d d d        | j	                  t
        |      5  t        ||t                  d d d        d}	| j	                  t
        |	      5  t        d|       d d d        | j	                  t
        |	      5  t        d|       d d d        | j	                  t
        |	      5  t        d|       d d d        | j	                  t
        |	      5  t        d|       d d d        y # 1 sw Y   xY w# 1 sw Y   ~xY w# 1 sw Y   ^xY w# 1 sw Y   @xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)Nr   c                       e Zd Zd Zy)2ProtocolTests.test_protocols_issubclass.<locals>.Pc                      y rS   r_   r   s    rY   r   z4ProtocolTests.test_protocols_issubclass.<locals>.P.xE      r[   Nr\   r]   r^   r   r_   r[   rY   r  ry  C      r[   r  c                       e Zd Zd Zy)3ProtocolTests.test_protocols_issubclass.<locals>.PGc                      y rS   r_   r   s    rY   r   z5ProtocolTests.test_protocols_issubclass.<locals>.PG.xI  r{  r[   Nr|  r_   r[   rY   r$  r  G  r}  r[   r$  c                       e Zd Zd Zy)5ProtocolTests.test_protocols_issubclass.<locals>.BadPc                      y rS   r_   r   s    rY   r   z7ProtocolTests.test_protocols_issubclass.<locals>.BadP.xL  r{  r[   Nr|  r_   r[   rY   BadPr  K      r[   r  c                       e Zd Zd Zy)6ProtocolTests.test_protocols_issubclass.<locals>.BadPGc                      y rS   r_   r   s    rY   r   z8ProtocolTests.test_protocols_issubclass.<locals>.BadPG.xO  r{  r[   Nr|  r_   r[   rY   BadPGr  N  r  r[   r  c                       e Zd Zd Zy)2ProtocolTests.test_protocols_issubclass.<locals>.Cc                      y rS   r_   r   s    rY   r   z4ProtocolTests.test_protocols_issubclass.<locals>.C.xR  r{  r[   Nr|  r_   r[   rY   r7  r  Q  r  r[   r7  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 classrb   )r   r*   r'   r  r   r~   r   r   )
rW   r   r  r$  r  r  r7  no_subscripted_generics only_runtime_checkable_protocolsonly_classes_alloweds
             rY   test_protocols_issubclassz'ProtocolTests.test_protocols_issubclass@  sn   CL		 	 
	 
	! 	 
		8 		HQK 		 	 	a#a$dB' Q 	  ##I/FGq"Q%  H##I/FGq"Q%  H+ 	)
 ##I/OPq$ Q##I/OPq%  Q ##I/FGq"Q%  H##I/FGr2c7# H  G##I/CDq! E##I/CDq" E##I/CDq$ E##I/CDq%  ED9 HGGG QPPP HGGG
 EDDDDDDDsx   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 rS   r_   r   s    rY   r  z_ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.CallableMembersProto.meth~      Cr[   Nr  r_   r[   rY   CallableMembersProtor  |      r[   r  c                       e Zd Zd Zy)TProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.IdenticalProtoc                      y rS   r_   r   s    rY   r  zYProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.IdenticalProto.meth  r  r[   Nr  r_   r[   rY   IdenticalProtor    s    r[   r  c                       e Zd Zd Zd Zy)SProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.SupersetProtoc                      y rS   r_   r   s    rY   r  zXProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.SupersetProto.meth  r  r[   c                      y rS   r_   r   s    rY   rS  zYProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.SupersetProto.meth2      Sr[   N)r\   r]   r^   r  rS  r_   r[   rY   SupersetProtor    s     r[   r  c                   "    e Zd ZU eg df   ed<   y)]ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NonCallableMembersProtoNr  r\   r]   r^   r"   r   r_   r[   rY   NonCallableMembersProtor        2t8$$r[   r  c                   :    e Zd ZU eg df   ed<   eeegef   ed<   y)eProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NonCallableMembersSupersetProtoNr  rS  )r\   r]   r^   r"   r   r   r   r  r_   r[   rY   NonCallableMembersSupersetProtor    s%    2t8$$S#J,--r[   r  c                   (    e Zd ZU eg df   ed<   d Zy)XProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.MixedMembersProto1Nr  c                      y rS   r_   r   s    rY   rS  z^ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.MixedMembersProto1.meth2  r  r[   )r\   r]   r^   r"   r   rS  r_   r[   rY   MixedMembersProto1r        2t8$$ r[   r  c                   ,    e Zd ZU d Zeeegef   ed<   y)XProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.MixedMembersProto2c                      y rS   r_   r   s    rY   r  z]ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.MixedMembersProto2.meth  r  r[   rS  N)	r\   r]   r^   r  r"   r   r   r  r   r_   r[   rY   MixedMembersProto2r    s    S#J,--r[   r  rd   c                       e Zd Zy)SProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.EmptyProtocolNrp   r_   r[   rY   EmptyProtocolr    r   r[   r  c                       e Zd Zd Zy)WProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.UnrelatedProtocolc                      y rS   r_   r   s    rY   wutz[ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.UnrelatedProtocol.wut      3r[   N)r\   r]   r^   r  r_   r[   rY   UnrelatedProtocolr    s    r[   r  c                   "    e Zd ZU eg df   ed<   y)^ProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.AnnotatedButNotAProtocolNr  r  r_   r[   rY   AnnotatedButNotAProtocolr    r  r[   r  c                       e Zd Zd Zy)gProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclassc                      y rS   r_   r   s    rY   r  zlProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass.meth      Dr[   Nr  r_   r[   rY   !NotAProtocolButAnImplicitSubclassr         r[   r  c                   (    e Zd ZU eg df   ed<   d Zy)hProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass2Nr  c                      y rS   r_   r   s    rY   r  zmProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass2.meth  r  r[   )r\   r]   r^   r"   r   r  r_   r[   rY   "NotAProtocolButAnImplicitSubclass2r    r  r[   r  c                   F    e Zd ZU eg df   ed<   eeegef   ed<   d Zd Z	y)hProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass3Nr  rS  c                      y rS   r_   r   s    rY   r  zmProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass3.meth  r  r[   c                      y)NTr_   rW   r   r   s      rY   rS  znProtocolTests.test_implicit_issubclass_between_two_protocols.<locals>.NotAProtocolButAnImplicitSubclass3.meth2  s    $r[   )
r\   r]   r^   r"   r   r   r   r  r  rS  r_   r[   rY   "NotAProtocolButAnImplicitSubclass3r    s+    2t8$$S#J,-- .r[   r  )r*   r'   ri   r\   r  r  )rW   r  r  r  r  r  r  r  re   r  r  r  r  r  r  s                  rY   .test_implicit_issubclass_between_two_protocolsz<ProtocolTests.test_implicit_issubclass_between_two_protocols{  sf   		 8 	  
	 	 X 	 	!H 	!	%h 	%	.h 	.	! 	!	. 	.
 M+B+-?AS
E ENN3%%e-AB 43	
 	+H*	 	 	  0DE  !24HI	% 	%	! 	!	! 	!	/ 	/ 	  !9;OP?AUV@BVW@BVWK 43s   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>.FooNrp   r_   r[   rY   r   r    r   r[   r   )
addCleanupgcenabledisabler   r~   r  r{  r  r'   r   r  s     rY   (test_isinstance_checks_not_at_whim_of_gcz6ProtocolTests.test_isinstance_checks_not_at_whim_of_gc  ss    		"


##=
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 rS   r_   r   s    rY   r   zLProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.C.x  s    r[   Nr|  r_   r[   rY   r7  r    s    r[   r7  ra  r  rb   r   c                       e Zd Zy)VProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.EmptyProtocolNrp   r_   r[   rY   r  r    s    '+r[   r  c                       e Zd ZdedefdZy)[ProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.SupportsStartsWithr   r   c                      y rS   r_   r   s     rY   
startswithzfProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.SupportsStartsWith.startswith  s    #r[   Nr\   r]   r^   r   r  r  r_   r[   rY   SupportsStartsWithr    s    5C5D5r[   r  c                       e Zd Zd Zy)RProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.SupportsXc                      y rS   r_   r   s    rY   r   zTProtocolTests.test_issubclass_and_isinstance_on_Protocol_itself.<locals>.SupportsX.x  r{  r[   Nr|  r_   r[   rY   	SupportsXr    r}  r[   r  rd   )r  r  r'   r   r   r   r~   r   r   r*   ri   r\   r  r   )rW   r7  r  r   r  r  r  re   s           rY   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(# E##I/CDuh' E##I/CDqsH% E CL	+H+ 
+		6 	6 
	6 
	 	 
	 #$6	AEENN3%%eX6 43 B 	fm4fh6  2  84c#56e%78  h/  1a+ac9-  H-  h/U EDDDDD" 43s0   <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>.Crb   Nr|  r_   r[   rY   r7  r        Ar[   r7  c                       e Zd ZdZy)FProtocolTests.test_protocols_issubclass_non_callable.<locals>.PNonCallrb   Nr|  r_   r[   rY   PNonCallr        Ar[   r  <Protocols with non-method members don't support issubclass()c                       e Zd Zy)?ProtocolTests.test_protocols_issubclass_non_callable.<locals>.DNrp   r_   r[   rY   r:  r  %  r   r[   r:  )
r*   r'   r   r~   r   r   registerr  r   r  )rW   r7  r  non_callable_members_illegalr:  s        rY   &test_protocols_issubclass_non_callablez4ProtocolTests.test_protocols_issubclass_non_callable  sG   	 	 
	x 	 
	 K 	% ##I/KLq(# M 	ac8,!##I/KLq(# M 	ac8, 	  A&  a(	

1a#ac1%##I/KLq(# ML) ML ML MLs#   EE!>E-E!E*-E6c                     t          G d dt                     } G d d      }| j                   |       |       | j                  t        d      5  t        ||       d d d        y # 1 sw Y   y xY w)Nc                       e Zd ZU eed<   y)RProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance.<locals>.Spamr   Nr  r_   r[   rY   Spamr  1  r  r[   r  c                       e Zd ZddZy)RProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance.<locals>.EggsNc                     d| _         y r{   r   r   s    rY   r   z[ProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance.<locals>.Eggs.__init__6  s	    r[   r   Nr   r_   r[   rY   Eggsr  5  s    r[   r  r  )r*   r'   r   r   r~   r   rW   r  r  s      rY   6test_no_weird_caching_with_issubclass_after_isinstancezDProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance0  sk    		8 	 
		 	 	dfd+ ##J
 tT"	
 
 
   A&&A/c                     t          G d dt                     } G d d      }| j                   |       |       | j                  t        d      5  t        ||       d d d        y # 1 sw Y   y xY w)Nc                       e Zd ZU eed<   y)TProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_2.<locals>.Spamr   Nr  r_   r[   rY   r  r  G  r  r[   r  c                       e Zd Zy)TProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_2.<locals>.EggsNrp   r_   r[   rY   r  r
  K  r   r[   r  r  r*   r'   r   r   r~   r   r  s      rY   8test_no_weird_caching_with_issubclass_after_isinstance_2zFProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_2F  sf    		8 	 
	 	  . ##J
 tT"	
 
 
r  c                     t          G d dt                     } G d d      }| j                   |       |       | j                  t        d      5  t        ||       d d d        y # 1 sw Y   y xY w)Nc                       e Zd ZU eed<   y)TProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_3.<locals>.Spamr   Nr  r_   r[   rY   r  r  [  r  r[   r  c                       e Zd Zd Zy)TProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_3.<locals>.Eggsc                 $    |dk(  ryt        |      )Nr   r|   AttributeErrorrW   r  s     rY   __getattr__z`ProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_3.<locals>.Eggs.__getattr__`  s    3;$T**r[   Nr\   r]   r^   r  r_   r[   rY   r  r  _  s    +r[   r  r  r  r  s      rY   8test_no_weird_caching_with_issubclass_after_isinstance_3zFProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_3Z  sk    		8 	 
		+ 	+ 	  . ##J
 tT"	
 
 
r  c                     t          d               } d        }| j                   |d      |       | j                  t        d      5  t	        ||       d d d        y # 1 sw Y   y xY w)Nc                  >    d xf G fdd
} t         |       S )r   c                   "    e Zd ZW  ZU W ed<   y)YProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695.<locals>.Spamr   Nr\   r]   r^   rl  r   r  s   rY   r  r  s  s
     Dr[   r  r  r  s    @@rY   z<generic parameters of Spam>zqProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695.<locals>.<generic parameters of Spam>s  s     	 	h 	r[   c                  4    d xf G fdd
} |       S )r   c                   &    e Zd ZW  ZdW ddfdZy)YProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695.<locals>.Eggsr   r   Nc                     || _         y rS   r   r   s     rY   r   zbProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695.<locals>.Eggs.__init__x  r   r[   )r\   r]   r^   rl  r   r  s   rY   r  r   w  s    !  r[   r  r_   r  s    @@rY   z<generic parameters of Eggs>zqProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695.<locals>.<generic parameters of Eggs>w  s    1 	 	 	r[   r|   r  )r*   r   r   r~   r   r  s      rY   =test_no_weird_caching_with_issubclass_after_isinstance_pep695zKProtocolTests.test_no_weird_caching_with_issubclass_after_isinstance_pep695r  sa    		 
		 	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 rS   r_   r   s    rY   r  z7ProtocolTests.test_protocols_isinstance.<locals>.P.meth  r{  r[   Nr  r_   r[   rY   r  r%    r}  r[   r  c                       e Zd Zd Zy)3ProtocolTests.test_protocols_isinstance.<locals>.PGc                      y rS   r_   r   s    rY   r  z8ProtocolTests.test_protocols_isinstance.<locals>.PG.meth  r{  r[   Nr  r_   r[   rY   r$  r(    r}  r[   r$  c                   $    e Zd Zej                  Zy);ProtocolTests.test_protocols_isinstance.<locals>.WeirdProtoN)r\   r]   r^   r   	maketransr  r_   r[   rY   
WeirdProtor+    s    ==Dr[   r-  c                       e Zd Zd Zy)<ProtocolTests.test_protocols_isinstance.<locals>.WeirdProto2c                       y rS   r_   r   r   s     rY   <lambda>zEProtocolTests.test_protocols_isinstance.<locals>.WeirdProto2.<lambda>  s    4r[   Nr  r_   r[   rY   WeirdProto2r/    s    /Dr[   r3  c                       e Zd Zd Zy)?ProtocolTests.test_protocols_isinstance.<locals>.CustomCallablec                      y rS   r_   r   s      rY   r2  zHProtocolTests.test_protocols_isinstance.<locals>.CustomCallable.__call__  r  r[   Nr4  r_   r[   rY   CustomCallabler5    r  r[   r7  c                       e Zd Z W         Zy)=ProtocolTests.test_protocols_isinstance.<locals>.WeirderProtoNr  )r7  s   rY   WeirderProtor9    s    !#Dr[   r:  c                       e Zd Zd Zy)5ProtocolTests.test_protocols_isinstance.<locals>.BadPc                      y rS   r_   r   s    rY   r  z:ProtocolTests.test_protocols_isinstance.<locals>.BadP.meth  r{  r[   Nr  r_   r[   rY   r  r<    r  r[   r  c                       e Zd Zd Zy)6ProtocolTests.test_protocols_isinstance.<locals>.BadPGc                      y rS   r_   r   s    rY   r  z;ProtocolTests.test_protocols_isinstance.<locals>.BadPG.meth  r{  r[   Nr  r_   r[   rY   r  r?    r  r[   r  c                       e Zd Zd Zy)2ProtocolTests.test_protocols_isinstance.<locals>.Cc                      y rS   r_   r   s    rY   r  z7ProtocolTests.test_protocols_isinstance.<locals>.C.meth  r{  r[   Nr  r_   r[   rY   r7  rB    r  r[   r7  c                       e Zd Zd Zy)3ProtocolTests.test_protocols_isinstance.<locals>.C2c                     d | _         y )Nc                       y rS   r_   r_   r[   rY   r2  zNProtocolTests.test_protocols_isinstance.<locals>.C2.__init__.<locals>.<lambda>  s    Dr[   )r  r   s    rY   r   z<ProtocolTests.test_protocols_isinstance.<locals>.C2.__init__  s	    (	r[   Nr   r_   r[   rY   r'  rE        )r[   r'  )klassre   r  r  )	r   r*   r'   ri   r\   r   r   r~   r   )rW   r   r  r$  r-  r3  r:  r  r  r7  r'  rI  re   r  only_runtime_checkable_msgr7  s                  @rY   test_protocols_isinstancez'ProtocolTests.test_protocols_isinstance  s    CL		 	 
	 
	! 	 
	 
	! 	! 
	! 
	0( 	0 
	0	 	 
	$8 	$ 
	$	8 		HQK 		 		) 	) UEB
KE\\enn\M))%'59 NM F 
 #g##I/FGqsBqE" H##I/FGqsBqE" H0 	#
 ##I/IJqsD! K##I/IJqsE" KJ# NM
 HGGG KJJJs<   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{   r_   r   s    rY   r  zRProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.C.attr      r[   Nr\   r]   r^   propertyr  r_   r[   rY   r7  rN    s     r[   r7  c                       e Zd ZddZy)\ProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.CustomDescriptorNc                      yr{   r_   rW   objobjtypes      rY   __get__zdProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.CustomDescriptor.__get__  rG  r[   rS   r\   r]   r^   rY  r_   r[   rY   CustomDescriptorrT    s    r[   r[  c                       e Zd Z W         Zy)MProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.DNr\   r]   r^   r  r[  s   rY   r:  r]        #%Dr[   r:  c                       e Zd Zy)MProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.ENrp   r_   r[   rY   r  rb    r   r[   r  c                       e Zd Zy)MProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.FNrp   r_   r[   rY   r  rd    r   r[   r  c                       e Zd Zy)QProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.EmptyNrp   r_   r[   rY   r   rf    r   r[   r   r   c                       e Zd Zed        Zy)MProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.Pc                      y rS   r_   r   s    rY   r  zRProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.P.attr      r[   NrQ  r_   r[   rY   r  rh         r[   r  c                       e Zd ZU eed<   y)NProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.P1r  Nr  r_   r[   rY   rO  rm        Ir[   rO  c                       e Zd Zed        Zy)NProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.PGc                      y rS   r_   r   s    rY   r  zSProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.PG.attr  rj  r[   NrQ  r_   r[   rY   r$  rp    rk  r[   r$  c                       e Zd ZU W  ed<   y)OProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.PG1r  Nr\   r]   r^   r   r   s   rY   PG1rs        Gr[   rv  c                       e Zd Zd Zy)SProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.MethodPc                      y rS   r_   r   s    rY   r  zXProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.MethodP.attr  r  r[   Nr^  r_   r[   rY   MethodPry    r  r[   r{  c                       e Zd ZdW  fdZy)TProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.MethodPGr   c                      y rS   r_   r   s    rY   r  zYProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.MethodPG.attr  r  r[   Nr^  ru  s   rY   MethodPGr}        $a$r[   r  rI  protocol_classc                       e Zd Zed        Zy)PProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadPc                      y rS   r_   r   s    rY   r  zUProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadP.attr  rj  r[   NrQ  r_   r[   rY   r  r         r[   r  c                       e Zd ZU eed<   y)QProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadP1r  Nr  r_   r[   rY   BadP1r        Ir[   r  c                       e Zd Zed        Zy)QProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadPGc                      y rS   r_   r   s    rY   r  zVProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadPG.attr	  rj  r[   NrQ  r_   r[   rY   r  r    r  r[   r  c                       e Zd ZU W  ed<   y)RProtocolTests.test_protocols_isinstance_properties_and_descriptors.<locals>.BadPG1r  Nrt  ru  s   rY   BadPG1r    s    Gr[   r  )rI  rW  )
r   r*   r'   ri   r\   r   r   r}   r~   r   )rW   r7  r:  r  r  r   r  rO  r$  rv  r{  r  r  rI  r  r  r  r  casesrW  r[  r   s                       @@rY   4test_protocols_isinstance_properties_and_descriptorszBProtocolTests.test_protocols_isinstance_properties_and_descriptors  s~   	 	
	 		& 	&
 	CL		  	  
	  
	 	 
	 
	 ! 	  
	  
	(1+ 	 
	 
	 h 	  
	  
	%x{ 	% 
	%  Rgx?NAq!\\..#1#:#: "  ))%'>B	  $ GN<S<ST((.A UT @	 8 	 	H 		 HQK 	 	Xa[ 	 qE2a5#a&#a&(1+QKueV

 CAq!U*\\C\@**95"57C0 6 A@ + 9  UT2 65 A@s<   &I%II8+I,	=I8II)	,I51I88Jc                     t          G d dt                     } G d d      } G d d      }| j                   |       |       | j                   |       |       y )Nc                       e Zd ZU eed<   y)NProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.HasXr   Nr  r_   r[   rY   r  r    r  r[   r  c                       e Zd ZdZd Zy)XProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.CustomDirWithXr  c                     g S rS   r_   r   s    rY   __dir__z`ProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.CustomDirWithX.__dir__!      	r[   N)r\   r]   r^   r   r  r_   r[   rY   CustomDirWithXr    s    Ar[   r  c                       e Zd Zd Zy)[ProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.CustomDirWithoutXc                     dgS Nr   r_   r   s    rY   r  zcProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir.<locals>.CustomDirWithoutX.__dir__%  s	    ur[   N)r\   r]   r^   r  r_   r[   rY   CustomDirWithoutXr  $      r[   r  r  )rW   r  r  r  s       rY   2test_protocols_isinstance_not_fooled_by_custom_dirz@ProtocolTests.test_protocols_isinstance_not_fooled_by_custom_dir  sX    		8 	 
		 	
	 	 	n.5  !2!4d;r[   c                 @    G d d      } G d d       G fdd      } G d d|      } G d	 d
|      } G d d      }t        d      t         G d dt                     }t         G d dt                     }t         G d dt                        }t         G fddt                        }	t         G d dt                     }
t         G fddt                        }||||	|
|fD ]  }||||fD ]I  }| j                  |j                  |j                        5  | j                   |       |       d d d        K | j                  d|j                        5  | j                   |       |       d d d         y # 1 sw Y   xY w# 1 sw Y   xY w)Nc                       e Zd Zed        Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.Cc                     t        d      )Nnor  r   s    rY   r  zZProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.C.attr-  s    $T**r[   NrQ  r_   r[   rY   r7  r  ,  s    + +r[   r7  c                       e Zd ZddZy)dProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.CustomDescriptorNc                     t        d      NNORuntimeErrorrV  s      rY   rY  zlProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.CustomDescriptor.__get__2      "4((r[   rS   rZ  r_   r[   rY   r[  r  1  s    )r[   r[  c                       e Zd Z W         Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.DNr^  r_  s   rY   r:  r  5  r`  r[   r:  c                       e Zd Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.ENrp   r_   r[   rY   r  r  :  r   r[   r  c                       e Zd Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.FNrp   r_   r[   rY   r  r  ;  r   r[   r  c                       e Zd Zd Zy)eProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.WhyWouldYouDoThisc                     t        d      )Nr  r  )rW   r  s     rY   r  zqProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.WhyWouldYouDoThis.__getattr__>  s    "5))r[   Nr  r_   r[   rY   WhyWouldYouDoThisr  =  s    *r[   r  r   c                       e Zd Zed        Zy)UProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.Pc                      y rS   r_   r   s    rY   r  zZProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.P.attrE  rj  r[   NrQ  r_   r[   rY   r  r  C  rk  r[   r  c                       e Zd ZU eed<   y)VProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.P1r  Nr  r_   r[   rY   rO  r  H  rn  r[   rO  c                       e Zd Zed        Zy)VProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.PGc                      y rS   r_   r   s    rY   r  z[ProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.PG.attrN  rj  r[   NrQ  r_   r[   rY   r$  r  L  rk  r[   r$  c                       e Zd ZU W  ed<   y)WProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.PG1r  Nrt  ru  s   rY   rv  r  Q  rw  r[   rv  c                       e Zd Zd Zy)[ProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.MethodPc                      y rS   r_   r   s    rY   r  z`ProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.MethodP.attrW  r  r[   Nr^  r_   r[   rY   r{  r  U  r  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 rS   r_   r   s    rY   r  zaProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects.<locals>.MethodPG.attr[  r  r[   Nr^  ru  s   rY   r  r  Y  r  r[   r  r  )r   r*   r'   ri   r\   r   r   )rW   r7  r:  r  r  r  r  rO  r$  rv  r{  r  r  rI  r[  r   s                 @@rY   <test_protocols_isinstance_attribute_access_with_side_effectszJProtocolTests.test_protocols_isinstance_attribute_access_with_side_effects+  s   	+ 	+
	) 	)	& 	&
 		* 	* CL		  	  
	  
	 	 
	 
	 ! 	  
	  
	(1+ 	 
	 
	 h 	  
	  
	%x{ 	% 
	%  Rgx?NAq!\\..#1#:#: "  ))%'>B	  $ )-66   (():)<nM	  @  s   &F%FFF	c                 v    t          G d dt                     } G d d      }| j                   |       |       y )Nc                       e Zd ZU eed<   y)?ProtocolTests.test_protocols_isinstance___slots__.<locals>.HasXr   Nr  r_   r[   rY   r  r  n  r  r[   r  c                       e Zd ZdZy)MProtocolTests.test_protocols_isinstance___slots__.<locals>.HasNothingButSlotsr   Nr\   r]   r^   	__slots__r_   r[   rY   HasNothingButSlotsr  r  s    Ir[   r  r*   r'   r   )rW   r  r  s      rY   #test_protocols_isinstance___slots__z1ProtocolTests.test_protocols_isinstance___slots__k  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 rS   r   r   r  )rW   r   r   r  s       rY   r   zEProtocolTests.test_protocols_isinstance_py36.<locals>.APoint.__init__y  s    "
r[   Nr   r_   r[   rY   APointr  x  s    #r[   r  c                       e Zd ZdZd Zy)<ProtocolTests.test_protocols_isinstance_py36.<locals>.BPointr   c                      || _         || _        y rS   r   r   r  s      rY   r   zEProtocolTests.test_protocols_isinstance_py36.<locals>.BPoint.__init__  s    r[   N)r\   r]   r^   r  r   r_   r[   rY   BPointr  ~  s    Er[   r  c                       e Zd Zd Zd Zy)7ProtocolTests.test_protocols_isinstance_py36.<locals>.Cc                     || _         y rS   r  r  s     rY   r   z@ProtocolTests.test_protocols_isinstance_py36.<locals>.C.__init__  	     	r[   c                      yrX  r_   r  s     rY   r  z<ProtocolTests.test_protocols_isinstance_py36.<locals>.C.meth      r[   N)r\   r]   r^   r   r  r_   r[   rY   r7  r    s    !r[   r7  c                       e Zd Zy)9ProtocolTests.test_protocols_isinstance_py36.<locals>.BadNrp   r_   r[   rY   Badr    r   r[   r  rb   r   r   r|   )	r   r  r   r  r  r  r  r  r  )rW   r  r  r7  r  s        rY   test_protocols_isinstance_py36z,ProtocolTests.test_protocols_isinstance_py36w  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>.Prb   Nr|  r_   r[   rY   r  r    r  r[   r  c                       e Zd ZdZy)8ProtocolTests.test_protocols_isinstance_init.<locals>.PGrb   Nr|  r_   r[   rY   r$  r    r  r[   r$  c                       e Zd Zd Zy)7ProtocolTests.test_protocols_isinstance_init.<locals>.Cc                     || _         y rS   r   r   s     rY   r   z@ProtocolTests.test_protocols_isinstance_init.<locals>.C.__init__  r   r[   Nr   r_   r[   rY   r7  r    r   r[   r7  rb   )r   r*   r'   r   )rW   r   r  r$  r7  s        rY   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>.HasXr   Nr  r_   r[   rY   r  r    r  r[   r  c                       e Zd Zy)CProtocolTests.test_protocols_isinstance_monkeypatching.<locals>.FooNrp   r_   r[   rY   r   r    r   r[   r   r|   )r*   r'   r   r   r   )rW   r  r   rX   s       rY   (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>.PNrp   r_   r[   rY   r  r    r   r[   r  c                       e Zd Zy)=ProtocolTests.test_protocol_checks_after_subscript.<locals>.CNrp   r_   r[   rY   r7  r    r   r[   r7  c                       e Zd Zy)BProtocolTests.test_protocol_checks_after_subscript.<locals>.Other1Nrp   r_   r[   rY   Other1r     r   r[   r  c                       e Zd Zy)BProtocolTests.test_protocol_checks_after_subscript.<locals>.Other2Nrp   r_   r[   rY   Other2r    r   r[   r  c                       e Zd Zy)>ProtocolTests.test_protocol_checks_after_subscript.<locals>.D1Nrp   r_   r[   rY   D1r    r   r[   r  c                       e Zd Zy)>ProtocolTests.test_protocol_checks_after_subscript.<locals>.D2Nrp   r_   r[   rY   D2r	    r   r[   r
  )r'   r   r   r   r  r   r   r  )	rW   r  r7  r  r  CAr  r
  CIs	            rY   $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>.Prb   Nr|  r_   r[   rY   r  r    r  r[   r  c                       e Zd Zd Zy)9ProtocolTests.test_protocols_support_register.<locals>.PMc                      y rS   r_   r   s    rY   r  z>ProtocolTests.test_protocols_support_register.<locals>.PM.meth  r  r[   Nr  r_   r[   rY   PMr    r  r[   r  c                       e Zd Zy)8ProtocolTests.test_protocols_support_register.<locals>.DNrp   r_   r[   rY   r:  r    r   r[   r:  c                       e Zd Zy)8ProtocolTests.test_protocols_support_register.<locals>.CNrp   r_   r[   rY   r7  r    r   r[   r7  )r*   r'   r  r   )rW   r  r  r:  r7  s        rY   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>.Prb   Nr|  r_   r[   rY   r  r    r  r[   r  c                       e Zd ZdZy)NProtocolTests.test_none_on_non_callable_doesnt_block_implementation.<locals>.Arb   Nr|  r_   r[   rY   r   r    r  r[   r   c                       e Zd ZdZy)NProtocolTests.test_none_on_non_callable_doesnt_block_implementation.<locals>.BNr|  r_   r[   rY   r   r         Ar[   r   c                       e Zd Zd Zy)NProtocolTests.test_none_on_non_callable_doesnt_block_implementation.<locals>.Cc                     d | _         y rS   r   r   s    rY   r   zWProtocolTests.test_none_on_non_callable_doesnt_block_implementation.<locals>.C.__init__  	    r[   Nr   r_   r[   rY   r7  r#        r[   r7  r  rW   r  r   r   r7  s        rY   5test_none_on_non_callable_doesnt_block_implementationzCProtocolTests.test_none_on_non_callable_doesnt_block_implementation  sa    		 	 
		 		 		 	 	ac1%ac1%r[   c                     t          G d dt                     } G d d      } G d d|      } G d d      }| j                   |       |       | j                   |       |       y )	Nc                       e Zd Zd Zy)DProtocolTests.test_none_on_callable_blocks_implementation.<locals>.Pc                      y rS   r_   r   s    rY   r   zFProtocolTests.test_none_on_callable_blocks_implementation.<locals>.P.x  r{  r[   Nr|  r_   r[   rY   r  r+    r}  r[   r  c                       e Zd Zd Zy)DProtocolTests.test_none_on_callable_blocks_implementation.<locals>.Ac                      y rS   r_   r   s    rY   r   zFProtocolTests.test_none_on_callable_blocks_implementation.<locals>.A.x  r{  r[   Nr|  r_   r[   rY   r   r.    r  r[   r   c                       e Zd ZdZy)DProtocolTests.test_none_on_callable_blocks_implementation.<locals>.BNr|  r_   r[   rY   r   r1    r!  r[   r   c                       e Zd Zd Zy)DProtocolTests.test_none_on_callable_blocks_implementation.<locals>.Cc                     d | _         y rS   r   r   s    rY   r   zMProtocolTests.test_none_on_callable_blocks_implementation.<locals>.C.__init__  r%  r[   Nr   r_   r[   rY   r7  r3    r&  r[   r7  )r*   r'   r   r'  s        rY   +test_none_on_callable_blocks_implementationz9ProtocolTests.test_none_on_callable_blocks_implementation  sa    		 	 
		 		 		 	 	  a(  a(r[   c                     G d dt               }t         G d dt                      } G d d|      } G d d|      } G d	 d
t        j                        } G d dt        j                        }| j	                   |       |       | j	                   |       |       | j                  ||       | j                  ||       | j                   |       |       | j                  ||       | j                  dt        |             | j                  dt        |             | j                  dt        |             | j                  dt        |             h d}| j                  t        |      j                         t        |      j                         |z         | j                  t        |      j                         t        |      j                         |z         y )Nc                       e Zd ZdZy)5ProtocolTests.test_non_protocol_subclasses.<locals>.Prb   Nr|  r_   r[   rY   r  r8    r  r[   r  c                       e Zd Zd Zy)6ProtocolTests.test_non_protocol_subclasses.<locals>.PRc                      y rS   r_   r   s    rY   r  z;ProtocolTests.test_non_protocol_subclasses.<locals>.PR.meth  r  r[   Nr  r_   r[   rY   PRr:         r[   r<  c                       e Zd ZdZy)8ProtocolTests.test_non_protocol_subclasses.<locals>.NonPrb   Nr|  r_   r[   rY   NonPr?  
  r  r[   r@  c                       e Zd Zy)9ProtocolTests.test_non_protocol_subclasses.<locals>.NonPRNrp   r_   r[   rY   NonPRrB    r   r[   rC  c                       e Zd ZdZy)5ProtocolTests.test_non_protocol_subclasses.<locals>.Crb   Nr|  r_   r[   rY   r7  rE    r  r[   r7  r  c                       e Zd Zd Zy)5ProtocolTests.test_non_protocol_subclasses.<locals>.Dc                      y rS   r_   r   s    rY   r  z:ProtocolTests.test_non_protocol_subclasses.<locals>.D.meth  r  r[   Nr  r_   r[   rY   r:  rG    r  r[   r:  __protocol_attrs____non_callable_proto_members__>   r   _is_protocolr  r   __subclasshook___is_runtime_protocol)r'   r*   r{  ABCMetar   r  r   r  assertNotInvarsassertLessEqualkeys)rW   r  r<  r@  rC  r7  r:  acceptable_extra_attrss           rY   test_non_protocol_subclassesz*ProtocolTests.test_non_protocol_subclasses  s   	 	 
	! 	! 
	!	1 	 	B	#++ 		!#++ 	! 	  d+  e,  D)  E*egr*eR(-tDz:-tE{;94:F94;G"
 	T$Z__.QAW0WXKQ1G G	
r[   c                     G d dt               } G d d      } G d d      } G d d|      }| j                   |       |       | j                   |       |       | j                  ||       | j	                  ||       y )	Nc                       e Zd ZdZy)1ProtocolTests.test_custom_subclasshook.<locals>.Prb   Nr|  r_   r[   rY   r  rW  +  r  r[   r  c                       e Zd Zy)7ProtocolTests.test_custom_subclasshook.<locals>.OKClassNrp   r_   r[   rY   OKClassrY  .  r   r[   rZ  c                       e Zd ZdZy)8ProtocolTests.test_custom_subclasshook.<locals>.BadClassrb   Nr|  r_   r[   rY   BadClassr\  0  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)r\   r  r  others     rY   rL  zBProtocolTests.test_custom_subclasshook.<locals>.C.__subclasshook__4  s    ~~0066r[   Nr\   r]   r^   classmethodrL  r_   r[   rY   r7  r_  3  s    7 7r[   r7  )r'   r   r   r  r  )rW   r  rZ  r]  r7  s        rY   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>.HasXrb   c                     t        |d      S r  hasattrrc  s     rY   rL  zGProtocolTests.test_custom_subclasshook_2.<locals>.HasX.__subclasshook__E      uc**r[   N)r\   r]   r^   r   rf  rL  r_   r[   rY   r  rj  >  s    
 A+ +r[   r  c                       e Zd Zy)7ProtocolTests.test_custom_subclasshook_2.<locals>.EmptyNrp   r_   r[   rY   r   rp  I  r   r[   r   c                       e Zd ZdZy)@ProtocolTests.test_custom_subclasshook_2.<locals>.ImplementsHasXrb   Nr|  r_   r[   rY   ImplementsHasXrr  K  r  r[   rs  c                       e Zd Zed        Zy)EProtocolTests.test_custom_subclasshook_2.<locals>.NotRuntimeCheckablec                     t        |d      S r  rl  rc  s     rY   rL  zVProtocolTests.test_custom_subclasshook_2.<locals>.NotRuntimeCheckable.__subclasshook__W  rn  r[   Nre  r_   r[   rY   NotRuntimeCheckableru  V  s    + +r[   rw  r  )r*   r'   r   r   r  r  r   r~   r   r  r   )rW   r  r   rs  rw  must_be_runtime_checkables         rY   test_custom_subclasshook_2z(ProtocolTests.test_custom_subclasshook_2=  s    		+8 	+ 
	+ 		 	 	n.5  $/nd3  -
	+( 	+0 	"
 ##I/HIv23 J##I/HIvx!45 JI JIIIs   &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>.Prb   Nr|  r_   r[   rY   r  r|  f  r  r[   r  c                       e Zd Zy)8ProtocolTests.test_issubclass_fails_correctly.<locals>.CNrp   r_   r[   rY   r7  r~  j  r   r[   r7  r  )r*   r'   r   r~   r   rW   r  r7  s      rY   test_issubclass_fails_correctlyz-ProtocolTests.test_issubclass_fails_correctlye  sL    		 	 
	 	##I/VWqsA XWWs   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 rS   r_   r   s    rY   r  z>ProtocolTests.test_defining_generic_protocols.<locals>.PR.methu  r  r[   Nr  r_   r[   rY   r<  r  s  r=  r[   r<  c                       e Zd ZdZy)8ProtocolTests.test_defining_generic_protocols.<locals>.Prb   Nr\   r]   r^   r   r_   r[   rY   r  r  w  r  r[   r  c                       e Zd Zy)8ProtocolTests.test_defining_generic_protocols.<locals>.CNrp   r_   r[   rY   r7  r    r   r[   r7  )r   r*   r'   r   r}   r~   r   r   )rW   r   r  r<  r  r7  s         rY   test_defining_generic_protocolsz-ProtocolTests.test_defining_generic_protocolso  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 rS   r_   r   s    rY   r  zHProtocolTests.test_defining_generic_protocols_old_style.<locals>.PR.meth  r  r[   Nr  r_   r[   rY   r<  r    r=  r[   r<  c                       e Zd ZdZy)BProtocolTests.test_defining_generic_protocols_old_style.<locals>.Prb   Nr  r_   r[   rY   r  r    r  r[   r  c                        e Zd ZdW  defdZy)CProtocolTests.test_defining_generic_protocols_old_style.<locals>.P1r   r   c                      y rS   r_   r   s     rY   r  zGProtocolTests.test_defining_generic_protocols_old_style.<locals>.P1.bar      r[   Nr\   r]   r^   r   r  ru  s   rY   rO  r        +Q+3+r[   rO  c                        e Zd ZdW  defdZy)CProtocolTests.test_defining_generic_protocols_old_style.<locals>.P2r   r   c                      y rS   r_   r   s     rY   r  zGProtocolTests.test_defining_generic_protocols_old_style.<locals>.P2.bar  r  r[   Nr  ru  s   rY   r8  r    r  r[   r8  c                       e Zd ZdZy)EProtocolTests.test_defining_generic_protocols_old_style.<locals>.PSubrb   Nr|  r_   r[   rY   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>.Testrb   r   r   c                     |S rS   r_   r   s     rY   r  zIProtocolTests.test_defining_generic_protocols_old_style.<locals>.Test.bar  s    r[   N)r\   r]   r^   r   r   r  r_   r[   rY   Testr    s    AS S r[   r  )r   r*   r'   r#   r   r   r}   r~   r   r  r   )	rW   r  r<  r  rO  r8  r  r  r   s	           @rY   )test_defining_generic_protocols_old_stylez7ProtocolTests.test_defining_generic_protocols_old_style  s   CLCL		!71a4= 	! 
	!	38h 	 y)r#s(|R( *a$y)sG *	,71: 	,	,X 	, 
	2c7H 	 
		 	 	dfd+- *) *)s   ,D;5
E;EEc                     t          d               } d        }| j                   |       |       | j                  ||       t          d               }| j                  d|       | j                  t        |       y )Nc                  >    d xf G fdd
} t         |       S )r   c                   &    e Zd ZW  ZdW ddfdZy)HProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.Foor   r   Nc                      y rS   r_   r   s     rY   r  zMProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.Foo.meth  rb  r[   r  r  s   rY   r   r    s    -a-D-r[   r   r  r  s    @@rY   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>.Barr   r   Nc                      y rS   r_   r   s     rY   r  zMProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.Bar.meth  rb  r[   r  r  s   rY   r   r    s    -a-D-r[   r   r_   r  s    @@rY   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 rS   r_   r   s    rY   	__trunc__z\ProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.SupportsTrunc.__trunc__      cr[   N)r\   r]   r^   rl  r  r  s   rY   SupportsTruncr    s    )1)r[   r  r  r  s    @@rY   z%<generic parameters of SupportsTrunc>zjProtocolTests.test_pep695_generic_protocol_callable_members.<locals>.<generic parameters of SupportsTrunc>  s     	* 	*x 	*r[   g        )r*   r   r  rp  )rW   r   r   r  s       rY   -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>.PNrp   r_   r[   rY   r  r    r   r[   r  c                       e Zd Zd Zy))ProtocolTests.test_init_called.<locals>.Cc                     d| _         y ra  testr   s    rY   r   z2ProtocolTests.test_init_called.<locals>.C.__init__  r  r[   Nr   r_   r[   rY   r7  r        !r[   r7  rb  c                       e Zd Zd Zy))ProtocolTests.test_init_called.<locals>.Bc                     d| _         y ra  r  r   s    rY   r   z2ProtocolTests.test_init_called.<locals>.B.__init__  r  r[   Nr   r_   r[   rY   r   r    r  r[   r   c                       e Zd Zy)*ProtocolTests.test_init_called.<locals>.D1Nrp   r_   r[   rY   r  r    r  r[   r  c                       e Zd Zy)*ProtocolTests.test_init_called.<locals>.D2Nrp   r_   r[   rY   r
  r    r  r[   r
  )r   r'   r   r   r  )rW   r   r  r7  r   r  r
  s          rY   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>.PNrp   r_   r[   rY   r  r    r   r[   r  c                        e Zd Z fdZ xZS )(ProtocolTests.test_new_called.<locals>.Cc                 6    t        |   | g| }d|_        |S ra  )r   __new__r  )r  r   rW   r   s      rY   r  z0ProtocolTests.test_new_called.<locals>.C.__new__  s"    ws2T2 	r[   r\   r]   r^   r  r   r   s   @rY   r7  r    s     r[   r7  rb  r|   r  )r   r'   r   r   r  r}   r~   )rW   r   r  r7  s       rY   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>.PNrp   r_   r[   rY   r  r    r   r[   r  c                       e Zd Zy)6ProtocolTests.test_protocols_bad_subscripts.<locals>.QNrp   r_   r[   rY   r  r    r   r[   r  c                       e Zd Zy)6ProtocolTests.test_protocols_bad_subscripts.<locals>.RNrp   r_   r[   rY   r  r    r   r[   r  c                       e Zd Zy)6ProtocolTests.test_protocols_bad_subscripts.<locals>.SNrp   r_   r[   rY   r  r    r   r[   )r   r}   r~   r'   r   rT   r  )rW   r   r  r  r  r  s         rY   test_protocols_bad_subscriptsz+ProtocolTests.test_protocols_bad_subscripts  s    CLCLy))HQTN) *y)(HSM( *y)3HQK!3 *y)<FNN1a4((1+< *) *)))))))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>.PNrp   r_   r[   rY   r  r    r   r[   r  z	P[~T, ~S]zP[int, str])r   r'   r   r   endswithr   r   rW   r   r  r  s       rY   test_generic_protocols_reprz)ProtocolTests.test_generic_protocols_repr  sk    CLCL%A%Qq!tW..{;<QsCx[)22=ABr[   c                 r   t        d      }t        d      } G d dt        ||f         }| j                  ||       | j                  |t        |f   |t        |f          | j                  |||f   t        ||f      t        t
        f   |t        t        t
        f   t        t        t
        f   f          y )Nr   r  c                       e Zd Zy)2ProtocolTests.test_generic_protocols_eq.<locals>.PNrp   r_   r[   rY   r  r    r   r[   r  )r   r'   r   r   r   r   r  s       rY   test_generic_protocols_eqz'ProtocolTests.test_generic_protocols_eq  s    CLCL%A%A36Ac1fI.1a4q!t-c3h75c?E#s(O;<	>r[   c                 T   t        d      } G d dt        |         }| j                  |j                  |f       | j                  |t           j                  d       | j                  |t           j
                  t        f       | j                  |t           j                  |       y )Nr   c                       e Zd Zy)DProtocolTests.test_generic_protocols_special_from_generic.<locals>.PNrp   r_   r[   rY   r  r    r   r[   r  r_   )r   r'   r   r  r   r  r   r  )rW   r   r  s      rY   +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>.PRrb   Nr|  r_   r[   rY   r<  r    r  r[   r<  c                       e Zd Zd Zy)EProtocolTests.test_generic_protocols_special_from_protocol.<locals>.Pc                      y rS   r_   r   s    rY   r  zJProtocolTests.test_generic_protocols_special_from_protocol.<locals>.P.meth  r  r[   Nr  r_   r[   rY   r  r    r  r[   r  r   c                       e Zd ZdZd Zy)FProtocolTests.test_generic_protocols_special_from_protocol.<locals>.PGrb   c                      y rS   r_   r   s    rY   r  zKProtocolTests.test_generic_protocols_special_from_protocol.<locals>.PG.meth  r  r[   N)r\   r]   r^   r   r  r_   r[   rY   r$  r    s    Ar[   r$  r  r   )r*   r'   r   r   rK  r   rM  r   r   rT   _get_protocol_attrs	frozenset)rW   r<  r  r   r$  s        rY   ,test_generic_protocols_special_from_protocolz:ProtocolTests.test_generic_protocols_special_from_protocol  s   		 	 
		 	 CL	! 	 	'((//0//03,,-33A6A33B7#?6#=#=b#AB"C=1	3r[   c                    | j                  t              5  t         G d d             }d d d         G d dt              }| j                  t              5  t         G d d|             }d d d        y # 1 sw Y   KxY w# 1 sw Y   y xY w)Nc                       e Zd Zy)8ProtocolTests.test_no_runtime_deco_on_nominal.<locals>.CNrp   r_   r[   rY   r7  r  *  s    r[   r7  c                       e Zd ZdZy)<ProtocolTests.test_no_runtime_deco_on_nominal.<locals>.Protorb   Nr|  r_   r[   rY   r  r  -  r  r[   r  c                       e Zd Zy)?ProtocolTests.test_no_runtime_deco_on_nominal.<locals>.ConcreteNrp   r_   r[   rY   r  r  1  s    r[   r  )r}   r~   r*   r'   )rW   r7  r  r  s       rY   test_no_runtime_deco_on_nominalz-ProtocolTests.test_no_runtime_deco_on_nominal(  st    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|  r_   r[   rY   r  r  6  s    Ar[   r  c                       e Zd Zy)4ProtocolTests.test_none_treated_correctly.<locals>.BNrp   r_   r[   rY   r   r  :  r   r[   r   c                       e Zd ZdZy)4ProtocolTests.test_none_treated_correctly.<locals>.Crb   Nr|  r_   r[   rY   r7  r   >  r  r[   r7  c                       e Zd ZdZy)4ProtocolTests.test_none_treated_correctly.<locals>.DNr|  r_   r[   rY   r:  r  A  r!  r[   r:  c                       e Zd Zd Zy)5ProtocolTests.test_none_treated_correctly.<locals>.CIc                     d| _         y r@  r   r   s    rY   r   z>ProtocolTests.test_none_treated_correctly.<locals>.CI.__init__H  r   r[   Nr   r_   r[   rY   r  r  G  r   r[   r  c                       e Zd Zd Zy)5ProtocolTests.test_none_treated_correctly.<locals>.DIc                     d | _         y rS   r   r   s    rY   r   z>ProtocolTests.test_none_treated_correctly.<locals>.DI.__init__L  r%  r[   Nr   r_   r[   rY   DIr  K  r&  r[   r	  )r*   r'   r  r   r   )rW   r  r   r7  r:  r  r	  s          rY   test_none_treated_correctlyz)ProtocolTests.test_none_treated_correctly5  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|  r_   r[   rY   r  r  S  r!  r[   r  )r'   rT   r   r  r   )rW   r  AliasAlias2s       rY   test_protocols_in_unionsz&ProtocolTests.test_protocols_in_unionsR  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  rb   Nr|  r_   r[   rY   r  r  ^  r  r[   r  c                       e Zd Zy)CPNrp   r_   r[   rY   r  r  b  r  r[   r  r|   r{  rb   r]  c                       e Zd ZdZy)2ProtocolTests.test_protocols_pickleable.<locals>.Erb   Nr|  r_   r[   rY   r  r  r  s    r[   r  )r   r*   r'   r  r   r  ra  r  rf   rg   rh   rg  rf  r   r   __dict__r   )	rW   r   r  re   rR  r   r   r:  r  s	            rY   test_protocols_pickleablez'ProtocolTests.test_protocols_pickleableZ  s   CL		 	 
		3 	 D622Q67EQ&AQAQUUB'QUUE*QSS!$QZZE)BCQ&AQA  !!!#q) 8r[   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rS   )r  r   rT   SupportsIntr  r   r   s    rY   test_supports_intzProtocolTests.test_supports_intw  s.    c6#5#56  f&8&89r[   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rS   )r  rp  rT   SupportsFloatr  r   r   s    rY   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                r_   r   s    rY   __complex__z:ProtocolTests.test_supports_complex.<locals>.C.__complex__  rG  r[   N)r\   r]   r^   r#  r_   r[   rY   r7  r!    s    r[   r7  )r  complexrT   SupportsComplexr  r   rW   r7  s     rY   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[   r_   r   s    rY   	__bytes__z6ProtocolTests.test_supports_bytes.<locals>.B.__bytes__  s    r[   N)r\   r]   r^   r-  r_   r[   rY   r   r*    r   r[   r   )r  r  rT   SupportsBytesr  r   )rW   r   s     rY   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 rS   )r  rp  rT   SupportsAbsr   r  r   r   s    rY   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 rS   )r   rp  rT   SupportsRoundr  r   r  r   r   s    rY   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 rS   )r  r  rT   
Reversibler  r   r   s    rY   test_reversiblezProtocolTests.test_reversible  s.    dF$5$56  f&7&78r[   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rS   )r  r   rT   SupportsIndexr  r   r   s    rY   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{   r_   r   s    rY   __int__zFProtocolTests.test_bundled_protocol_instance_works.<locals>.C1.__int__  rG  r[   N)r\   r]   r^   r   r@  r_   r[   rY   r&  r>    s     r[   r&  c                       e Zd Zy)>ProtocolTests.test_bundled_protocol_instance_works.<locals>.C2Nrp   r_   r[   rY   r'  rB    r  r[   r'  )r   rT   r1  r  )rW   r&  r'  r  s       rY   $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 rS   r_   r   s    rY   closezFProtocolTests.test_collections_protocols_allowed.<locals>.Custom.close  r  r[   N)r\   r]   r^   rH  r_   r[   rY   CustomrF    r=  r[   rI  c                       e Zd Zy);ProtocolTests.test_collections_protocols_allowed.<locals>.ANrp   r_   r[   rY   r   rK    r   r[   r   c                       e Zd Zd Zd Zy);ProtocolTests.test_collections_protocols_allowed.<locals>.Bc                     g S rS   r_   r   s    rY   __iter__zDProtocolTests.test_collections_protocols_allowed.<locals>.B.__iter__  r  r[   c                      yrX  r_   r   s    rY   rH  zAProtocolTests.test_collections_protocols_allowed.<locals>.B.close  r  r[   N)r\   r]   r^   rO  rH  r_   r[   rY   r   rM    s    r[   r   c                       e Zd ZdeddfdZy)JProtocolTests.test_collections_protocols_allowed.<locals>.ReleasableBuffermvr   Nc                      y rS   r_   rW   rS  s     rY   __release_buffer__z]ProtocolTests.test_collections_protocols_allowed.<locals>.ReleasableBuffer.__release_buffer__  s    #r[   )r\   r]   r^   
memoryviewrV  r_   r[   rY   ReleasableBufferrR    s    EZEDEr[   rX  c                       e Zd Zy);ProtocolTests.test_collections_protocols_allowed.<locals>.CNrp   r_   r[   rY   r7  rZ    r   r[   r7  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,  )rW  )rW   r]  s     rY   
__buffer__zFProtocolTests.test_collections_protocols_allowed.<locals>.D.__buffer__  s    !#&r[   rS  Nc                      y rS   r_   rU  s     rY   rV  zNProtocolTests.test_collections_protocols_allowed.<locals>.D.__release_buffer__  r  r[   )r\   r]   r^   r   rW  r_  rV  r_   r[   rY   r:  r\    s(    ' '
 'Z D r[   r:  )
r*   r  r{  r  r'   r  r  Bufferr   r   )rW   rI  r   r   rX  r7  r:  s          rY   "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              } G d dt        j                  t              }y # 1 sw Y   FxY w)Nc                       e Zd Zy)EProtocolTests.test_builtin_protocol_allowlist.<locals>.CustomProtocolNrp   r_   r[   rY   CustomProtocolre    r   r[   rf  c                       e Zd Zy)KProtocolTests.test_builtin_protocol_allowlist.<locals>.CustomContextManagerNrp   r_   r[   rY   CustomContextManagerrh    r  r[   ri  c                       e Zd Zy)JProtocolTests.test_builtin_protocol_allowlist.<locals>.CustomAsyncIteratorNrp   r_   r[   rY   CustomAsyncIteratorrk    r  r[   rl  )r}   r~   r   r'   rT   ContextManagerAsyncIterator)rW   rf  ri  rl  s       rY   test_builtin_protocol_allowlistz-ProtocolTests.test_builtin_protocol_allowlist  sT    y)8  *	6#8#8( 		&"6"6 	 *)s   A00A9c                      G d dt               }| j                  t        d      5  t        d|       d d d        y # 1 sw Y   y xY w)Nc                       e Zd ZU eed<   y)CProtocolTests.test_non_runtime_protocol_isinstance_check.<locals>.Pr   Nr  r_   r[   rY   r  rr        Fr[   r  z@runtime_checkablerb   )r'   r   r~   r   rW   r  s     rY   *test_non_runtime_protocol_isinstance_checkz8ProtocolTests.test_non_runtime_protocol_isinstance_check  s8    	 	 ##I/CDq! EDDs	   <Ac                 F     G d dt               } G d d|      } |        y )Nc                       e Zd ZU eed<   y)-ProtocolTests.test_super_call_init.<locals>.Pr   Nr  r_   r[   rY   r  rx    rs  r[   r  c                        e Zd Z fdZ xZS )/ProtocolTests.test_super_call_init.<locals>.Fooc                 "    t         |           y rS   )r   r   )rW   r   s    rY   r   z8ProtocolTests.test_super_call_init.<locals>.Foo.__init__  s     "r[   r   r   s   @rY   r   rz    s    # #r[   r   r  )rW   r  r   s      rY   test_super_call_initz"ProtocolTests.test_super_call_init  s!    	 		#! 	# 	r[   c                     t         j                  j                  j                           G d dt         j                  j                  t              }| j                  dt         j                  j                         y )Nc                       e Zd Zy)_ProtocolTests.test_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta.<locals>.FooNrp   r_   r[   rY   r   r    r   r[   r   rb   )r  r{  Sized_abc_registry_clearr'   r   r  s     rY   Dtest_interaction_with_isinstance_checks_on_superclasses_with_ABCMetazRProtocolTests.test_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta  sH    1138+//''8
 	  KOO$9$9:r[   c                     t         j                  j                  j                           G d dt        j                  t
              }| j                  dt        j                         y )Nc                       e Zd Zy)aProtocolTests.test_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta_2.<locals>.FooNrp   r_   r[   rY   r   r    r   r[   r   rb   )r  r{  r  r  rT   r'   r   r  s     rY   Ftest_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta_2zTProtocolTests.test_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta_2  s<    113/&,,/
 	  FLL1r[   c                     t         t         G d dt                            }| j                  t        |       | j                  t	               |       y )Nc                       e Zd Zy)MProtocolTests.test_empty_protocol_decorated_with_final.<locals>.EmptyProtocolNrp   r_   r[   rY   r  r    s    '*r[   r  )r&   r*   r'   r  r  r   )rW   r  s     rY   (test_empty_protocol_decorated_with_finalz6ProtocolTests.test_empty_protocol_decorated_with_final  s?    		*H* 
 
*fm4fh6r[   c                     t         t         G d dt                            }| j                  t        |       | j                  t        |       | j                  d|       | j                  d|       y )Nc                       e Zd ZdedefdZy)]ProtocolTests.test_protocol_decorated_with_final_callable_members.<locals>.ProtocolWithMethodstringr   c                      y rS   r_   )rW   r  s     rY   r  zhProtocolTests.test_protocol_decorated_with_final_callable_members.<locals>.ProtocolWithMethod.startswith  s    sr[   Nr  r_   r[   rY   ProtocolWithMethodr  
  s     ;::r[   r  ra  r|   )	r&   r*   r'   r  r   r  r   r   r   )rW   r  s     rY   3test_protocol_decorated_with_final_callable_memberszAProtocolTests.test_protocol_decorated_with_final_callable_members	  si    			; 	; 
 
	; 	c#56  &89e%78  %78r[   c                    t         t         G d dt                            } G d d      }d}| j                  t        |      5  t        ||       d d d        | j                  t        |      5  t        t        |       d d d        | j                   |       |       | j                  d|       y # 1 sw Y   bxY w# 1 sw Y   ?xY w)Nc                       e Zd ZU eed<   y)kProtocolTests.test_protocol_decorated_with_final_noncallable_members.<locals>.ProtocolWithNonCallableMemberr   Nr  r_   r[   rY   ProtocolWithNonCallableMemberr    s	     Fr[   r  c                       e Zd ZdZy)QProtocolTests.test_protocol_decorated_with_final_noncallable_members.<locals>.Foor|   Nr|  r_   r[   rY   r   r    s    Ar[   r   r  r|   	r&   r*   r'   r   r~   r   r   r   r   )rW   r  r   only_callable_members_pleases       rY   6test_protocol_decorated_with_final_noncallable_memberszDProtocolTests.test_protocol_decorated_with_final_noncallable_members  s    			H 	 
 
		 	 L 	% ##I/KLs9: M ##I/KLs9: M 	ce%BC  %BC ML ML   B2/B>2B;>Cc                    t         t         G d dt                            } G d d      }d}| j                  t        |      5  t        ||       d d d        | j                  t        |      5  t        t        |       d d d        | j                   |       |       | j                  d|       y # 1 sw Y   bxY w# 1 sw Y   ?xY w)Nc                        e Zd ZU eed<   ddZy)`ProtocolTests.test_protocol_decorated_with_final_mixed_members.<locals>.ProtocolWithMixedMembersr   Nc                      y rS   r_   r   s    rY   r  zgProtocolTests.test_protocol_decorated_with_final_mixed_members.<locals>.ProtocolWithMixedMembers.method/  r  r[   r  )r\   r]   r^   r   r   r  r_   r[   rY   ProtocolWithMixedMembersr  +  s     F)r[   r  c                       e Zd ZdZddZy)KProtocolTests.test_protocol_decorated_with_final_mixed_members.<locals>.Foor|   Nc                      y rS   r_   r   s    rY   r  zRProtocolTests.test_protocol_decorated_with_final_mixed_members.<locals>.Foo.method3  r  r[   r  )r\   r]   r^   r   r  r_   r[   rY   r   r  1  s
    A)r[   r   r  r|   r  )rW   r  r   r  s       rY   0test_protocol_decorated_with_final_mixed_membersz>ProtocolTests.test_protocol_decorated_with_final_mixed_members*  s    			*x 	* 
 
	*	* 	*
 L 	% ##I/KLs45 M ##I/KLs45 M 	ce%=>  %=> ML MLr  c                 v     G d d       G fddt               }| j                  |j                  dh       y )Nc                       e Zd Zd Zy)aProtocolTests.test_nonruntime_protocol_interaction_with_evil_classproperty.<locals>.classpropertyc                     t        d      r  r  )rW   instancer   s      rY   rY  ziProtocolTests.test_nonruntime_protocol_interaction_with_evil_classproperty.<locals>.classproperty.__get__E  r  r[   NrZ  r_   r[   rY   classpropertyr  D  rH  r[   r  c                       e Zd Z W         Zy)_ProtocolTests.test_nonruntime_protocol_interaction_with_evil_classproperty.<locals>.CommentableNr\   r]   r^   evilr  s   rY   Commentabler  H  s
     ?Dr[   r  r  )r'   r   rI  )rW   r  r  s     @rY   <test_nonruntime_protocol_interaction_with_evil_classpropertyzJProtocolTests.test_nonruntime_protocol_interaction_with_evil_classpropertyC  s3    	) 	)	#( 	# 	77&Br[   c                 f    G d dt                G fdd      | j                  t              5 }t         G fddt                     }d d d        j
                  }| j                  |j                  d   d       | j                  t        |j                               y # 1 sw Y   ZxY w)	Nc                       e Zd Zy)\ProtocolTests.test_runtime_protocol_interaction_with_evil_classproperty.<locals>.CustomErrorNrp   r_   r[   rY   CustomErrorr  R  r   r[   r  c                       e Zd Z fdZy)^ProtocolTests.test_runtime_protocol_interaction_with_evil_classproperty.<locals>.classpropertyc                     rS   r_   )rW   r  r   r  s      rY   rY  zfProtocolTests.test_runtime_protocol_interaction_with_evil_classproperty.<locals>.classproperty.__get__U  s	    !!r[   NrZ  )r  s   rY   r  r  T  s    "r[   r  c                       e Zd Z W         Zy)\ProtocolTests.test_runtime_protocol_interaction_with_evil_classproperty.<locals>.CommentableNr  r  s   rY   r  r  Y  s
    $r[   r  r   zEFailed to determine whether protocol member 'evil' is a method member)	Exceptionr}   r~   r*   r'   r  r   r   r   r   	__cause__)rW   r  r  excr  r  s       @@rY   9test_runtime_protocol_interaction_with_evil_classpropertyzGProtocolTests.test_runtime_protocol_interaction_with_evil_classpropertyQ  s    *)*	" 	" y)R'h ' ' *
 llHHQKS	
 	d3==);7 *)s   B''B0N)Lr\   r]   r^   r  r  r  r  r  r	  r  r(  r2  r9  rH  rb  rv  r  r  r  r  r  r  r  r  r"  rK  r  r  r  r  r  r  r  r  r  r(  r5  rT  rg  ry  r  r  r  r  r  r  r  r  r  r  r  r  r
  r  r  r  r  r'  r/  r2  r5  r8  r;  rC  rb  ro  ru  r|  r  r  r  r  r  r  r  r  r_   r[   rY   r  r  G
  s   ',/6$0 2),:!
!&$%@!$F9!vHXT>90v!$F#,#(#0#,<#|R1h<">N@
:#2J($*%"&"&$)$&
P.&&6P+(!,F4$/2"
=C	>,38':(*::<><:
<9<%8>		;	27	9D,?2C8r[   r  c                      e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&d% Z'd& Z(d' Z)d( Z*d) Z+d* Z,d+ Z-d, Z.d- Z/d. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4 Z6d5 Z7d6 Z8d7 Z9d8 Z:d9 Z;d: Z<d; Z=d< Z>d= Z?d> Z@d? ZAy@)A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)Nr_   r   )r  r   r   r   r  r}   r~   r  r   r   r   r   r   r  rp  )rW   r  r  SM1r   s        rY   r.  zGenericTests.test_basicsg  s6   #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>.CNrp   r_   r[   rY   r7  r    r   r[   r7  c                       e Zd Zy)4GenericTests.test_generic_errors.<locals>.NewGenericNrp   r_   r[   rY   
NewGenericr    r   r[   r  c                       e Zd Zy)3GenericTests.test_generic_errors.<locals>.MyGenericNrp   r_   r[   rY   	MyGenericr    r   r[   r  c                       e Zd Zy)4GenericTests.test_generic_errors.<locals>.MyGeneric2Nrp   r_   r[   rY   
MyGeneric2r    r   r[   r  r_   c                       e Zd Zy)+GenericTests.test_generic_errors.<locals>.DNrp   r_   r[   rY   r:  r    r   r[   r:  )	r   r}   r~   r#   r   r   r   r   r  )rW   r   r  r7  r  r  r  r:  s           rY   test_generic_errorsz GenericTests.test_generic_errorsz  s   CLCLy)AJqM *y)AJqM *y)0GAJ
0 *y)r49% *y)tT#Y' *y)*W* *y)8GAJ
8 *y)6T!Wgaj6 *y)BK *!
!y)bE *)' *))))))))))))))))) *)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      rY   	test_initzGenericTests.test_init  sf    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|   r_   )r   __init_subclass__r  )r  r   r   s     rY   r  z<GenericTests.test_init_subclass.<locals>.X.__init_subclass__  s    )3F3r[   r\   r]   r^   r  r   r   s   @rY   r  r    s     r[   r  c                       e Zd Zy)*GenericTests.test_init_subclass.<locals>.YNrp   r_   r[   rY   r  r    r  r[   r  r|   rb   r   c                       e Zd Zy)*GenericTests.test_init_subclass.<locals>.ZNrp   r_   r[   rY   Zr    r  r[   r  c                       e Zd Zy)*GenericTests.test_init_subclass.<locals>.WNrp   r_   r[   rY   r  r    r  r[   r  )rT   r#   r   r   r  r}   r  r   )rW   r  r  r  r  s        rY   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  r\   r  r   s    rY   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>.CNrp   r_   r[   rY   r7  r    r  r[   r7  z.C[typing.Tuple[str, int]])	r   r#   r   r   r   r   r   r   r  )rW   r   r  r7  r  r  r  s          rY   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   UTry  r  ztyping.Listztyping.List[~T]ztyping.List[+U]ztyping.List[int])r   r   r   r   r   )rW   r   r  r  s       rY   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   rT   r  r   r   r   )rW   r   r  s      rY   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>.CNrp   r_   r[   rY   r7  r    r   r[   r7  )	r   r   r   r#   rT   r'   r    r   __mro__rW   r   r7  s      rY   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>.BNrp   r_   r[   rY   r   r    r  r[   r   r|   ra  c                       e Zd Zy)!GenericTests.test_dict.<locals>.CNrp   r_   r[   rY   r7  r    r  r[   r7  r{  r  )r   r#   ra  r   r  r   r  )rW   r   r   r   r7  r  s         rY   	test_dictzGenericTests.test_dict  s{    CL	
 	 CeR[1	# 	 CeU^4r[   c                 P     d        }| j                   |t                  |       y )Nc                  0    d x} f G fdd
}|      S )r   c                       e Zd ZW  Zd Zy)7GenericTests.test_setattr_exceptions.<locals>.Immutablec                     t        d      )N	immutabler  r  s      rY   __setattr__zCGenericTests.test_setattr_exceptions.<locals>.Immutable.__setattr__  s    ";//r[   N)r\   r]   r^   rl  r  rm  s   rY   	Immutabler    s    0r[   r 	  r_   r  s     @rY   z!<generic parameters of Immutable>zOGenericTests.test_setattr_exceptions.<locals>.<generic parameters of Immutable>  s     	0 	0 	0r[   )r   r   )rW   r 	  s     rY   test_setattr_exceptionsz$GenericTests.test_setattr_exceptions  s"    	0 	nin.	:r[   c                    t        d      } G d dt        |         }| j                  |t           j                  d       | j                  ||t              j                  d       d||t              _        | j                  |j                  d       | j                  |t
           j                  d       d|t        t
              _        | j                  |j                  d       | j                  |t        t              j                  d       | j                   |       j                  d       | j                   |t        t
                     j                  d        G d d||         }| j                  |t           j                  d       | j                  |j                  d       d	|_        d
|t           _        | j                  |j                  d       | j                  |t           j                  d       | j                  |j                  d
       | j                  |t
           j                  d	       y )Nr   c                       e Zd ZdZy)<GenericTests.test_subscripted_generics_as_proxies.<locals>.CdefNr|  r_   r[   rY   r7  r	  	  s    Ar[   r7  r	  changednewc                       e Zd Zy)<GenericTests.test_subscripted_generics_as_proxies.<locals>.DNrp   r_   r[   rY   r:  r		    r  r[   r:  zfrom derived zzfrom derived x)	r   r#   r   r   r   r   r   rR  r   rW   r   r7  r:  s       rY   $test_subscripted_generics_as_proxiesz1GenericTests.test_subscripted_generics_as_proxies  s   CL	
 	35)1S6e,!C&	i(39-$s)e$5:%0	*5:**E2	! 	39-e$##i(35)./3#34r[   c                 4   t        d      } G d dt        j                  j                  t        |         }|j                  t               | j                  d|       |t            | j                  d|       |j                          |j                          y )Nr   c                       e Zd Zy).GenericTests.test_abc_registry_kept.<locals>.CNrp   r_   r[   rY   r7  r	  $  r   r[   r7  rb   )
r   r  r{  r  r#   r  r   r   r  _abc_caches_clearr  s      rY   test_abc_registry_keptz#GenericTests.test_abc_registry_kept"  sm    CL9''9	

3a#	#a#		r[   c                      G d dt         t        t        f         }| j                  i |       | j                  t        |       y )Nc                       e Zd Zy)5GenericTests.test_false_subclasses.<locals>.MyMappingNrp   r_   r[   rY   	MyMappingr	  -  r   r[   r	  )r!   r   r   r  r  )rW   r	  s     rY   test_false_subclassesz"GenericTests.test_false_subclasses,  s3    7sCx07  Y/  y1r[   c                 T    G d dt         t        t        f         } |       j                          | j                   |       t        j
                  j                          | j                   |       t                | j                   |       t               | j                  i |       y )Nc                   *    e Zd Zd Zd Zd Zd Zd Zy)'GenericTests.test_abc_bases.<locals>.MMc                      y rS   r_   rW   r  s     rY   r  z3GenericTests.test_abc_bases.<locals>.MM.__getitem__3  r3  r[   c                      y rS   r_   rW   r  r  s      rY   r  z3GenericTests.test_abc_bases.<locals>.MM.__setitem__5  r  r[   c                      y rS   r_   r	  s     rY   __delitem__z3GenericTests.test_abc_bases.<locals>.MM.__delitem__7  r  r[   c                     t        d      S r  iterr   s    rY   rO  z0GenericTests.test_abc_bases.<locals>.MM.__iter__9      Bxr[   c                      yrX  r_   r   s    rY   __len__z/GenericTests.test_abc_bases.<locals>.MM.__len__;  r  r[   Nr\   r]   r^   r  r  r	  rO  r$	  r_   r[   rY   MMr	  2       r[   r&	  )r!   r   updater   r  r{  r   r   )rW   r&	  s     rY   test_abc_baseszGenericTests.test_abc_bases1  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>.MM1Nrp   r_   r[   rY   MM1r,	  E  r  r[   r-	  c                       e Zd Zy)-GenericTests.test_multiple_bases.<locals>.MM2Nrp   r_   r[   rY   MM2r/	  G  r  r[   r0	  )r!   r   r  r{  r   	__bases__r#   )rW   r-	  r0	  s      rY   test_multiple_basesz GenericTests.test_multiple_basesD  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>.CNrp   r_   r[   rY   r7  r5	  M  r   r[   r7  )r   rT   r    r   r   __orig_bases__r  s      rY   test_orig_baseszGenericTests.test_orig_basesK  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rS   )r   ).0r  r  r   r   s      rY   	<genexpr>zSGenericTests.test_naive_runtime_checks.<locals>.naive_dict_check.<locals>.<genexpr>W  s3       +1 q"%;*Q*;; +s   '*)r  r  r>  r  allr  )rW  tpr   r   s     @@rY   naive_dict_checkz@GenericTests.test_naive_runtime_checks.<locals>.naive_dict_checkQ  sU    2$$%))){{B  #		   r[   r   rb   c                 D    t        | d      st        | j                  |k(  S )Nr5  )rm  r>  r5  rW  r>	  s     rY   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>.NodeNrp   r_   r[   rY   NoderD	  e  r   r[   rE	  rO  c                 ,    t        fd| D              S )Nc              3   j   K   | ]*  }t        |j                  d    j                  d           , yw)r   N)r   r6	  r  )r;	  r   r>	  s     rY   r<	  zXGenericTests.test_naive_runtime_checks.<locals>.naive_list_base_check.<locals>.<genexpr>n  s6      % #1 "!R%6%6q%9%B%B1%EF #s   03)r=	  rA	  s    `rY   naive_list_base_checkzEGenericTests.test_naive_runtime_checks.<locals>.naive_list_base_checkl  s     % #% % %r[   c                       e Zd Zy)1GenericTests.test_naive_runtime_checks.<locals>.CNrp   r_   r[   rY   r7  rJ	  p  r   r[   r7  r  r   )r   rT   r    r   r   r   r}   r>  r   r#   r   )rW   r?	  rB	  rE	  rH	  r7  s         rY   test_naive_runtime_checksz&GenericTests.test_naive_runtime_checksP  sl   		 	(#q6;;sCx3HIJ)1c(FKKS4IJK23aXv{{36':; 4	,
 	$71:#+IDIKcCD,YT#Y[$s)DE,YT#Y[$?@23	495 4	% 	 S	-i;<.Sz1=>+ 43 43s   'GGGGc                    t        d      }t        d      }t        d      } G d dt        |   |   |         } G d d|t        |   |   |         }| j                  |j                  |f       | j                  |j                  |f       | j                  |t           j                  d       | j                  |t           j                  d       | j                  |t           j
                  t        f       | j                  |t           j
                  t        f       | j                  |j                  t        t        f       | j                  |j                  |t        t        f       | j                  |j                  t        |   |   |   f       | j                  |j                  |t        |   |   |   f       y )	Nr   r  r  c                       e Zd Zy).GenericTests.test_multi_subscr_base.<locals>.CNrp   r_   r[   rY   r7  rN	  x  r   r[   r7  c                       e Zd Zy).GenericTests.test_multi_subscr_base.<locals>.DNrp   r_   r[   rY   r:  rP	  y  r   r[   r:  r_   )
r   r   r   r  r   r  r1	  r  r#   r6	  )rW   r   r  r  r7  r:  s         rY   test_multi_subscr_basez#GenericTests.test_multi_subscr_baset  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>.MetaNrp   r_   r[   rY   MetarT	    r   r[   rU	  .)	r   r   r   r5   r   r   r"   r  Ellipsis)rW   r   rU	  s      rY   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>.ANrp   r_   r[   rY   r   rZ	        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.ANrp   r_   r[   rY   r   r_	        r[   r   N)r\   r]   r^   r#   r   r   r_   r[   rY   r   r]	    s    GAJ r[   r   z<locals>.A[str]]z<locals>.B.A[str]]zmod_generics_cache.A[str]]zmod_generics_cache.B.A[str]])r#   r   r   rN   r   r   r   r   r   r   r   r   r   rT   	FrozenSetr   r   r  r   s      rY   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   r  r_   c                       e Zd Zy)9GenericTests.test_extended_generic_rules_eq.<locals>.BaseNrp   r_   r[   rY   Basere	    r   r[   rf	  c                       e Zd Zy)<GenericTests.test_extended_generic_rules_eq.<locals>.DerivedNrp   r_   r[   rY   Derivedrh	    r   r[   ri	  .)r   r   r   r   rT   r  r}   r~   r   r   r"   r   r   )rW   r   r  rf	  ri	  s        rY   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.r   zUnion[Tuple, Callable]zUnion[Tuple, Tuple[int]].zCallable[..., Optional[int]]zCallable[[], List[int]])
r   r   r   r   r   r"   r  r   r   r   rl  s     rY    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 )Nr   CCc                      y rS   r_   r   s    rY   foobarz5GenericTests.test_generic_forward_ref.<locals>.foobar  s    r[   c                      y rS   r_   r   s    rY   foobar2z6GenericTests.test_generic_forward_ref.<locals>.foobar2  r
  r[   zCC | intc                      y rS   r_   r   s    rY   foobar3z6GenericTests.test_generic_forward_ref.<locals>.foobar3  r   r[   c                       e Zd Zy)1GenericTests.test_generic_forward_ref.<locals>.CCNrp   r_   r[   rY   rn	  rv	    r   r[   r   .c                      y rS   r_   r   s    rY   barfooz5GenericTests.test_generic_forward_ref.<locals>.barfoo  r  r[   c                      y rS   r_   r   s    rY   barfoo2z6GenericTests.test_generic_forward_ref.<locals>.barfoo2  r  r[   )r   r  rA   r   r   r+   r  r  r   r   r   r"   )
rW   rp	  rr	  rt	  rn	  r   ATrx	  CTrz	  s
             rY   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r\   r]   r^   r  r   r_   r[   rY   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)r\   r]   r^   r  r  r   r   r_   r[   rY   r'  r	    s     D$tDJ/0011r[   r'  zf
        from __future__ import annotations
        class C3:
            a: List[list["C2"]]
        r(  zList[list['C2']]r  r   c                      y rS   r_   r   s    rY   rX   z7GenericTests.test_generic_pep585_forward_ref.<locals>.f  r  r[   )r   r+   r  r  r  r  r   ro  textwrapdedentr   rA   )rW   r&  r'  scoper(  r  rX   s          rY   test_generic_pep585_forward_refz,GenericTests.test_generic_pep585_forward_ref  s<   	 	2wy&(3$r(O	

	2 	22wy&(3$r4T"X//01	
 X__   		
 4[++C02DE2wy&(3$tBx.!	
 I1gi2$tJsO,-.	
r[   c                    t        t        j                        }t        t        j                        }t        j                  j
                  }| j                  |d   |d          | j                  |d   j                  d   t        |d             | j                  |d   j                  d   |d          | j                  t        j                  |       y )Nr   r   r   rb   rR  r   )
r  rM   r  r+   r   rl  r   r   r  r   )rW   original_globalshints_for_AA_type_paramss       rY   1test_pep695_generic_class_with_future_annotationsz>GenericTests.test_pep695_generic_class_with_future_annotations  s     6 67$]__5%77k#&a(89S)2215vmA>N7OPk#&//2M!4DE 	//1ABr[   c                 z    t        t        j                        }| j                  |t        t
        t        d       y )NrQ  )r+   rM   r   r   r   r   r  )rW   hints_for_Bs     rY   Etest_pep695_generic_class_with_future_annotations_and_local_shadowingzRGenericTests.test_pep695_generic_class_with_future_annotations_and_local_shadowing  s'    $]__5Cc&FGr[   c                     t        t        j                        }| j                  t	        |j                               t	        t        j                  j                               y rS   )r+   rM   r7  r   rO  valuesrl  )rW   hints_for_Cs     rY   Mtest_pep695_generic_class_with_future_annotations_name_clash_with_global_varszZGenericTests.test_pep695_generic_class_with_future_annotations_name_clash_with_global_vars"  sA    $]__5""$%//0	
r[   c                    t        t        j                        }t        j                  j                  }| j	                  |j                         h d       | j                  |d   |d          | j	                  |d   t        |d             | j                  |d   j                  |d          | j                  |d   j                  |d          y )	N>   r   r   rR  zzr   r   r   r   rb   rR  r   r	  )	r+   rM   generic_functionrl  r   rR  r   r   r  )rW   hints_for_generic_functionfunc_t_paramss      rY   5test_pep_695_generic_function_with_future_annotationszBGenericTests.test_pep_695_generic_function_with_future_annotations)  s    %3M4R4R%S"%66FF&++-/N	
 	05}Q7GH3C8&qAQ:RS05@@-PQBRS06AA=QRCSTr[   c                     | j                  t        t        t        j                        j                               t        t        j                  j                               y rS   )r   rO  r+   rM   generic_function_2r	  rl  r   s    rY   Qtest_pep_695_generic_function_with_future_annotations_name_clash_with_global_varsz^GenericTests.test_pep_695_generic_function_with_future_annotations_name_clash_with_global_vars4  s@    }??@GGIJ00@@A	
r[   c                     t        t        j                  j                        }t        j                  j                  j                  D ci c]  }|j
                  | }}| j                  ||d   |d   t        j                  d       y c c}w )Nr   r   )r   r   r   )	r+   rM   r:  generic_methodrl  r\   r   r  NoneType)rW   hints_for_generic_methodparamparamss       rY   3test_pep_695_generic_method_with_future_annotationsz@GenericTests.test_pep_695_generic_method_with_future_annotations:  s    #1-//2P2P#Q  '77GG
G NNE!G 	 
 	$-fUmu~~N	
	
s   
Bc                     | j                  t        t        t        j                  j
                        j                               t        t        j                  j
                  j                               y rS   )r   rO  r+   rM   r:  generic_method_2r	  rl  r   s    rY   Otest_pep_695_generic_method_with_future_annotations_name_clash_with_global_varsz\GenericTests.test_pep_695_generic_method_with_future_annotations_name_clash_with_global_varsE  sH    }??@GGIJ00@@A	
r[   c                 |   t        j                         }| j                  t        |j                  j                               t        |j                  j                               | j                  t        |j                  j                               t        |j                  j                  j                               | j                  t        |j                  j                               t        |j                  j                               | j                  t        |j                  j                               j                  |j                  j                        t                      | j                  t        |j                  j                               t        |j                  j                               y rS   )rM   nestedr   rO  hints_for_Er	  r  rl  hints_for_E_methr	  r   intersectionhints_for_generic_funcgeneric_func)rW   resultss     rY   @test_pep_695_generics_with_future_annotations_nested_in_functionzMGenericTests.test_pep_695_generics_with_future_annotations_nested_in_functionK  s;   &&(##**,-		))*	
 	((//12		((889	
 	((//12		))*	
 	((//12??		@Y@YZE	

 	..5578$$445	
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>.T1Nrp   r_   r[   rY   r  r	  e  r   r[   r  c                       e Zd Zy)@GenericTests.test_extended_generic_rules_subclassing.<locals>.T2Nrp   r_   r[   rY   r  r	  f  r   r[   r  .c                       e Zd Zd Zy)@GenericTests.test_extended_generic_rules_subclassing.<locals>.C1c                      y)NFr_   )rW   items     rY   __contains__zMGenericTests.test_extended_generic_rules_subclassing.<locals>.C1.__contains__h  s    r[   N)r\   r]   r^   r	  r_   r[   rY   r&  r	  g  r  r[   r&  .zC1[int])r   r   r   rT   	Containerr   r  r   r   r  r  r   splitr   r  r{  r  r  r}   r~   r   Sequencer  )rW   r  r  r&  s       rY   'test_extended_generic_rules_subclassingz4GenericTests.test_extended_generic_rules_subclassingd  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)uS#X8 *y)uS#X8 *) *)))s   ,(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rS   )r}   r~   r   r   r   r   r$   r   r   s    rY   test_fail_with_bare_unionz&GenericTests.test_fail_with_bare_union  s    y)K *y)(O *y)Xc]# *y)# *) *)))))))s/   B<C,CC <CCC C)c                 ~   t        d      }| j                  t              5  t        t            d d d        | j                  t              5  t
        t        |       d d d        | j                  t              5  t        t        j                      d d d        y # 1 sw Y   mxY w# 1 sw Y   KxY w# 1 sw Y   y xY wr  )r   r}   r~   r   r#   r   rT   r'   rl  s     rY   test_fail_with_bare_genericz(GenericTests.test_fail_with_bare_generic  s}    CLy)M *y)'!* *y)! *)	 *)))))s#   BB':B3B$'B03B<c                    t        d      }| j                           G d dt        ||f         }| j                   |t                  j
                  |       | j                   |t                  j                  |t                   G d dt        j                  ||f         }| j                   |t                  j
                  |       | j                   |t                  j                  |t                   G d dt        j                  t        |f         }| j                   |t                  j
                  |       | j                   |t                  j                  |t                   G d d	t        j                  t        |f         }| j                   |t                  j
                  |       | j                   |t                  j                  |t                  y )
Nr   c                       e Zd Zy)5GenericTests.test_type_erasure_special.<locals>.MyTupNrp   r_   r[   rY   MyTupr	    r   r[   r	  c                       e Zd Zy)6GenericTests.test_type_erasure_special.<locals>.MyDictNrp   r_   r[   rY   MyDictr	    r   r[   r	  c                       e Zd Zy)5GenericTests.test_type_erasure_special.<locals>.MyDefNrp   r_   r[   rY   MyDefr	    r   r[   r	  c                       e Zd Zy)7GenericTests.test_type_erasure_special.<locals>.MyChainNrp   r_   r[   rY   MyChainr	    r   r[   r	  )r   rZ   r   r   r   r   r   r5  rT   r    DefaultDictr   ChainMap)rW   r   r	  r	  r	  r	  s         rY   test_type_erasure_specialz&GenericTests.test_type_erasure_special  s`   CL%E!Q$K%jeCjl,,e4s44eCjA,V[[A&,kfSkm--v655vc{C4F&&sAv.4jeCjl,,e4s44eCjA3fooc1f-3lgcln..866Er[   c                 >   d t         j                  D        }|D ]   }| j                  t        |      d       | j	                  ||       t        |dd       rtt        |t         j                        sZt        |j                  t              r@t        |j                        dk(  r(| j	                  |t           j                  t        f       t        |t              s|j                  D ]/  }| j                  t        |      d       | j	                  ||       1  y )Nc              3   <   K   | ]  }t        t        |        y wrS   )getattrrT   )r;	  els     rY   r<	  z4GenericTests.test_all_repr_eq_any.<locals>.<genexpr>  s     =n#ns   r   r  rb   )rT   __all__r   r   r   r	  r   r   r  r  r  r   r  r   r  )rW   objsrW  bases       rY   test_all_repr_eq_anyz!GenericTests.test_all_repr_eq_any  s    =fnn=CS	2.S#&-t4&sFNN;"3#5#5u=C../14  S!2!2SF;#t$KKD''T
B7$$T40 ( r[   c                    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 t9        d      at:        j<                  t:        j>                  fD ]x  }
t        t        j                  dz         D ]W  }| jA                  |
|      5  | j                  t        j                  t        j                  |
|            |
       d d d        Y z by # 1 sw Y   gxY w)Nr   c                       e Zd Zy)#GenericTests.test_pickle.<locals>.BNrp   r_   r[   rY   r   r	    r  r[   r   c                       e Zd Zy)r7  Nrp   r_   r[   rY   r7  r7    r  r[   r7  r|   r{  rb   r]  .r_   PP)r  re   )!r   r#   r   r7  ra  r  rf   rg   rh   rg  rf  r   r  r   r   r   r"   r$   r   r   r  rT   r	  ra	  r  r5   r  AbstractSetrE   r	  r   r   ri   )rW   r   r   r  re   rR  r   r"  r   more_samplesr  s              rY   r$  zGenericTests.test_pickle  s   CL	
 		# 	 C622Q67EQ&AQAQUUB'QUUE*QZZE)BC 8 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& <  t_ggryy)Ev66:;\\U\;$$V\\%%?@ <; < *  <;s   :MM!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>.NodeNrp   r_   r[   rY   rE	  r	    r   r[   rE	  r_   .)r   r   )r   r#   r   r   r   r"   r   rT   r  r    r   r$   r   r  r   r   r   )rW   r   rE	  thingsrt  s        rY   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  TPBru  TPVr	  )r  rb   TLTLBTLVPL)r   r  r   r	  r  r   r	  rE   r	  r   rT   r  r$   r  r   r   r   r"   ri   r   r   r   rf   rg   rh   rf  rg  )rW   r  re   r	  r	  r	  r	  s          rY   $test_immutability_by_copy_and_picklez1GenericTests.test_immutability_by_copy_and_pickle  sp    T]e3'eUC(t_c3&//eX/A A&d1gq)hqk1-"6#:#:Q#>?EMM&,,v||Au/E"FJ @ '&/ S" T]e3'eUC(t_c3#AA&d1gq)hqk1- '& $ '& '&s   $BG7G*G'	*G3	c                    t        d       G fddt                 } |d      }| j                  t        |      j                  d       | j                  t        |      j                  d       | j                  t        |      |       | j                  t        |      |       d|_        | j                  t        |      j                  d       | j                  t        |      j                  d        |t           d      }| j                  t        |      j                  d       | j                  t        |      j                  d       | j                  t        |      |       | j                  t        |      |       d|_        | j                  t        |      j                  d       | j                  t        |      j                  d       | j                  |j                  |t                  y )Nr   c                        e Zd ZdW  ddfdZy)3GenericTests.test_copy_generic_instances.<locals>.Cr  r   Nc                     || _         y rS   r  r  s     rY   r   z<GenericTests.test_copy_generic_instances.<locals>.C.__init__  r  r[   r   ru  s   rY   r7  r	    s    !Q !4 !r[   r7  r|   rb   )	r   r#   r   r   r  r   assertIsNotr   r5  )rW   r7  r  cir   s       @rY   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   rT   r  r   r?   r  r  r   r  r  )rW   r   r	  rt  s       rY   test_weakref_allzGenericTests.test_weakref_all%  s    CLuQV}hsAv&6c3h49%v~~c3h'?,,u%vz'BD A^W[[^-q1 r[   c                 $   t        d      } G d dt        |         } |       } |t                  }d|_        d|_        | j	                  t
              5  d|_        d d d        | j	                  t
              5  d|_        d d d        d|d   fd}| j                  t        |t               t                     d   ||          | j                  t        |t                 t        |t                        y # 1 sw Y   xY w# 1 sw Y   xY w)Nr   c                       e Zd ZdZy)0GenericTests.test_parameterized_slots.<locals>.C)potatoNr  r_   r[   rY   r7  r	  /  s    #Ir[   r7  r   r   c                      y rS   r_   r   s    rY   ra  z2GenericTests.test_parameterized_slots.<locals>.foo<  r  r[   )r   r#   r   r	  r}   r  tomator   r+   r  r  r   r   )rW   r   r7  r  c_intra  s         rY   test_parameterized_slotsz%GenericTests.test_parameterized_slots-  s    CL	$
 	$ C#~.AH /~.EL / 	 1S6WYA#F!Mafx#'78 /...s   C:;D:DDc                 H   t        d      } G d dt        |         } |       } |t                  }d|_        d|_        | j	                  t
              5  d|_        d d d        | j	                  t
              5  d|_        d d d        y # 1 sw Y   /xY w# 1 sw Y   y xY w)Nr   c                       e Zd ZddiZy)5GenericTests.test_parameterized_slots_dict.<locals>.Dbananar|   Nr  r_   r[   rY   r:  r
  B  s    !2Ir[   r:  yesr  )r   r#   r   r
  r}   r  rp	  )rW   r   r:  r   d_ints        rY   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>.CNrp   r_   r[   rY   r7  r
  S  r   r[   r7  )r}   r~   r  r  r   r#   )rW   r   r7  s      rY   r   zGenericTests.test_errorsO  s:    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>.CNrp   r_   r[   rY   r7  r
  W  r  r[   r7  r
  r	  r	  zC[int]c                       e Zd Zy)#GenericTests.test_repr_2.<locals>.YNrp   r_   r[   rY   r  r
  a  r  r[   r  r
  )	r#   r   r   r]   r\   r^   r   r   r	  )rW   r7  r  r  s       rY   test_repr_2zGenericTests.test_repr_2V  s    	
 	 	x0>	@cFx0as+B/:	# 	 	x0>	@r[   c                 d   t        d      }t        d      }t        d      }t        d      }t        d      } G d dt        ||f         } G d d	t        |||f         } G d
 dt        g ||         }|||f   d|t        ||f   |f   d|g t
        f   d|t        gt
        f   d|t        t        gt
        f   d|t        t        t           gt
        f   d|t        g ||   |f   d||||f   d|t        gt        gt
        f   d|t        t        gt        t        gt
        f   d|g ||   d|t        t        t        t           g f   d|t        t        t        t           gf   d|t        g ||   t        f   t        t        t
        t        gf   di}	|	j                         D ]s  \  }
}| j                  |
|      5  | j                  t        |
      dt        j                  |j                          dt        j                  |       d       d d d        u y # 1 sw Y   xY w)Nr   r  r  r8  r  c                       e Zd Zy),GenericTests.test_repr_3.<locals>.MyCallableNrp   r_   r[   rY   
MyCallabler
  o  r  r[   r
  c                       e Zd Zy),GenericTests.test_repr_3.<locals>.DoubleSpecNrp   r_   r[   rY   
DoubleSpecr
  r  r  r[   r
  c                       e Zd Zy)%GenericTests.test_repr_3.<locals>.TsPNrp   r_   r[   rY   TsPr
  u  r  r[   r
  zMyCallable[~P, ~T]z+MyCallable[typing.Concatenate[~T1, ~P], ~T]zMyCallable[[], bool]zMyCallable[[int], bool]zMyCallable[[int, str], bool]z"MyCallable[[int, list[int]], bool]z9MyCallable[typing.Concatenate[typing.Unpack[Ts], ~P], ~T]zDoubleSpec[~P2, ~P, ~T]zDoubleSpec[[int], [str], bool]z(DoubleSpec[[int, int], [str, str], bool]zTsP[typing.Unpack[Ts], ~P]zTsP[int, str, list[int], []]zTsP[int, [str, list[int]]]z(MyCallable[[int, str, bool, float], int])rW  expected_repr^z.*\.$)r   rE   r   r#   rF   r  r   r   r  rp  r  ri   assertRegexr   r   r   r]   )rW   r   r  r  r8  r  r
  r
  r
  object_to_expected_reprrW  r
  s               rY   test_repr_3zGenericTests.test_repr_3h  s?   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 DC #BCCs   AH&&H/	c                     | j                  t        t               | j                  t        t           t        t                  | j                  t        t           t        t
                  y rS   )r   r#   r   r   r   r   r   s    rY   	test_eq_1zGenericTests.test_eq_1  sB    '*WQZ0GBK5r[   c                 $    G d dt         t                 } G d dt         t                 }| j                  ||       | j                  ||       | j                  |t           |t                  | j                  |t           |t                  y )Nc                       e Zd Zy)!GenericTests.test_eq_2.<locals>.ANrp   r_   r[   rY   r   r'
    r  r[   r   c                       e Zd Zy)!GenericTests.test_eq_2.<locals>.BNrp   r_   r[   rY   r   r)
    r  r[   r   )r#   r   r   r   r   s      rY   	test_eq_2zGenericTests.test_eq_2  st    	
 		
 	 	AAq!1qt$AaD!A$'r[   c           	      D    G d dt         t        t        f         } G d dt         t        t        f         } G d d|t        t        f   t         t        t        t        f   |t        t        f         }| j	                  |j
                  t        t        t        f       y )Nc                       e Zd Zy)1GenericTests.test_multiple_inheritance.<locals>.ANrp   r_   r[   rY   r   r-
    r  r[   r   c                       e Zd Zy)1GenericTests.test_multiple_inheritance.<locals>.BNrp   r_   r[   rY   r   r/
    r  r[   r   c                       e Zd Zy)1GenericTests.test_multiple_inheritance.<locals>.CNrp   r_   r[   rY   r7  r1
    r  r[   r7  )r#   r   r   r   r   r  )rW   r   r   r7  s       rY   test_multiple_inheritancez&GenericTests.test_multiple_inheritance  ss    	2 		A 		!R%'"a),aAh 	 	))B2;7r[   c                     t        d      } G d dt        |         } G d dt        t           |      }| j	                  |j
                  |t        |t        t        f       y )Nr  c                       e Zd Zy)9GenericTests.test_multiple_inheritance_special.<locals>.BNrp   r_   r[   rY   r   r5
    r   r[   r   c                       e Zd Zy)9GenericTests.test_multiple_inheritance_special.<locals>.CNrp   r_   r[   rY   r7  r7
    r   r[   r7  )r   r#   r   r   r   r  r  r  )rW   r  r   r7  s       rY   !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>.FinalExceptionNrp   r_   r[   rY   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  )r1	  r   r   r  )r  r   r	  r%   r<
  r   s      rY   r  zMGenericTests.test_init_subclass_super_called.<locals>.Final.__init_subclass__  s?    MMD5(Ze-D,T22 * )3F3r[   r  r  )r   r%   r<
  s   @rY   r%   r>
    s    4 4r[   r%   c                       e Zd Zy):GenericTests.test_init_subclass_super_called.<locals>.TestNrp   r_   r[   rY   r  rA
    r  r[   r  c                       e Zd Zy)>GenericTests.test_init_subclass_super_called.<locals>.SubclassNrp   r_   r[   rY   SubclassrC
    r   r[   rD
  c                       e Zd Zy)?GenericTests.test_init_subclass_super_called.<locals>.Subclass2Nrp   r_   r[   rY   	Subclass2rF
    r   r[   rG
  )r  r#   r   r}   r   )rW   r  rD
  rG
  r%   r<
  s       @@rY   test_init_subclass_super_calledz,GenericTests.test_init_subclass_super_called  s    	Y 		4 	4	71:u 	~.4  / ~.DI  /. /. /.s   B,BBBc                 6   t         } G d d|t                 }|t        j                  t              } G d d|      } |       }|j                  g        |j                  d       |j                  d       | j                  |j                         ddg       y )Nc                   .    e Zd ZdZdefdZd ZdefdZy))GenericTests.test_nested.<locals>.VisitorNr  c                     || _         y rS   r  rW   r  s     rY   rO  z-GenericTests.test_nested.<locals>.Visitor.set  r   r[   c                     | j                   S rS   r  r   s    rY   r  z-GenericTests.test_nested.<locals>.Visitor.get      vvr[   r   c                     | j                   S rS   r  r   s    rY   visitz/GenericTests.test_nested.<locals>.Visitor.visit  rO
  r[   )r\   r]   r^   r  r   rO  r  rQ
  r_   r[   rY   VisitorrK
    s$    AQ q r[   rR
  c                       e Zd ZdefdZy)0GenericTests.test_nested.<locals>.IntListVisitorr   c                 :    | j                   j                  |       y rS   )r  r  r   s     rY   r  z7GenericTests.test_nested.<locals>.IntListVisitor.append  s    a r[   N)r\   r]   r^   r   r  r_   r[   rY   IntListVisitorrT
    s    ! !r[   rV
  rb   r|   )	r#   r   rT   r   r   rO  r  r   r  )rW   r  rR
  r  rV
  r  s         rY   test_nestedzGenericTests.test_nested  s}    	ad 	 FKK$%	!Q 	!
 	b			1b'*r[   c                 l     t        d       G fddt                 df fd} |d       y )Nr   c                   *    e Zd Z	 	 ddW  ddddfdZy),GenericTests.test_type_erasure.<locals>.NodeNr  leftNode[T]rightc                 .    || _         || _        || _        y rS   r  r[
  r]
  )rW   r  r[
  r]
  s       rY   r   z5GenericTests.test_type_erasure.<locals>.Node.__init__  s     #
 	"
r[   NNr   ru  s   rY   rE	  rZ
    s%    +/,0#a #(# )#r[   rE	  r   c                     |       }    |       } t            |       }j                  t        |             j                  t        |             j                  t        |             j                  |j                  |        j                  |j                  |        j                  |j                  |        y rS   )r   r   r   r   r  )r   r  r   r  rE	  r   rW   s       rY   ra  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   ra  rE	  r   s   ` @@rY   r6  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>.CNrp   r_   r[   rY   r7  re
    r  r[   r7  c                       e Zd Zy))GenericTests.test_implicit_any.<locals>.DNrp   r_   r[   rY   r:  rg
  	  r  r[   r:  r_   )r   r#   r   r  r}   r~   r   r   r
	  s       rY   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>.ANrp   r_   r[   rY   r   rk
    r  r[   r   c                        e Zd Z fdZ xZS )*GenericTests.test_new_with_args.<locals>.Bc                 4    t         |   |       }||_        |S rS   )r   r  r   r  r   rW  r   s      rY   r  z2GenericTests.test_new_with_args.<locals>.B.__new__  s    goc*
r[   r  r   s   @rY   r   rm
         r[   r   c                       e Zd Zy)*GenericTests.test_new_with_args.<locals>.CNrp   r_   r[   rY   r7  rr
  "  r  r[   r7  ra  )r#   r   r   r   rW   r   r   r7  r  s        rY   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 rS   )from_ar   r   rW   r   r   s     rY   r   z4GenericTests.test_new_with_args2.<locals>.A.__init__+  s    ! "r[   r   r   s   @rY   r   rw
  *  s    # #r[   r   c                        e Zd Z fdZ xZS )+GenericTests.test_new_with_args2.<locals>.Cc                 2    || _         t        | 	  |       y rS   )from_cr   r   rz
  s     rY   r   z4GenericTests.test_new_with_args2.<locals>.C.__init__2  s    ! %r[   r   r   s   @rY   r7  r|
  1  s    & &r[   r7  ra  )r#   r   r   ry
  r~
  )rW   r   r7  r  s       rY   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>.ANrp   r_   r[   rY   r   r
  =  r  r[   r   ra  c                        e Zd Z fdZ xZS )(GenericTests.test_new_no_args.<locals>.Bc                 4    t         |   |       }d|_        |S )Nr   )r   r  from_b)r  rW  r   s     rY   r  z0GenericTests.test_new_no_args.<locals>.B.__new__D      goc* 

r[   r  r   s   @rY   r   r
  C  rp
  r[   r   c                   $     e Zd Zd Z fdZ xZS )(GenericTests.test_new_no_args.<locals>.Cc                     || _         y rS   r   r  s     rY   r   z1GenericTests.test_new_no_args.<locals>.C.__init__L  s	    r[   c                 4    t         |   |       }d|_        |S )Nr  )r   r  r~
  ro
  s      rY   r  z0GenericTests.test_new_no_args.<locals>.C.__new__O  r
  r[   )r\   r]   r^   r   r  r   r   s   @rY   r7  r
  K  s     r[   r7  r   r  )r#   r   r}   r~   r   r   r
  r~
  rs
  s        rY   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  )msgr
  r   r
  c                       e Zd Zy)4GenericTests.test_subclass_special_form.<locals>.FooNrp   r_   r[   rY   r   r
  h      r[   r   )r$   r   r%   r   rp  r   r   rF   rE   rI   ri   r   r~   r   r   )rW   rW  r   s      rY   test_subclass_special_formz'GenericTests.test_subclass_special_formZ  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 )	Nrx  Try  c                       e Zd Zy)2GenericTests.test_complex_subclasses.<locals>.BaseNrp   r_   r[   rY   rf	  r
  n  r[	  r[   rf	  r   c                       e Zd Zy)1GenericTests.test_complex_subclasses.<locals>.SubNrp   r_   r[   rY   r   r
  t  r[	  r[   r   rb
  )rW   rx  rf	  r   r   s        rY   test_complex_subclassesz$GenericTests.test_complex_subclassesk  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)r\   r]   r^   r   r  r_   r[   rY   r   r
  z  s	    TNr[   r   )r  subz.* is not a generic class)r   r   r   r  r  r   r   r   rE   r  r  	UnionTyperi   r   r~   r   )rW   r   r  r   s       rY   test_parameter_detectionz%GenericTests.test_parameter_detectionw  s
   a//!6d1g55t<	" 	" Ag|Y@R@RTYTcTcd\\!\3//	;VW!S	 X 43 e  	ac11A48ac11A48 XW 43s$   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>.GNrp   r_   r[   rY   r  r
    r  r[   r  c                       e Zd ZW  fZy)2GenericTests.test_non_generic_subscript.<locals>.AN)r\   r]   r^   r  ru  s   rY   r   r
    s
    TNr[   r   )r  r
  )callabler
  )r   r#   r   r   r  r   rE   r  r  r
  r   r  ri   r   r}   r~   r"   r  r{  )rW   r  r   r   rt  r  r  r   s          @rY   test_non_generic_subscriptz'GenericTests.test_non_generic_subscript  s   CL	
 		" 	" q!T4<$$eoo7A E\\\q\1$$Qq!tWS\1QV9=$$Qq!tWS\1S!V9=!A**95# 6	 21 " {777\\1!\4$$QsAvYs^QsCx[A$$QsAvYs^Quax[A1#q&	A**95# 6	 54 87 65	 21 65	 54sJ   A)G(:
G	G(A0H<
G5	HG%!G((G25G>:HH
N)Br\   r]   r^   r.  r  r  r  r   r  r  r  r  r  r	  r	  r	  r	  r)	  r2	  r7	  rK	  rQ	  rW	  rb	  rj	  rl	  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*
  r2
  r8
  rH
  rW
  r6  rh
  rt
  r
  r
  r
  r
  r
  r
  r_   r[   rY   r  r  e  sP   E&2%(B+0	>

5";562
)&SC
"?H?"I(CTP 	4M4%
N
CH
	U
	


29: "F"1.`-.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rS   )r}   r~   r$   r   r   r   s    rY   r.  zClassVarTests.test_basics  sS    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   ro   r\   rW   cvs     rY   r   zClassVarTests.test_repr  sY    h):;c]b#9:hb#AH#LMr[   c           	      $   | j                  t        t              5   G d dt        t                    }d d d        | j                  t        t              5   G d dt        t        t
                       }d d d        | j                  t        d      5   G d dt              }d d d        | j                  t        d      5   G d	 d
t        t
                 }d d d        y # 1 sw Y   xY w# 1 sw Y   yxY w# 1 sw Y   WxY w# 1 sw Y   y xY w)Nc                       e Zd Zy)-ClassVarTests.test_cannot_subclass.<locals>.CNrp   r_   r[   rY   r7  r
    r   r[   r7  c                       e Zd Zy)-ClassVarTests.test_cannot_subclass.<locals>.DNrp   r_   r[   rY   r:  r
    r   r[   r:  z Cannot subclass typing\.ClassVarc                       e Zd Zy)-ClassVarTests.test_cannot_subclass.<locals>.ENrp   r_   r[   rY   r  r
    r   r[   r  z'Cannot subclass typing\.ClassVar\[int\]c                       e Zd Zy)-ClassVarTests.test_cannot_subclass.<locals>.FNrp   r_   r[   rY   r  r
    r   r[   r  )r   r~   r   r   r$   r   rW   r7  r:  r  r  s        rY   r   z"ClassVarTests.test_cannot_subclass  s    ##I/CDDN  E ##I/CDD#'  E ##I$GIH I ##I$NPHSM P P ED EDI IP P/   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rS   )r}   r~   r$   r   r   r   r   s    rY   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   r   r   s    rY   rA  z ClassVarTests.test_no_isinstance  S    y)q(3-( *y)sH% *) *)))   A)A5)A25A>Nr\   r]   r^   r.  r   r   r>  rA  r_   r[   rY   r
  r
    s    N ,&r[   r
  c                   *    e Zd Zd Zd Zd Zd Zd Zy)
FinalTestsc                    t         t            | j                  t              5  t         t        t        f    d d d        | j                  t              5  t         t           t            d d d        | j                  t              5  t
        t         t               d d d        y # 1 sw Y   nxY w# 1 sw Y   HxY w# 1 sw Y   y xY wrS   )r%   r   r}   r~   r   r   r   s    rY   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   ro   r\   r  r
  s     rY   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>.CNrp   r_   r[   rY   r7  r
    r   r[   r7  c                       e Zd Zy)*FinalTests.test_cannot_subclass.<locals>.DNrp   r_   r[   rY   r:  r
    r   r[   r:  zCannot subclass typing\.Finalc                       e Zd Zy)*FinalTests.test_cannot_subclass.<locals>.ENrp   r_   r[   rY   r  r
    r   r[   r  z$Cannot subclass typing\.Final\[int\]c                       e Zd Zy)*FinalTests.test_cannot_subclass.<locals>.FNrp   r_   r[   rY   r  r
    r   r[   r  )r   r~   r   r   r%   r   r
  s        rY   r   zFinalTests.test_cannot_subclass  s    ##I/CDDK  E ##I/CDDs$  E ##I02E 2 ##I79E#J 9 9 ED ED2 29 9r
  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rS   )r}   r~   r%   r   r   r   r   s    rY   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   r   r   s    rY   rA  zFinalTests.test_no_isinstance  sS    y)q%*% *y)sE" *) *)))r
  Nr
  r_   r[   rY   r
  r
    s    !? )#r[   r
  c                       e Zd Zd Zd Zy)FinalDecoratorTestsc                 @    d }| j                  |t        |             y )Nc                      y rS   r_   r   s    rY   funcz7FinalDecoratorTests.test_final_unmodified.<locals>.func  r  r[   )r   r&   rW   r
  s     rY   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 rS   r_   r_   r[   rY   r
  z3FinalDecoratorTests.test_dunder_final.<locals>.func
      r[   c                       e Zd Zy)2FinalDecoratorTests.test_dunder_final.<locals>.ClsNrp   r_   r[   rY   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 rS   r
  r
  s     rY   r   z?FinalDecoratorTests.test_dunder_final.<locals>.Wrapper.__init__  r  r[   c                 &     | j                   |i |S rS   r
  r   s      rY   r2  z?FinalDecoratorTests.test_dunder_final.<locals>.Wrapper.__call__  s     tyy$1&11r[   N)r\   r]   r^   r  r   r2  r_   r[   rY   Wrapperr
    s    !I!2r[   r
  c                       y rS   r_   r_   r[   rY   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 mer_   r   s    rY   r
  z=FinalDecoratorTests.test_dunder_final.<locals>.Meta.__final__!  s    (6r[   N)r\   r]   r^   rR  r
  r_   r[   rY   rU	  r
     s    6 6r[   rU	  c                       e Zd Zy)7FinalDecoratorTests.test_dunder_final.<locals>.WithMetaNrp   r_   r[   rY   WithMetar
  #  s    (+r[   r
  r  r
  c                   ~    e Zd Zeed               Zeed               Zeed               Z	e e
       d               Zy)6FinalDecoratorTests.test_dunder_final.<locals>.Methodsc                      y rS   r_   r  s    rY   	clsmethodz@FinalDecoratorTests.test_dunder_final.<locals>.Methods.clsmethod.  s     #r[   c                       y rS   r_   r_   r[   rY   stmethodz?FinalDecoratorTests.test_dunder_final.<locals>.Methods.stmethod2      r[   c                      y rS   r_   r   s    rY   propz;FinalDecoratorTests.test_dunder_final.<locals>.Methods.prop8  r
  r[   c                      y rS   r_   r   s    rY   cachedz=FinalDecoratorTests.test_dunder_final.<locals>.Methods.cached<  s    !r[   N)r\   r]   r^   r&   rf  r
  staticmethodr
  rR  r
  r   r
  r_   r[   rY   Methodsr
  -  s^    #  #     [!  !r[   r
  r
  r
  )r&   r   r
  r   rm  r   r   r   inspectgetattr_staticr
  fgetr
  )rW   r
  r
  r
  r
  rU	  r
  r
  s           rY   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)r\   r]   r^   r
  r
  r_   r[   rY   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 rS   r_   r   s    rY   normal_methodz@OverrideDecoratorTests.test_override.<locals>.Base.normal_methodQ  r$  r[   c                      y rS   r_   r  s    rY   class_method_good_orderzJOverrideDecoratorTests.test_override.<locals>.Base.class_method_good_orderR  s    .1r[   c                      y rS   r_   r  s    rY   class_method_bad_orderzIOverrideDecoratorTests.test_override.<locals>.Base.class_method_bad_orderT  s    -0r[   c                       y rS   r_   r_   r[   rY   static_method_good_orderzKOverrideDecoratorTests.test_override.<locals>.Base.static_method_good_orderV  s    ,/r[   c                       y rS   r_   r_   r[   rY   static_method_bad_orderzJOverrideDecoratorTests.test_override.<locals>.Base.static_method_bad_orderX  s    +.r[   N)
r\   r]   r^   r  rf  r  r  r
  r  r
  r_   r[   rY   rf	  r   P  s=    (1 10 0/ /. .r[   rf	  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{   r_   r   s    rY   r  zCOverrideDecoratorTests.test_override.<locals>.Derived.normal_method\  rP  r[   c                      yr{   r_   r  s    rY   r  zMOverrideDecoratorTests.test_override.<locals>.Derived.class_method_good_order`       r[   c                      yr{   r_   r  s    rY   r  zLOverrideDecoratorTests.test_override.<locals>.Derived.class_method_bad_orderd  r  r[   c                       yr{   r_   r_   r[   rY   r  zNOverrideDecoratorTests.test_override.<locals>.Derived.static_method_good_orderi  r  r[   c                       yr{   r_   r_   r[   rY   r
  zMOverrideDecoratorTests.test_override.<locals>.Derived.static_method_bad_orderm  r  r[   N)r\   r]   r^   r.   r  rf  r  r  r
  r  r
  r_   r[   rY   ri	  r  [  s               r[   ri	  r|   TF__override__)
r  r   r  r   r  r  r  rm  r  r
  )rW   rf	  ri	  r  s       rY   test_overridez$OverrideDecoratorTests.test_overrideO  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@  r_   r   s    rY   correctz:OverrideDecoratorTests.test_property.<locals>.Base.correct      r[   c                      yr@  r_   r   s    rY   wrongz8OverrideDecoratorTests.test_property.<locals>.Base.wrong  r  r[   N)r\   r]   r^   rR  r   r  r  r_   r[   rY   rf	  r    s4      s  r[   rf	  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   r_   r   s    rY   r  z;OverrideDecoratorTests.test_property.<locals>.Child.correct       r[   c                      yr   r_   r   s    rY   r  z9OverrideDecoratorTests.test_property.<locals>.Child.wrong  r!  r[   N)r\   r]   r^   rR  r.   r   r  r  r_   r[   rY   Childr    sD       s   r[   r#  r   r  )	r   r  r   r
  r  r  r   rm  fset)rW   rf	  r#  r  s       rY   test_propertyz$OverrideDecoratorTests.test_property  s    	 		D 	 7))1-**778+n=>!1!1>BCr[   c                      G d d       G fdd      }| j                  |j                  d       | j                  t        |j                  d             y )Nc                       e Zd ZdZd ZddZy)>OverrideDecoratorTests.test_silent_failure.<locals>.CustomPropr
  c                     || _         y rS   r)  )rW   r
  s     rY   r   zGOverrideDecoratorTests.test_silent_failure.<locals>.CustomProp.__init__  r  r[   Nc                 $    | j                  |      S rS   r)  rV  s      rY   rY  zFOverrideDecoratorTests.test_silent_failure.<locals>.CustomProp.__get__  s    yy~%r[   rS   )r\   r]   r^   r  r   rY  r_   r[   rY   
CustomPropr(    s    !I!&r[   r,  c                   *    e Zd ZeW  d               Zy)@OverrideDecoratorTests.test_silent_failure.<locals>.WithOverridec                      yr@  r_   r   s    rY   r   zEOverrideDecoratorTests.test_silent_failure.<locals>.WithOverride.some  r!  r[   N)r\   r]   r^   r.   r   )r,  s   rY   WithOverrider.    s      r[   r0  rb   r  )r   r   r   rm  )rW   r0  r,  s     @rY   test_silent_failurez*OverrideDecoratorTests.test_silent_failure  sJ    	& 	&	 	 	**A.!2!2NCDr[   c                 J   d  G fdd      } |       }| j                  |j                  d      d       | j                  |j                  j                         | j                  |j	                  d      d       | j                  |j                  j                         y )Nc                 .     t                fd       }|S )Nc                       | i |S rS   r_   )r   r   rX   s     rY   rk   zTOverrideDecoratorTests.test_multiple_decorators.<locals>.with_wraps.<locals>.wrapper  s    $)&))r[   rl   )rX   rk   s   ` rY   
with_wrapszCOverrideDecoratorTests.test_multiple_decorators.<locals>.with_wraps  s    1X* *Nr[   c                   Z    e Zd ZeW  dedefd              ZW  ededefd              Zy)EOverrideDecoratorTests.test_multiple_decorators.<locals>.WithOverrider  r   c                     |dz   S r@  r_   rM
  s     rY   on_topzLOverrideDecoratorTests.test_multiple_decorators.<locals>.WithOverride.on_top       1ur[   c                     |dz   S r   r_   rM
  s     rY   	on_bottomzOOverrideDecoratorTests.test_multiple_decorators.<locals>.WithOverride.on_bottom  r:  r[   N)r\   r]   r^   r.   r   r9  r<  )r5  s   rY   r0  r7    sS        3 3   r[   r0  rb   r   rP  )r   r9  r   r  r<  )rW   r0  r  r5  s      @rY   test_multiple_decoratorsz/OverrideDecoratorTests.test_multiple_decorators  s}    		 	  >+Q/445++A.2**778r[   N)r\   r]   r^   r  r%  r1  r=  r_   r[   rY   r
  r
  N  s    8TtD4E"9r[   r
  c                       e Zd Zd Zd Zy)	CastTestsc                 0   | j                  t        t        d      d       | j                  t        t        d      d       | j	                  t        t        t        d            t               | j                  t        t        d      d       | j                  t        t        d      d       | j                  t        t        t        t        f   d      d       | j                  t        t        d      d       | j                  t        d d      d       y r{   )r   r)   r   rp  r   r   r   r  r   r   r   r   s    rY   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    rY   r   zCastTests.test_errors  s    RWbr[   Nr\   r]   r^   r.  r   r_   r[   rY   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   rp  r   r  s     rY   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 rB  )r   r(   r  s     rY   r   zAssertTypeTests.test_errors  s1    k#r*C0k#w/5r[   NrD  r_   r[   rY   rF  rF    s    36r[   rF  )ann_module8c                   8    e Zd Zej                  j
                  Zy)NoTypeCheck_OuterN)r\   r]   r^   rI  rK  Innerr_   r[   rY   rK  rK    s    ))//Er[   rK  c                   $    e Zd Zej                  Zy)NoTypeCheck_WithFunctionN)r\   r]   r^   rI  NoTypeCheck_functionr_   r[   rY   rN  rN    s    &;;r[   rN  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&y%)&ForwardRefTestsc                 ~    G d dt         t                 }|t           }t        |j                  t               t                     }| j                  |d   t        |t                     | j                  |d   |t                  | j                  |d   t               | j                  d|       t        |j                  t               t                     }| j                  |d   t        |t                     t        |j                  t               t                     }| j                  |d   |t                  y )Nc                   P    e Zd ZdefdZ	 	 	 ddddddefd	Zd
ed   fdZdddZ	y))ForwardRefTests.test_basics.<locals>.Noder  c                 .    || _         d x| _        | _        y rS   r_
  )rW   r  s     rY   r   z2ForwardRefTests.test_basics.<locals>.Node.__init__   s    "
)--	DJr[   Nr[
  zOptional[Node[T]]r]
  r\
  stuffc                      || _         || _        y rS   )r[
  r]
  )rW   r[
  r]
  rV  blahs        rY   add_bothz2ForwardRefTests.test_basics.<locals>.Node.add_both  s    
 !	"
r[   nodec                 (    | j                  |d        y rS   rY  rW   rZ  s     rY   add_leftz2ForwardRefTests.test_basics.<locals>.Node.add_left      dD)r[   c                 (    | j                  d |       y rS   r\  r]  s     rY   	add_rightz3ForwardRefTests.test_basics.<locals>.Node.add_right  r_  r[   )NNNrS   )rZ  r\
  )
r\   r]   r^   r   r   r   rY  r   r^  ra  r_   r[   rY   rE	  rT    sN    .a . -1&*"	#2# )# !$#*Xi%8 **r[   rE	  r[
  r]
  rV  rX  rZ  )r#   r   r   r+   rY  r  r  r   r   rO  r^  ra  )rW   rE	  rt  
both_hints
left_hintsright_hintss         rY   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|   )rT   rA   r}   r~   r   rW   frs     rY   #test_forwardref_instance_type_errorz3ForwardRefTests.test_forwardref_instance_type_error  s6    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   )rT   rA   r}   r~   r   r   rf  s     rY   #test_forwardref_subclass_type_errorz3ForwardRefTests.test_forwardref_subclass_type_error$  s6    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~   rT   rA   r   s    rY   test_forwardref_only_str_argz,ForwardRefTests.test_forwardref_only_str_arg)  s*    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__)rT   rA   r   r   r   r   r\   )rW   rg  frms      rY   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 )Nr7  c                       e Zd Zy)4ForwardRefTests.test_forward_equality_gth.<locals>.CNrp   r_   r[   rY   r7  ru  <  r  r[   r  r   c                      y rS   r_   r  r   s     rY   ra  z6ForwardRefTests.test_forward_equality_gth.<locals>.foo>  r  r[   rw  )
rT   rA   r   r+   r  r  r   r   r   r   )rW   rG  c1_gthrH  c2_gthr7  ra  s          rY   test_forward_equality_gthz)ForwardRefTests.test_forward_equality_gth6  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 rS   r_   rw  s     rY   ra  z7ForwardRefTests.test_forward_equality_hash.<locals>.fooQ  r  r[   rn  rp  )	rT   rA   r+   r  r  r   r  r\   r   )rW   rG  rx  rH  ry  ra  c3c4s           rY   test_forward_equality_hashz*ForwardRefTests.test_forward_equality_hashK  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>.ANrp   r_   r[   rY   r   r  b  r  r[   r   c                  v    t        j                  d      } d| fd}t        |t               t	                      | S )Nr   r   c                      y rS   r_   r   s    rY   r  zPForwardRefTests.test_forward_equality_namespace.<locals>.namespace1.<locals>.funf  r  r[   rT   rA   r+   r  r  )r  r  s     rY   
namespace1zCForwardRefTests.test_forward_equality_namespace.<locals>.namespace1d  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>.ANrp   r_   r[   rY   r   r  n  r   r[   r   c                      y rS   r_   r   s    rY   r  zPForwardRefTests.test_forward_equality_namespace.<locals>.namespace2.<locals>.funp  r  r[   r  )r  r   r  s      rY   
namespace2zCForwardRefTests.test_forward_equality_namespace.<locals>.namespace2k  s?    !!#&A q  3	684Hr[   )r   r   )rW   r   r  r  s       rY   test_forward_equality_namespacez/ForwardRefTests.test_forward_equality_namespacea  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')]modrn  z,typing.List[ForwardRef('int', module='mod')])r   r   r   rA   r   s    rY   test_forward_reprz!ForwardRefTests.test_forward_repry  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 rS   r_   r  s    rY   ra  z/ForwardRefTests.test_union_forward.<locals>.foo  r  r[   c                      y rS   r_   r  s    rY   ra  z/ForwardRefTests.test_union_forward.<locals>.foo  r  r[   )	r   r   r+   r  r  r   r  rA   r   rW   ra  s     rY   test_union_forwardz"ForwardRefTests.test_union_forward~  s    	5: 	 	WYAuQx	*	5C)C/ 	 	WYAuQx#~.	0r[   c                 2   dt         d   fd}| j                  t        |t               t	                     dt         t
           i       dt        t        d         fd}| j                  t        |t               t	                     dt        t
           i       y )Nr  r   c                      y rS   r_   r  s    rY   ra  z/ForwardRefTests.test_tuple_forward.<locals>.foo  r  r[   c                      y rS   r_   r  s    rY   ra  z/ForwardRefTests.test_tuple_forward.<locals>.foo  r  r[   )r   r   r+   r  r  r   r  rA   r  s     rY   test_tuple_forwardz"ForwardRefTests.test_tuple_forward  s{    	5: 	 	WYAuQx	*	5C) 	 	WYAuQx	*r[   c                     dd}| j                  t        |t               t                     dt        t
           i       y )Nr  c                      y rS   r_   r  s    rY   ra  z0ForwardRefTests.test_double_forward.<locals>.foo  r  r[   )r  zList['int'])r   r+   r  r  r   r   r  s     rY   test_double_forwardz#ForwardRefTests.test_double_forward  s0    	WYAtCy)	+r[   c                     d }d }d } |       } |       }| j                  ||       | j                  t        |||       y )Nc                  z    t        j                  d      } | }d| fd}t        |t               t	                     }| S )Nr   r   c                      y rS   r_   r   s    rY   r  zPForwardRefTests.test_forward_recursion_actually.<locals>.namespace1.<locals>.fun  r=  r[   r  r  r   r  rets       rY   r  zCForwardRefTests.test_forward_recursion_actually.<locals>.namespace1  6    !!#&AAq gi:CHr[   c                  z    t        j                  d      } | }d| fd}t        |t               t	                     }| S )Nr   r   c                      y rS   r_   r   s    rY   r  zPForwardRefTests.test_forward_recursion_actually.<locals>.namespace2.<locals>.fun  r=  r[   r  r  s       rY   r  zCForwardRefTests.test_forward_recursion_actually.<locals>.namespace2  r  r[   c                     | |k(  S rS   r_   )o1o2s     rY   cmpz<ForwardRefTests.test_forward_recursion_actually.<locals>.cmp  s    8Or[   )r	  r}   RecursionError)rW   r  r  r  r1r2s         rY   test_forward_recursion_actuallyz/ForwardRefTests.test_forward_recursion_actually  sE    			 \\R .#r26r[   c                    t         d   t        t        f    G fdd      } G fdd      } G fdd      } G fdd	      }| j                  t	        |t               t                     t	        |t               t                            | j                  t	        |t               t                     d
t         t        t        t         t        t        t         d   f      f      i       | j                  t	        |t               t                     d
t        t        t         t        t        t         d   f      f   i       | j                  t	        |t               t                     d
t        t         t        t        t         t        t        t         d   f      f      t         t        t        t         d   f      f   i       | j                  t	        |t               t                     d
t        t        t         t        t        t         d   f      t         t        t        t         t        t        t         d   f      f      f   i       y )NValuec                   "    e Zd ZU eW     ed<   y)7ForwardRefTests.test_union_forward_recursion.<locals>.Cra  N)r\   r]   r^   r   r   )r  s   rY   r7  r    s    er[   r7  c                   (    e Zd ZU eW  W f   ed<   y)7ForwardRefTests.test_union_forward_recursion.<locals>.Dra  N)r\   r]   r^   r   r   r  	ValueLists   rY   r:  r    s    ui'((r[   r:  c                   .    e Zd ZU eeW     W f   ed<   y)7ForwardRefTests.test_union_forward_recursion.<locals>.Era  Nr\   r]   r^   r   r   r   r  s   rY   r  r    s    tE{I-..r[   r  c                   2    e Zd ZU eW  eW     W f   ed<   y)7ForwardRefTests.test_union_forward_recursion.<locals>.Fra  Nr  r  s   rY   r  r    s    ud5k9455r[   r  ra  )r   r   r   r   r+   r  r  )rW   r7  r:  r  r  r  r  s        @@rY   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 rS   r_   r  s    rY   ra  z2ForwardRefTests.test_callable_forward.<locals>.foo  r  r[   )r"   r   r+   r  r  r   r  s     rY   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 rS   r_   r  s    rY   ra  z@ForwardRefTests.test_callable_with_ellipsis_forward.<locals>.foo  r  r[   .)r  zCallable[..., T])r   r+   r  r  r"   r   r  s     rY   #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>.CrU  )ClassVar[int])rP  rV  r  )
Final[int]constr   r$   r   r%   r   N)	r\   r]   r^   r  r@   r   r   r   r   r_   r[   rY   r7  r    s5    45Ay01523Ay./3AzAwNr[   r7  c                   "    e Zd ZU dZed   ed<   y)6ForwardRefTests.test_special_forms_forward.<locals>.CFrU  r  r   N)r\   r]   r^   r   r   r   r_   r[   rY   CFr    s    $%AtL!%r[   r  r  r   r   r   )r   r+   r  r$   r   r%   r}   r~   )rW   r7  r  s      rY   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    rY   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 rS   r_   r  s    rY   ra  z6ForwardRefTests.test_delayed_syntax_error.<locals>.foo  r  r[   )r  zNode[T)r}   r  r+   r  s     rY   test_delayed_syntax_errorz)ForwardRefTests.test_delayed_syntax_error   s+    	 {+3 ,++s   /8c                 6   t         j                  t         j                  t         j                  t         j                  fD ]@  }| j                  |      5  | j                  t              5  |d    d d d        d d d        B y # 1 sw Y   xY w# 1 sw Y   YxY w)N)formr   )rT   r   Setr5   Dequeri   r}   r  )rW   r  s     rY   test_syntax_error_empty_stringz.ForwardRefTests.test_syntax_error_empty_string  sf    [[&**fkk6<<HD4(&&{3H 4 )( I33 )(s$   B*B0BBBB	c                     dd}| j                  t              5  t        |t                      d d d        y # 1 sw Y   y xY w)Nc                      y rS   r_   r  s    rY   ra  z,ForwardRefTests.test_name_error.<locals>.foo  r  r[   )r  zNoode[T])r}   	NameErrorr+   r  r  s     rY   test_name_errorzForwardRefTests.test_name_error  s/    	 y)3) *))s	   8Ac                 `    t         dddi fd       }t        |      }| j                  |i        y )Nr  	whateversr   c                      y rS   r_   r  s    rY   ra  z/ForwardRefTests.test_no_type_check.<locals>.foo      r[   )r2   r+   r   )rW   ra  ths      rY   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 rS   r_   r  s    rY   ra  z7ForwardRefTests.test_no_type_check_class.<locals>.C.foo#  r  r[   Nr\   r]   r^   ra  r_   r[   rY   r7  r  !      { r r[   r7  )r2   r+   ra  r   )rW   r7  cthiths       rY   test_no_type_check_classz(ForwardRefTests.test_no_type_check_class  sY    		 	 
	 QUU#b!QSWW%b!r[   c                     G d d      t          G fdd             }| j                  t        j                        dt        i        G d d|      }| j                  t        |j
                        dt        i       y )Nc                       e Zd ZdefdZy)6ForwardRefTests.test_no_type_check_no_bases.<locals>.Cr   c                      y rS   r_   r   s     rY   r  z;ForwardRefTests.test_no_type_check_no_bases.<locals>.C.meth-  s    Cr[   Nr  r_   r[   rY   r7  r  ,  s
    'c'r[   r7  c                       e Zd ZW  Zy)6ForwardRefTests.test_no_type_check_no_bases.<locals>.DN)r\   r]   r^   r  r7  s   rY   r:  r  .  s    Ar[   r:  r   c                       e Zd ZdefdZy):ForwardRefTests.test_no_type_check_no_bases.<locals>.Childr   c                      y rS   r_   r   s     rY   ra  z>ForwardRefTests.test_no_type_check_no_bases.<locals>.Child.foo7  r   r[   N)r\   r]   r^   r   ra  r_   r[   rY   r#  r  6  s
    &S&r[   r#  )r2   r   r+   r  r   ra  )rW   r:  r#  r7  s      @rY   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  r_   r[   rY   r  r  =  rs  r[   r  c                       e Zd ZU eed<   y):ForwardRefTests.test_no_type_check_nested_types.<locals>.Br
  Nr  r_   r[   rY   r   r  ?  rs  r[   r   c                   D    e Zd ZU eed<    G d d      Z G d d      ZeZy):ForwardRefTests.test_no_type_check_nested_types.<locals>.Ar  c                   ,    e Zd ZU eed<    G d d      Zy)<ForwardRefTests.test_no_type_check_nested_types.<locals>.A.Br   c                       e Zd ZU eed<   y)>ForwardRefTests.test_no_type_check_nested_types.<locals>.A.B.Cr  Nr  r_   r[   rY   r7  r  F  s    Fr[   r7  N)r\   r]   r^   r   r   r7  r_   r[   rY   r   r  D  s     r[   r   c                       e Zd ZU eed<   y)<ForwardRefTests.test_no_type_check_nested_types.<locals>.A.Dr   Nr  r_   r[   rY   r:  r  H      r[   r:  N)r\   r]   r^   r   r   r   r:  r  r_   r[   rY   r   r  A  s"    F   Er[   r   )rI  )not_modified)r2   r   r7  r:  ri   r   __no_type_check__r   r+   r}   r  r   )rW   r  r   r   rI  r  s         rY   test_no_type_check_nested_typesz/ForwardRefTests.test_no_type_check_nested_types;  s   	 		 				 		 
		 acceeQSS)EE* 7 78  !6; +* *
 #AJL<8&&~6 22 7##N<$@"E 98 '	 +* 76 98s0   +7DD.D"(#D.D	"D+'D..D7	c                 R   t          G d d             }| j                  |j                  j                         | j	                  t        |j                        i        | j                  |j                  j                         | j	                  t        |j                        i        y )Nc                   @    e Zd Zededefd       Zededefd       Zy)IForwardRefTests.test_no_type_check_class_and_static_methods.<locals>.Somer   r   c                      y rS   r_   r   s    rY   stzLForwardRefTests.test_no_type_check_class_and_static_methods.<locals>.Some.st[  s    #&r[   r   c                      y rS   r_   )r  r   s     rY   clzLForwardRefTests.test_no_type_check_class_and_static_methods.<locals>.Some.cl]  s    (+r[   N)r\   r]   r^   r
  r   r  rf  r
  r_   r[   rY   Somer  Y  s2    &c&c& &+3+3+ +r[   r  )r2   r   r  r  r   r+   r
  )rW   r  s     rY   +test_no_type_check_class_and_static_methodsz;ForwardRefTests.test_no_type_check_class_and_static_methodsX  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rS   )	r   rK  r  r}   r  rI  rL  rN  rO  r   s    rY   test_no_type_check_other_modulez/ForwardRefTests.test_no_type_check_other_modulee  s    );;<~.));; /~.))//AA / 	0BBC~.,,>> /. /... /.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 rS   r_   r  s    rY   r   zBForwardRefTests.test_no_type_check_foreign_functions.<locals>.somer  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)r\   r]   r^   
some_aliasrf  
some_classr
  some_static)r   s   rY   r   r  u  s    J$T*J&t,Kr[   r   )r   r   )r   r2   r}   r  r  r   r+   )rW   r   r   s     @rY   $test_no_type_check_foreign_functionsz4ForwardRefTests.test_no_type_check_foreign_functionsp  sp    	 	 	 
	- 	- 
	-
 ~."" /-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 rS   r_   r   s    rY   r2  z=ForwardRefTests.test_no_type_check_lambda.<locals>.A.<lambda>  s    Cr[   r  N)r\   r]   r^   r  r"   r   r   r_   r[   rY   r   r    s     )8C3%*%7r[   r   )r2   r   r  r  r   r+   r  s     rY   test_no_type_check_lambdaz)ForwardRefTests.test_no_type_check_lambda  sJ    		8 	8 
	8 	//0.3r[   c                 "    t        t               y rS   )r2   r  r   s    rY   test_no_type_check_TypeErrorz,ForwardRefTests.test_no_type_check_TypeError  s     	dr[   c                      G d d      } G d d      } G d d      } G d d      }d	t         j                  t           i}||||fD ]  }| j                  t	        |      |        y )
Nc                   6    e Zd ZU dZej
                  e   ed<   y)CForwardRefTests.test_no_type_check_forward_ref_as_string.<locals>.C   ra  N)r\   r]   r^   ra  rT   r$   r   r   r_   r[   rY   r7  r     s    ()C%)r[   r7  c                   "    e Zd ZU dZee   ed<   y)CForwardRefTests.test_no_type_check_forward_ref_as_string.<locals>.Dr!  ra  N)r\   r]   r^   ra  r$   r   r   r_   r[   rY   r:  r#    s    !"C#"r[   r:  c                       e Zd ZU dZded<   y)CForwardRefTests.test_no_type_check_forward_ref_as_string.<locals>.Er!  r
  ra  Nr\   r]   r^   ra  r   r_   r[   rY   r  r%    s    *+C'+r[   r  c                       e Zd ZU dZded<   y)CForwardRefTests.test_no_type_check_forward_ref_as_string.<locals>.Fr!  r  ra  Nr&  r_   r[   rY   r  r(    s    #$C$r[   r  ra  )rT   r$   r   r   r+   )rW   r7  r:  r  r  expected_resultclazzs          rY   (test_no_type_check_forward_ref_as_stringz8ForwardRefTests.test_no_type_check_forward_ref_as_string  sf    	* 	*	# 	#	, 	,	% 	% !&//#"67Aq\E^E2OD "r[   c                      G d d      } G d d      }||fD ]+  }| j                  t              5  t        |       d d d        - y # 1 sw Y   8xY w)Nc                       e Zd ZU dZded<   y)GForwardRefTests.test_nested_classvar_fails_forward_ref_check.<locals>.Er!  z%typing.ClassVar[typing.ClassVar[int]]ra  Nr&  r_   r[   rY   r  r.    s    ;<C8<r[   r  c                   "    e Zd ZU dZed   ed<   y)GForwardRefTests.test_nested_classvar_fails_forward_ref_check.<locals>.Fr!  r  ra  N)r\   r]   r^   ra  r$   r   r_   r[   rY   r  r0    s    -.C/*.r[   r  )r}   r~   r+   )rW   r  r  r*  s       rY   ,test_nested_classvar_fails_forward_ref_checkz<ForwardRefTests.test_nested_classvar_fails_forward_ref_check  sK    	= 	=	/ 	/ VE""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 rS   r_   r
  s    rY   magic_decoratorz@ForwardRefTests.test_meta_no_type_check.<locals>.magic_decorator  s    Kr[   r4  r  r  r   c                      y rS   r_   r  s    rY   ra  z4ForwardRefTests.test_meta_no_type_check.<locals>.foo  r  r[   c                       e Zd Zdddi fdZy)2ForwardRefTests.test_meta_no_type_check.<locals>.Cr  r  r   c                      y rS   r_   r  s    rY   ra  z6ForwardRefTests.test_meta_no_type_check.<locals>.C.foo  r  r[   Nr  r_   r[   rY   r7  r7    r  r[   r7  ra  )r3   r   r\   r+   ra  )rW   r4  ra  r7  r  r  r  s          rY   test_meta_no_type_checkz'ForwardRefTests.test_meta_no_type_check  s    	 	 
!	 	113DE		; 	2 	 
	 
	 	 
	 	u-C R QUU#b!QSWW%b!r[   c                     d}i }t        ||       t        |d   j                        }| j                  ||d   |d   d       y )Nz^class C:
    def foo(self, a: 'C') -> 'D': pass
class D:
    def bar(self, b: 'D') -> C: pass
r7  r:  )r  r   )ro  r+   ra  r   )rW   r  rq  hintss       rY   test_default_globalsz$ForwardRefTests.test_default_globals  sH    9
 T2r#w{{+bgC ABr[   c                 :   | j                  t        t        t                     d   t        t                  | j                  t        t        t                     d   t        t                  | j                  t        t        t                     d   t               y )Nr  )r   r   Loopr  r%   r   r   r   s    rY   test_final_forward_refz&ForwardRefTests.test_final_forward_ref  sd    T79-f5uT{CCgi08%*ECgi08%@r[   c                     t        d      }| j                  |dz  t        |df          | j                  d|z  t        d|f          y r  )rA   r   r   r  s     rY   r  zForwardRefTests.test_or  sC    sOS%3-0q%Q-0r[   N)'r\   r]   r^   r.  rh  rj  rl  rr  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r+  r1  r9  r<  r?  r  r_   r[   rY   rQ  rQ    s    !7F
 
!TA*T,80I
0*+72@22+$
 *!
"@ F:6	?M4
E&"2	CA
1r[   rQ  c                     d| z  |z   S )NrP  r_   r  s     rY   cached_funcrB    s    q519r[   c                   2    e Zd Zed        Zed        Zd Zy)MethodHolderc                      y rS   r_   r  s    rY   r
  zMethodHolder.clsmethod  s    r[   c                       y rS   r_   r_   r[   rY   r
  zMethodHolder.stmethod  r
  r[   c                      y rS   r_   r   s    rY   r  zMethodHolder.method  s    cr[   N)r\   r]   r^   rf  r
  r
  r
  r  r_   r[   rY   rD  rD    s!      r[   rD  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 rS   r_   r_   r[   rY   rX  z/OverloadTests.test_overload_fails.<locals>.blah  s    r[   )r}   r>  r   rW   rX  s     rY   test_overload_failsz!OverloadTests.test_overload_fails  s6    23  F 433r   c                 0    t         d        }d } |        y )Nc                       y rS   r_   r_   r[   rY   rX  z2OverloadTests.test_overload_succeeds.<locals>.blah  r  r[   c                       y rS   r_   r_   r[   rY   rX  z2OverloadTests.test_overload_succeeds.<locals>.blah  r  r[   r   rL  s     rY   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 rS   r   r  r_   r[   rY   r2  zCOverloadTests.test_overload_on_compiled_functions.<locals>.<lambda>  s	    {4'8r[   )	r
   r   r   rT   _overload_registryr   sumprintr   r   s    rY   #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 rS   r_   r_   r[   rY   rX  z,OverloadTests.set_up_overloads.<locals>.blah  r  r[   c                       y rS   r_   r_   r[   rY   rX  z,OverloadTests.set_up_overloads.<locals>.blah  r  r[   c                       y rS   r_   r_   r[   rY   rX  z,OverloadTests.set_up_overloads.<locals>.blah  r  r[   rQ  )rW   rX  	overload1	overload2s       rY   set_up_overloadszOverloadTests.set_up_overloads  s?    	 		 		 i+++r[   rT  c                       t        t              S rS   rV  r_   r[   rY   r2  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 rS   r_   r_   r[   rY   some_other_funcz=OverloadTests.test_overload_registry.<locals>.some_other_func#  r  r[   c                       y rS   r_   r_   r[   rY   re  z=OverloadTests.test_overload_registry.<locals>.some_other_func&  r  r[   c                       y rS   r_   r_   r[   rY   not_overloadedz<OverloadTests.test_overload_registry.<locals>.not_overloaded)  s    dr[   c                       y rS   r_   r_   r[   rY   the_only_onez:OverloadTests.test_overload_registry.<locals>.the_only_one3  r  r[   )	r   rT   rW  ra  r   r  r   r   r   )rW   impl	overloadsre  other_overloadrh  rj  s          rY   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 r   )rf   ra  r   r  r   )rW   _rk  rl  s       rY   test_overload_registry_repeatedz-OverloadTests.test_overload_registry_repeated7  s<    qA"335OD)T-"56	B r[   N)r\   r]   r^   rM  rR  rK   rZ  ra  r
   r   rn  rq  r_   r[   rY   rI  rI    sP     > >,& &-.08088Cr[   rI  )
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 rS   r  rW   r  s     rY   r   zAwaitableWrapper.__init__H  	    
r[   r   c              #   *   K   d  | j                   S wrS   r{  r   s    rY   	__await__zAwaitableWrapper.__await__K  s     zzs   N)r\   r]   r^   r   rT   Iteratorrw  r  r_   r[   rY   ry  ry  F  s    6??3/ r[   ry  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 rS   r{  r|  s     rY   r   zAsyncIteratorWrapper.__init__Q  r}  r[   r   c                     | S rS   r_   r   s    rY   	__aiter__zAsyncIteratorWrapper.__aiter__T  s    r[   c                 J   K   | j                    d {   }|r|S t        7 wrS   )r  StopAsyncIteration)rW   datas     rY   	__anext__zAsyncIteratorWrapper.__anext__W  s%     ZZK$$	  s   #!#N)
r\   r]   r^   rT   r  rw  r   rn  r  r  r_   r[   rY   r  r  O  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{   r_   r   s    rY   
__aenter__zACM.__aenter___  s	        c                    K   y wrS   r_   )rW   etyper  tbs       rY   	__aexit__zACM.__aexit__a  s	     r  N)r\   r]   r^   r   r  r  r_   r[   rY   r  r  ^  s    # r[   r  c                       e Zd ZU eed<   y)r   r   N)r\   r]   r^   rp  r   r_   r[   rY   r   r   d  s    Hr[   r   c                   <    e Zd ZU dZeed       ed<   eed<   eed<   y)r   Nr   r   r   )r\   r]   r^   r   r$   r   r   r   r_   r[   rY   r   r   f  s    !%Ax%
F
Fr[   r   c                   ,    e Zd ZU  e       Zed    ed<   y)CSubrR  N)r\   r]   r^   r   rR  r$   r   r_   r[   rY   r  r  j  s    #Axr[   r  c                   (    e Zd ZU g Zeee      ed<   y)r  lstN)r\   r]   r^   r  r$   r   r   r   r_   r[   rY   r  r  l  s    C$q'	r[   r  c                       e Zd ZU ed    ed<   y)r>  r  N)r\   r]   r^   r%   r   r_   r[   rY   r>  r>  o  s    
-r[   r>  c                   "    e Zd ZU d ed<   ded<   y)NoneAndForwardparentNmeaningrt  r_   r[   rY   r  r  r  s    Mr[   r  c                   "    e Zd ZU eed<   eed<   y)CoolEmployeer  coolNr\   r]   r^   r   r   r   r_   r[   rY   r  r  v  s    
I
Ir[   r  c                   &    e Zd ZU eed<   dZeed<   y)CoolEmployeeWithDefaultr  r   r  N)r\   r]   r^   r   r   r  r   r_   r[   rY   r  r  z  s    
ID#Mr[   r  c                       e Zd ZU eed<   d Zy)XMethr   c                      d| j                   z  S r   r   r   s    rY   doublezXMeth.double  s    466zr[   N)r\   r]   r^   r   r   r  r_   r[   rY   r  r  ~  s    
Fr[   r  c                   2    e Zd ZU eed<   dZeed<   d Zd Zy)XReprr   rb   r   c                 8    | j                    d| j                   S )Nz -> r  r   s    rY   __str__zXRepr.__str__  s    &&dffX&&r[   c                      yrX  r_   rW   rd  s     rY   __add__zXRepr.__add__  s    r[   N)r\   r]   r^   r   r   r   r  r  r_   r[   rY   r  r    s    
FAsJ'r[   r  Labelr  c                   "    e Zd ZU eed<   eed<   y)Point2Dr   r   Nr  r_   r[   rY   r  r    r  r[   r  c                   "    e Zd ZU eed<   eed<   y)Point2DGenericr  r   Nr\   r]   r^   r   r   r_   r[   rY   r  r    s    DDr[   r  c                       e Zd ZU eed<   y)r   r   Nr  r_   r[   rY   r   r     r  r[   r   Ftotalc                       e Zd ZU eed<   y)
BarGenericr   Nr  r_   r[   rY   r  r    r  r[   r  c                       e Zd Zy)LabelPoint2DNrp   r_   r[   rY   r  r    r   r[   r  c                   "    e Zd ZU eed<   eed<   y)Options	log_levellog_pathNr  r_   r[   rY   r  r    s    NMr[   r  c                   (    e Zd ZU eed<   ee   ed<   y)
TotalMovietitler_  N)r\   r]   r^   r   r   r7   r   r_   r[   rY   r  r    s    J
c
r[   r  c                   (    e Zd ZU ee   ed<   eed<   y)NontotalMovier  r_  N)r\   r]   r^   r8   r   r   r   r_   r[   rY   r  r    s    C=
Ir[   r  c                       e Zd ZU ee   ed<   y)ParentNontotalMovier  Nr\   r]   r^   r8   r   r   r_   r[   rY   r  r    s    C=r[   r  c                       e Zd ZU ee   ed<   y)ChildTotalMovier_  Nr\   r]   r^   r7   r   r   r_   r[   rY   r  r    s    
c
r[   r  c                   2    e Zd ZU eeee   df   df   ed<   y)ParentDeeplyAnnotatedMovierp	  another levelr  N)r\   r]   r^   r@   r8   r   r   r_   r[   rY   r  r    s     Yx}h67HIIr[   r  c                   (    e Zd ZU eeedf      ed<   y)ChildDeeplyAnnotatedMovie  r_  N)r\   r]   r^   r7   r@   r   r   r_   r[   rY   r  r    s    
iT	*
++r[   r  c                   B    e Zd ZU eee   df   ed<   eeedf      ed<   y)AnnotatedMovierp	  r  r  r_  N	r\   r]   r^   r@   r8   r   r   r7   r   r_   r[   rY   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)DeeplyAnnotatedMovierp	  r  r  r  r_  Nr  r_   r[   rY   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)r\   r]   r^   r@   r   r7   r_   r[   rY   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_aNrt  r_   r[   rY   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rS   r_   )r  r   s     rY   g_withr    s#     rQ rrrrrrs0   :!:%:#::7.7:r|   c                   v    e Zd Zej                  dd       Zej                  ej                  dd              Zy)ForRefExamplec                      y rS   r_   r   s    rY   r
  zForRefExample.func  s    r[   c                      y rS   r_   r   s    rY   r	  zForRefExample.nested  s     	r[   N)rW   r  )r\   r]   r^   rr  decr
  r	  r_   r[   rY   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    rY   (test_get_type_hints_from_various_objectsz9GetTypeHintTests.test_get_type_hints_from_various_objects  sj    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   )rb   rX   r   r   r  )	r   r   r   rp  r   r   rr  rs  rt  )rW   ann_module_type_hintss     rY   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   rN   r   r   r   r   )rW   	mgc_hintss     rY   &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   rR  r  r   )r  r  )r  r  some_b)my_inner_a1my_inner_a2
my_outer_a)r   r   rr  r7  r   r   j_classr  r  r   r:  r   r  r   h_classr  ra  r  r  r  rN   r   r   r  r   s    rY   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)r\   r]   r^   r  r   r   r_   r[   rY   WithNoneDefaultr    s    E3r[   r  r  )r   r   r   )rW   r  s     rY   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 rS   r_   r   s     rY   r   zKGetTypeHintTests.test_respect_no_type_check.<locals>.NoTpCheck.Inn.__init__  rX  r[   N)r   z
not a typer   r_   r[   rY   Innr    s    8r[   r  N)r\   r]   r^   r  r_   r[   rY   	NoTpCheckr    s    9 9r[   r  c                       e Zd ZdefdZy):GetTypeHintTests.test_respect_no_type_check.<locals>.ABaser   c                      y rS   r_   r   s    rY   r  z?GetTypeHintTests.test_respect_no_type_check.<locals>.ABase.meth  s    cr[   Nr  r_   r[   rY   ABaser	    s
    !!r[   r  c                       e Zd Zy)8GetTypeHintTests.test_respect_no_type_check.<locals>.DerNrp   r_   r[   rY   Derr    s    r[   r  r   )r2   r   r  r  r   r   r   rs  NTCr  r#   r   r   )rW   r  r  r  s       rY   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 rS   )
r   r   r   r   rP  r  r  r  r   joinr   s    rY    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 rS   r_   r  s     rY   testfz6GetTypeHintTests.test_previous_behavior.<locals>.testf,  r{  r[   r   r   c                      y rS   r_   r   s    rY   testgz6GetTypeHintTests.test_previous_behavior.<locals>.testg/  r  r[   )r   N)r   r   r   r   r   )rW   r  r  s      rY   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>.ANrp   r_   r[   rY   r   r  3  r   r[   r   c                       e Zd Zy)KGetTypeHintTests.test_get_type_hints_for_object_with_annotations.<locals>.BNrp   r_   r[   rY   r   r  4  r   r[   r   r   )r   r   r   r  )rW   r   r   r   s       rY   /test_get_type_hints_for_object_with_annotationsz@GetTypeHintTests.test_get_type_hints_for_object_with_annotations2  s<    C #JQ)C84r[   c           	      L   | j                  t        t        j                  t        j                        dt
        j                  t        j                     i       | j                  t        t        t                     t        t        t        t              t        d       | j                  t        t        t                     t        t           t        t        t        t        t              d       | j                  t        t              dt        t        t              i       y )Nvar)r   r   r   )rR  r   r   r   r  )r   r   rs  CVr  rT   r$   r   r  r   r   r  r  r   r   r   s    rY   test_get_type_hints_ClassVarz-GetTypeHintTests.test_get_type_hints_ClassVar9  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     rY   ,test_get_type_hints_wrapped_decoratored_funcz=GetTypeHintTests.test_get_type_hints_wrapped_decoratored_funcC  sB    =)]//0':]112G<r[   c                 <   dt         d   fd}t        t        df   }| j                  t	        |t               t                     dt         t           i       | j                  t	        |t               t               d      dt         t        t        df      i       dt        t        d         fd}t        t        df   }| j                  t	        |t               t                     dt        t           i       | j                  t	        |t               t               d      dt        t        t        df      i       t        t        t        df   d	f   }d|fd
}| j                  t	        |t               t                     d   t        t        d	f          | j                  t	        |t               t               d      d   |       t        t        t        df   d	f   }d|fd}| j                  t	        |t               t                     d   t        t        d	f          | j                  t	        |t               t               d      d   |       dt        j                  d	t        t         t           df   f   dt        j                  t        t        t        df   f   fd}| j                  t	        |t               t                     t        j                  d	t         t           f   t        j                  t        t        f   d       t        j                  d	t         t           f   }d|fd}| j                  t	        |t               t               d      d   |       t        j                  t        t         z  df   }d|fd}	| j                  t	        |	t               t                     dt        t         z  i       | j                  t	        |	t               t               d      dt        j                  t        t         z  df   i       y )Nr   r  c                      y rS   r_   r   s    rY   rp	  z>GetTypeHintTests.test_get_type_hints_annotated.<locals>.foobarI  s    #r[   rb   r  Tinclude_extrasc                      y rS   r_   r   s    rY   rp	  z>GetTypeHintTests.test_get_type_hints_annotated.<locals>.foobarT  rT  r[   )rb   r   .c                      y rS   r_   r   s    rY   rx	  z>GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo`  r  r[   c                      y rS   r_   r   s    rY   rx	  z>GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfooh  r  r[   r  r   mutablec                      y rS   r_   r  s     rY   rz	  z?GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo2o  s    DGr[   r  c                      y rS   r_   r   s    rY   barfoo3z?GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo3w  r  r[   c                      y rS   r_   r   s    rY   barfoo4z?GetTypeHintTests.test_get_type_hints_annotated.<locals>.barfoo4}  r  r[   )r   r@   r   r   r+   r  r  r  rA   r   r   r  rT   r"   r   r   rp  )
rW   rp	  r  BArx	  rz	  BA2r2  BA3r4  s
             rY   test_get_type_hints_annotatedz.GetTypeHintTests.test_get_type_hints_annotatedH  sN   %d3i%c7l#679fh7$s)	
 	679fhtL$yg./0	

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

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

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

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

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

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

 	5==')VX>Ah%(3	
r[   c                     ddt         t        df   fd}| j                  t        |      dt        i       | j                  t        |d      dt         t        df   i       y )Nr   r  c                      y rS   r_   r   s    rY   annotated_with_none_defaultzeGetTypeHintTests.test_get_type_hints_annotated_with_none_default.<locals>.annotated_with_none_default  s    3r[   Tr*  rS   )r@   r   r   r+   )rW   rL  s     rY   /test_get_type_hints_annotated_with_none_defaultz@GetTypeHintTests.test_get_type_hints_annotated_with_none_default  s]    N9S&[+AN67#J	
 	6tL)CK()	
r[   c                 Z     G d d      }| j                  t        |      dt        i       y )Nc                       e Zd ZU eZded<   y)IGetTypeHintTests.test_get_type_hints_classes_str_annotations.<locals>.Foor   r   N)r\   r]   r^   r   r   r   r_   r[   rY   r   rP    s    AFr[   r   r   )r   r+   r   r  s     rY   +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>.BadModuleNrp   r_   r[   rY   	BadModulerT    r  r[   rU  bad)r]   rO  sysmodulesr   r+   )rW   rU  s     rY   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>.BadBasera  N)r\   r]   r^   r  r   r_   r[   rY   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	  r_   r[   rY   BadTyper_    s    Ir[   r`  rV  r]  )r]   rO  rW  rX  r   r+   r  r  )rW   r]  r`  s      rY   (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+   ru  r   r%   r   MyClass)rW   r;  s     rY   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+   rv  r   s    rY   test_top_level_class_varz)GetTypeHintTests.test_top_level_class_var  s0    ##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_  Tr*  rp	  r  r  r  r   r  )r   r+   r  r   r   r7   r  r@   r8   r  r  rO   VeryAnnotatedr  r  r   s    rY   test_get_type_hints_typeddictz.GetTypeHintTests.test_get_type_hints_typeddict  sh   
3sC5PQ
4H$K
 	
 	73PS9TUtLx}h67	#t) 45O
 	
 	(<=VY?Z[(<TRx}hGH	#t) 45U
 	
 	(:;sTW=XY(:4Px}hGH	#t) 45S
 	
 	(:(H(HICQT:V(:(H(HY]^8C=#sC78a
 	 	8CQT:UVMc]K,<P
 	 	(ABc[^D_`(ARVWx}hGH	#t) 45Z
 	r[   c                    t        d      }dt        j                  j                  t        gt        f   fd}dt        j                  j                  dt        f   fd}dt        j                  j                  |t        f   fd}| j                  t        |      dt        j                  j                  t        gt        f   i       | j                  t        |      dt        j                  j                  dt        f   i       | j                  t        |      dt        j                  j                  |t        f   i       y )Nr  r   c                      y rS   r_   r   s    rY   rX   zHGetTypeHintTests.test_get_type_hints_collections_abc_callable.<locals>.f  s    r[   .c                      y rS   r_   r   s    rY   r  zHGetTypeHintTests.test_get_type_hints_collections_abc_callable.<locals>.g  r
  r[   c                      y rS   r_   r   s    rY   r  zHGetTypeHintTests.test_get_type_hints_collections_abc_callable.<locals>.h  s    Cr[   )rE   r  r{  r"   r   r   r+   )rW   r  rX   r  r  s        rY   ,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)r\   r]   r^   r  r  r	   r  r  r  r  r  r  r  r#  r&  r8  r=  rI  rM  rQ  rY  ra  rd  rf  rj  ro  r_   r[   rY   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>.CNrp   r_   r[   rY   r7  rt    r   r[   r7  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  r7  s        rY   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>.CNrp   r_   r[   rY   r7  ry  7  r   r[   r7  r_   ru  .oner   threer  r  r   )%r   r#   r   r-   r   rT   r1  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   r7  r  r  s        rY   test_get_argsz"GetUtilitiesTestCase.test_get_args5  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)r\   r]   r^   r   r|  r_   r[   rY   rq  rq    s    E>ATr[   rq  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   rT   Hashabler   r   s    rY   test_hashablez!CollectionsAbcTests.test_hashable{  *    b&//2  V__5r[   c                    | j                  g t        j                         | j                  g t        j                         | j                  g t        j                         | j                  dt        j                         | j	                  t
        t        j                         | j	                  t
        t        j                         y r{   )r   rT   r  r   r  r  r   s    rY   test_iterablez!CollectionsAbcTests.test_iterable  s|    b&//2 	b&//2b&//2  V__5dFOO4dFOO4r[   c                     t        g       }| j                  |t        j                         | j	                  dt        j                         y r{   )r!	  r   rT   r  r   )rW   its     rY   test_iteratorz!CollectionsAbcTests.test_iterator  s3    "Xb&//2  V__5r[   c                     dt         j                  t           fd} |       }| j                  |t         j                         | j	                  |t         j                         |j                  d        y )Nr   c                  4   K   t        d       d {   S 7 wr{   )ry  r_   r[   rY   ra  z/CollectionsAbcTests.test_awaitable.<locals>.foo  s     )"----s   )rT   	Awaitabler   r   r   sendrW   ra  r  s      rY   test_awaitablez"CollectionsAbcTests.test_awaitable  sW    	.6++C0 	.Ea!1!12  f&6&67	tr[   c                 p   d } |       }| j                  |t        j                         | j                  t              5  t        |t        j                  t                  d d d        | j                  |t        j                         	 |j                  d        y # 1 sw Y   <xY w# t        $ r Y y w xY w)Nc                     K   y wrS   r_   r_   r[   rY   ra  z/CollectionsAbcTests.test_coroutine.<locals>.foo  s	     r  )
r   rT   	Coroutiner}   r~   r   r   r   r  StopIterationr  s      rY   test_coroutinez"CollectionsAbcTests.test_coroutine  s    	Ea!1!12y)q&**3/0 *  f&6&67	FF4L	 *)
  		s    "BB) B&)	B54B5c                     t        d      }t        |      }| j                  |t        j                         | j                  |t        j                         | j                  dt        j                         y Nr  r|   )rf   r  r   rT   AsyncIterabler   rW   base_itr  s      rY   test_async_iterablez'CollectionsAbcTests.test_async_iterable  sW    )!'*b&"6"67b&"6"67  V%9%9:r[   c                     t        d      }t        |      }| j                  |t        j                         | j                  dt        j                         y r  )rf   r  r   rT   rn  r   r  s      rY   test_async_iteratorz'CollectionsAbcTests.test_async_iterator  sA    )!'*b&"6"67  V%9%9:r[   c                     | j                  g t        j                         | j                  dt        j                         y r{   )r   rT   r  r   r   s    rY   
test_sizedzCollectionsAbcTests.test_sized  s*    b&,,/  V\\2r[   c                     | j                  g t        j                         | j                  dt        j                         y r{   )r   rT   r	  r   r   s    rY   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  rT   
Collectionr  r  r  r   r   s    rY   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   rO  rT   r	  r   r   s    rY   test_abstractsetz$CollectionsAbcTests.test_abstractset  s0    ceV%7%78  V%7%78r[   c                     | j                  t               t        j                         | j	                  t               t        j                         y rS   )r   rO  rT   
MutableSetr   r  r   s    rY   test_mutablesetz#CollectionsAbcTests.test_mutableset  s2    ceV%6%67  f.?.?@r[   c                     | j                  i t        j                         | j                  dt        j                         y r{   )r   rT   r  r   r   s    rY   test_mappingz CollectionsAbcTests.test_mapping  s*    b&..1  V^^4r[   c                     | j                  i t        j                         | j                  dt        j                         y r{   )r   rT   r!   r   r   s    rY   test_mutablemappingz'CollectionsAbcTests.test_mutablemapping  s.    b&"7"78  V%:%:;r[   c                     | j                  g t        j                         | j                  dt        j                         y r{   )r   rT   r	  r   r   s    rY   test_sequencez!CollectionsAbcTests.test_sequence  r  r[   c                     | j                  g t        j                         | j                  dt        j                         y r  )r   rT   MutableSequencer   r   s    rY   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>.FooNrp   r_   r[   rY   r   r    r   r[   r   c                       e Zd Zy)0CollectionsAbcTests.test_bytestring.<locals>.BarNrp   r_   r[   rY   r   r    r   r[   r   )assertWarnsDeprecationWarningr   rT   
ByteString	bytearrayr  rn  s      rY   test_bytestringz#CollectionsAbcTests.test_bytestring  s    01!!#v'8'89 201!!)C.&2C2CD 201-f''- 201?f'')9)9? 21 21111111s/   !D*DD)D(DDD%(D1c                 L    | j                  t        t        j                         y rS   )r  r  rT   r   r   s    rY   	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>.MyDequeNrp   r_   r[   rY   MyDequer    r   r[   r  )r  r  dequerT   r  r   r   )rW   r  s     rY   
test_dequezCollectionsAbcTests.test_deque  sE    k//>-fll3'-gi):):;r[   c                 `    | j                  t        j                  t        j                         y rS   )r  r  CounterrT   r   s    rY   test_counterz CollectionsAbcTests.test_counter  s    k116>>Br[   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rS   )r  rO  rT   r  r  r  r   s    rY   test_setzCollectionsAbcTests.test_set  s*    c6::.  FJJ7r[   c                     | j                  t        t        j                         | j	                  t
        t        j                         y rS   )r  r  rT   ra	  r  rO  r   s    rY   test_frozensetz"CollectionsAbcTests.test_frozenset  s.    i)9)9:  f&6&67r[   c                 L    | j                  t        t        j                         y rS   )r  r  rT   r    r   s    rY   r  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      rY   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rS   )r}   r~   rT   r   r   r   r   s    rY   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>.MyListNrp   r_   r[   rY   MyListr    r  r[   r  )rT   r   r   r   r	  r  r  r  )rW   r  r  s      rY   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rS   )r}   r~   rT   r    r   r   r   r   r   s    rY   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>.MyDictNrp   r_   r[   rY   r	  r     r  r[   r	  )	rT   r    r   r   r   r!   r  r  r  )rW   r	  r   s      rY   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 rS   )
r   r   rT   r	  r  r   r   r   r   r   r   s    rY   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>.MyDefDictNrp   r_   r[   rY   	MyDefDictr  1  r  r[   r  )	rT   r	  r   r   r   r  r  r   r  )rW   r  dds      rY   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 rS   )	r   r   rT   OrderedDictr  r   r   r   r   r   s    rY   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>.MyOrdDictNrp   r_   r[   rY   	MyOrdDictr  A  r  r[   r  )rT   r  r   r   r   r  r  r  )rW   r  ods      rY   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>.CMNrp   r_   r[   rY   CMr  N  r   r[   r  )	r   r   rT   r	  r  r   r   r   r   )rW   r  s     rY   test_chainmap_instantiationz/CollectionsAbcTests.test_chainmap_instantiationJ  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>.MyChainMapNrp   r_   r[   rY   
MyChainMapr  S  r  r[   r  )rT   r	  r   r   r   r  r  r  )rW   r  r  s      rY   test_chainmap_subclassz*CollectionsAbcTests.test_chainmap_subclassQ  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>.DNrp   r_   r[   rY   r:  r  `  r   r[   r:  )r   r   rT   r  r  r  r   r   rW   r:  s     rY   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>.CNrp   r_   r[   rY   r7  r   g  r   r[   r7  )r   r   rT   r  r  r   r   r&  s     rY   test_counter_instantiationz.CollectionsAbcTests.test_counter_instantiationc  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>.MyCounterNrp   r_   r[   rY   	MyCounterr  l  r  r[   r  )rT   r  r   r   r  )rW   r  r   s      rY   #test_counter_subclass_instantiationz7CollectionsAbcTests.test_counter_subclass_instantiationj  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rS   )r}   r~   rT   r  r   r   r   s    rY   test_no_set_instantiationz-CollectionsAbcTests.test_no_set_instantiationt  sy    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>.MySetNrp   r_   r[   rY   rH  r  ~  r  r[   rH  )rT   r  r   r   )rW   rH  r   s      rY   test_set_subclass_instantiationz3CollectionsAbcTests.test_set_subclass_instantiation|  s/    	FJJsO 	 Ga'r[   c                    | j                  t              5  t        j                          d d d        | j                  t              5  t        j                  t                   d d d        | j                  t              5  t        j                  t
                   d d d        y # 1 sw Y   |xY w# 1 sw Y   OxY w# 1 sw Y   y xY wrS   )r}   r~   rT   ra	  r   r   r   s    rY   test_no_frozenset_instantiationz3CollectionsAbcTests.test_no_frozenset_instantiation  s    y) *y)Q! *y)S!# *)	 *)))))r  c                 v     G d dt         j                  t                 } |       }| j                  ||       y )Nc                       e Zd Zy)NCollectionsAbcTests.test_frozenset_subclass_instantiation.<locals>.MyFrozenSetNrp   r_   r[   rY   MyFrozenSetr    r  r[   r  )rT   ra	  r   r   )rW   r  r   s      rY   %test_frozenset_subclass_instantiationz9CollectionsAbcTests.test_frozenset_subclass_instantiation  s2    	&**3/ 	 Ma-r[   c                 X   | j                  t              5  t                d d d        | j                  t              5  t        t                   d d d        | j                  t              5  t        t                   d d d        y # 1 sw Y   hxY w# 1 sw Y   ExY w# 1 sw Y   y xY wrS   )r}   r~   r   r   r   r   s    rY   test_no_tuple_instantiationz/CollectionsAbcTests.test_no_tuple_instantiation  sl    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{   r_   r_   r[   rY   ra  z/CollectionsAbcTests.test_generator.<locals>.foo  s     H   )r  r   rT   	Generatorr  s      rY   test_generatorz"CollectionsAbcTests.test_generator  s(    	Ed1gv'7'78r[   c                    | j                  t              5  t        j                          d d d        | j                  t              5  t        j                  t        t        t        f           d d d        | j                  t              5  t        j                  t
        t
        t
        f           d d d        y # 1 sw Y   xY w# 1 sw Y   ZxY w# 1 sw Y   y xY wrS   )r}   r~   rT   r  r   r   r   s    rY   test_no_generator_instantiationz3CollectionsAbcTests.test_no_generator_instantiation  s    y) *y)Q1W%' *y)S#s]+- *)	 *)))))s#   B<'C'C<CCCc                 j    d } |       }| j                  t        |      t        j                         y )Nc                    K   d y wr{   r_   r_   r[   rY   rX   z3CollectionsAbcTests.test_async_generator.<locals>.f  s     X   	)r  r   rT   AsyncGenerator)rW   rX   r  s      rY   test_async_generatorz(CollectionsAbcTests.test_async_generator  s(    	Cd1gv'<'<=r[   c                    | j                  t              5  t        j                          d d d        | j                  t              5  t        j                  t        t        f           d d d        | j                  t              5  t        j                  t
        t
        f           d d d        y # 1 sw Y   xY w# 1 sw Y   UxY w# 1 sw Y   y xY wrS   )r}   r~   rT   r   r   r   r   s    rY   %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>.MMANrp   r_   r[   rY   MMAr&    r  r[   r'  c                   *    e Zd Zd Zd Zd Zd Zd Zy)1CollectionsAbcTests.test_subclassing.<locals>.MMCc                      y rS   r_   r	  s     rY   r  z=CollectionsAbcTests.test_subclassing.<locals>.MMC.__getitem__  r3  r[   c                      y rS   r_   r	  s      rY   r  z=CollectionsAbcTests.test_subclassing.<locals>.MMC.__setitem__  r  r[   c                      y rS   r_   r	  s     rY   r	  z=CollectionsAbcTests.test_subclassing.<locals>.MMC.__delitem__  r  r[   c                     t        d      S r  r 	  r   s    rY   rO  z:CollectionsAbcTests.test_subclassing.<locals>.MMC.__iter__  r"	  r[   c                      yrX  r_   r   s    rY   r$	  z9CollectionsAbcTests.test_subclassing.<locals>.MMC.__len__  r  r[   Nr%	  r_   r[   rY   MMCr)    r'	  r[   r/  r   c                   *    e Zd Zd Zd Zd Zd Zd Zy)1CollectionsAbcTests.test_subclassing.<locals>.MMBc                      y rS   r_   r	  s     rY   r  z=CollectionsAbcTests.test_subclassing.<locals>.MMB.__getitem__  r3  r[   c                      y rS   r_   r	  s      rY   r  z=CollectionsAbcTests.test_subclassing.<locals>.MMB.__setitem__  r  r[   c                      y rS   r_   r	  s     rY   r	  z=CollectionsAbcTests.test_subclassing.<locals>.MMB.__delitem__  r  r[   c                     t        d      S r  r 	  r   s    rY   rO  z:CollectionsAbcTests.test_subclassing.<locals>.MMB.__iter__  r"	  r[   c                      yrX  r_   r   s    rY   r$	  z9CollectionsAbcTests.test_subclassing.<locals>.MMB.__len__  r  r[   Nr%	  r_   r[   rY   MMBr1    r'	  r[   r7  c                       e Zd Zy)/CollectionsAbcTests.test_subclassing.<locals>.INrp   r_   r[   rY   r  r9    r   r[   r  c                       e Zd Zy)/CollectionsAbcTests.test_subclassing.<locals>.GNrp   r_   r[   rY   r  r;    r   r[   r  c               3      K   d y wrX  r_   r_   r[   rY   r  z/CollectionsAbcTests.test_subclassing.<locals>.g  s
     qr  )rT   r!   r}   r~   r   r  r   r
  r(	  r   r  r   r   r   r  r  r  r  r{  r   r  r  r  r   r   )rW   r'  r/  r7  r  r  r  s          rY   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)s38}fnn5 *c3'%%  q)5  c3/5a!1!12a1a!:!:;a!9!9:  a!,} *)b *)s   P/ (P</P9<Qc                 D    G d dt         j                  t        t        f         }d }| j                  |t         j                         | j                  |t         j                         | j                  |t
        j                  j                         | j                  |t
        j                  j                         | j                  t        |      |        |       }| j                  |t         j                         | j                  |t         j                         | j                  |t
        j                  j                         | j                  |t
        j                  j                         | j                  t        |      |       | j                  ||       y )Nc                       e Zd Zd ZddZy)?CollectionsAbcTests.test_subclassing_async_generator.<locals>.Gc                      y rS   r_   r|  s     rY   asendzECollectionsAbcTests.test_subclassing_async_generator.<locals>.G.asend  r  r[   Nc                      y rS   r_   )rW   typvalr  s       rY   athrowzFCollectionsAbcTests.test_subclassing_async_generator.<locals>.G.athrow  r  r[   r`
  )r\   r]   r^   rB  rF  r_   r[   rY   r  r@    s    r[   r  c                    K   d y wrX  r_   r_   r[   rY   r  z?CollectionsAbcTests.test_subclassing_async_generator.<locals>.g  s
     Qwr  )rT   r   r   r  r  r  r{  r  r   r   r   )rW   r  r  r  s       rY    test_subclassing_async_generatorz4CollectionsAbcTests.test_subclassing_async_generator  s!   	%%c3h/ 	 	a!6!67a!5!56a!?!?@a!>!>?  a!,3h(=(=>h(<(<=h(F(FGh(E(EF  a!,  A&r[   c                      G d dt         j                        } G d d|      } G d d      } G d d      }| j                  ||       | j                  ||       | j                  ||       y )	Nc                       e Zd Zed        Zy)?CollectionsAbcTests.test_subclassing_subclasshook.<locals>.Basec                 $    |j                   dk(  ryy)Nr   TF)r\   rc  s     rY   rL  zPCollectionsAbcTests.test_subclassing_subclasshook.<locals>.Base.__subclasshook__  s    >>U* r[   Nre  r_   r[   rY   rf	  rK    s    ! !r[   rf	  c                       e Zd Zy)<CollectionsAbcTests.test_subclassing_subclasshook.<locals>.CNrp   r_   r[   rY   r7  rN    r   r[   r7  c                       e Zd Zy)>CollectionsAbcTests.test_subclassing_subclasshook.<locals>.FooNrp   r_   r[   rY   r   rP    r   r[   r   c                       e Zd Zy)>CollectionsAbcTests.test_subclassing_subclasshook.<locals>.BarNrp   r_   r[   rY   r   rR     r   r[   r   )rT   r  r  r  )rW   rf	  r7  r   r   s        rY   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>.ANrp   r_   r[   rY   r   rV  '  r   r[   r   c                       e Zd Zy)8CollectionsAbcTests.test_subclassing_register.<locals>.BNrp   r_   r[   rY   r   rX  (  r   r[   r   c                       e Zd Zy)8CollectionsAbcTests.test_subclassing_register.<locals>.CNrp   r_   r[   rY   r7  rZ  *  r   r[   r7  c                       e Zd Zy)8CollectionsAbcTests.test_subclassing_register.<locals>.DNrp   r_   r[   rY   r:  r\  /  r   r[   r:  c                       e Zd Zy)8CollectionsAbcTests.test_subclassing_register.<locals>.MNrp   r_   r[   rY   r  r^  4  r   r[   r  )	rT   r	  r  r  r  r  r{  r!   r  )rW   r   r   r7  r:  r  s         rY   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>.MNrp   r_   r[   rY   r  rb  :  r   r[   r  c                       e Zd Zy)7CollectionsAbcTests.test_collections_as_base.<locals>.SNrp   r_   r[   rY   r  rd  >  r   r[   r  c                       e Zd Zy)7CollectionsAbcTests.test_collections_as_base.<locals>.INrp   r_   r[   rY   r  rf  B  r   r[   r  c                       e Zd Zy)7CollectionsAbcTests.test_collections_as_base.<locals>.ANrp   r_   r[   rY   r   rh  E  r   r[   r   r  c                       e Zd Zy)7CollectionsAbcTests.test_collections_as_base.<locals>.BNrp   r_   r[   rY   r   rj  F  r   r[   r   )	r  r{  r  r  rT   r  r  rN  r  )rW   r  r  r  r   r   s         rY   test_collections_as_basez,CollectionsAbcTests.test_collections_as_base8  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 rS   )r   rT   r  r  r   r  r  r   s    rY   r  z#CollectionsAbcTests.test_or_and_rorJ  sk    (8(88%fN^N^@^:_`))FOO;U6CSCSU[UdUdCd=efr[   N)7r\   r]   r^   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r!  r#  r=  rH  rS  r_  rk  r  r_   r[   rY   r~  r~  y  s   6	56
;;3789A5<6=@1<
C881	H
/$
/U
	EU
	E0	C))6($.9.>.C-J'.)"1&1$gr[   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{   r_   r_   r[   rY   managerz2OtherABCTests.test_contextmanager.<locals>.managerR       Hr  r|   )
contextlibcontextmanagerr   rT   rm  r   )rW   rq  r  s      rY   test_contextmanagerz!OtherABCTests.test_contextmanagerQ  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>.NotACMNrp   r_   r[   rY   NotACMrx  [  r  r[   ry  c               3      K   d y wr{   r_   r_   r[   rY   rq  z8OtherABCTests.test_async_contextmanager.<locals>.manager_  rr  r  r|   )r   r  rT   AsyncContextManagerr   rs  rt  r   r   r  r}   r~   r   r   )rW   ry  rq  r  s       rY   test_async_contextmanagerz'OtherABCTests.test_async_contextmanagerZ  s    	 	ceV%?%?@  6+E+EF		"	"	 
#	 Y  V%?%?@33C8AAC6Jy)r655c:; *y)&&sCx0 *) *)))s    "EEEEN)r\   r]   r^   ru  r|  r_   r[   rY   rn  rn  O  s    <1r[   rn  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>.UserNrp   r_   r[   rY   Userr  p  r   r[   r  c                       e Zd Zy),TypeTests.test_type_basic.<locals>.BasicUserNrp   r_   r[   rY   	BasicUserr  q  r   r[   r  c                       e Zd Zy)*TypeTests.test_type_basic.<locals>.ProUserNrp   r_   r[   rY   ProUserr  r  r   r[   r  
user_classr   c                      |        S rS   r_   r  s    rY   new_userz+TypeTests.test_type_basic.<locals>.new_usert  
    <r[   r4   )rW   r  r  r  r  s        rY   test_type_basiczTypeTests.test_type_basicn  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>.UserNrp   r_   r[   rY   r  r  {  r   r[   r  c                       e Zd Zy).TypeTests.test_type_typevar.<locals>.BasicUserNrp   r_   r[   rY   r  r  |  r   r[   r  c                       e Zd Zy),TypeTests.test_type_typevar.<locals>.ProUserNrp   r_   r[   rY   r  r  }  r   r[   r  r  ru  r  r   c                      |        S rS   r_   r  s    rY   r  z-TypeTests.test_type_typevar.<locals>.new_user  r  r[   )r   r5   )rW   r  r  r  r  r  s         rY   test_type_typevarzTypeTests.test_type_typevary  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 rS   r_   r  s    rY   ra  z)TypeTests.test_type_optional.<locals>.foo  s    ys
r[   )r   r5   BaseExceptionr   KeyboardInterruptassertIsNone)rW   r   ra  s      rY   test_type_optionalzTypeTests.test_type_optional  sT    T-()	1 	-0 	 	c"346GH#d)$r[   N)r\   r]   r^   r  r  r  r_   r[   rY   r~  r~  l  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	  rT   r]   )rW   fnames     rY   test_c_functionszTestModules.test_c_functions  s-    __EWVU3>>	J %r[   N)r\   r]   r^   r  r  r_   r[   rY   r  r    s    JKr[   r  c                   \    e Zd Zed        Zed        Zd Zd Zd Zd Z	d Z
d Zd	 Zd
 Zy)NewTypeTestsc                     t        j                  dt              at        j                  | j                  dz   t
              | _        y )NUserId	.UserName)rT   NewTyper   r  r^   r   UserNamer  s    rY   
setUpClasszNewTypeTests.setUpClass  s1     #.~~c&6&6&DcJr[   c                 
    b | `y rS   )r  r  r  s    rY   tearDownClasszNewTypeTests.tearDownClass  s     Lr[   c                     | j                  t        d      t               | j                  | j                  d      t               | j                  t        d      dz   d       y )NrV  Joerb      )r   r  r   r  r   r   r   s    rY   r  zNewTypeTests.test_basic  sG    fQi-dmmE2C8Q*r[   c                     | j                  t              5  t        t        t               d d d        | j                  t              5   G d dt              }d d d        y # 1 sw Y   7xY w# 1 sw Y   y xY w)Nc                       e Zd Zy)#NewTypeTests.test_errors.<locals>.DNrp   r_   r[   rY   r:  r    r   r[   r:  )r}   r~   r   r  r   r  s     rY   r   zNewTypeTests.test_errors  sQ    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  ri   r   r  rT   r   r-   )rW   r  s     rY   r  zNewTypeTests.test_or  s    'C#&  #v||FCK/HI  vv||CK/HI  #!>N  v!>fN '& (&&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  r\   r^   r]   __supertype__r   r  r   r   )rW   r  s     rY   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  r\   r  r   r^   r   s    rY   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UserAgerb   rd   )rT   r  rp  rf   rg   rh   ri   rg  r  rf  r   r  r}   PicklingError)rW   r  re   pickledr#  s        rY   r$  zNewTypeTests.test_pickle  s    ..E2622Q67EE* ,,vu5g.ff- ,,t}}e<g.fdmm4&&v';';<LL%0 = +* 8 =< +*s%   B6D8D,D8,D51D88E	c                      d}t        |i        y )Nz-import typing
NT = typing.NewType('NT', int)
r  r  s     rY   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>.ProUserIdNrp   r_   r[   rY   	ProUserIdr    r`	  r[   r  )r   r~   r   r   r  )rW   r  s     rY   #test_error_message_when_subclassingz0NewTypeTests.test_error_message_when_subclassing  s@    ##II=
F 
 
 
s   AAN)r\   r]   r^   rf  r  r  r  r   r  r  r   r$  r  r  r_   r[   rY   r  r    sT    K K
  
+
O6O
1	r[   r  c                   v    e Zd Z G d de      Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zy)NamedTupleTestsc                   "    e Zd ZU eed<   eed<   y)NamedTupleTests.NestedEmployeer  r  Nr  r_   r[   rY   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|   Jimrb   r  r  )r6   r   r   r  r  r   r   r  r  r\   _fieldsr   r  r  )rW   r  joejims       rY   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  r\   r  r   r  r  r   r   )rW   tims     rY   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   Sjoerdrb   r  r  )r  c                   &    e Zd ZU dZeed<   eed<   y)RNamedTupleTests.test_annotation_usage_with_default.<locals>.NonDefaultAfterDefaultrP  r   r   N)r\   r]   r^   r   r   r   r_   r[   rY   NonDefaultAfterDefaultr     s    3
r[   r  )r  r   r  r   r  r  r\   r  r   r  r   r   _field_defaultsr}   r~   r6   )rW   jellecooler_employeer  s       rY   "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)Nrb   r   r|   r   z42 -> 1rP  c                       e Zd ZU eed<   d Zy)DNamedTupleTests.test_annotation_usage_with_methods.<locals>.XMethBadr   c                      y)Nzno chance for thisr_   r   s    rY   r  zLNamedTupleTests.test_annotation_usage_with_methods.<locals>.XMethBad._fields-  s    /r[   N)r\   r]   r^   r   r   r  r_   r[   rY   XMethBadr  +  s    0r[   r  c                       e Zd ZU eed<   d Zy)ENamedTupleTests.test_annotation_usage_with_methods.<locals>.XMethBad2r   c                      y)Nzno chance for this as wellr_   r   s    rY   _sourcezMNamedTupleTests.test_annotation_usage_with_methods.<locals>.XMethBad2._source3  s    7r[   N)r\   r]   r^   r   r   r  r_   r[   rY   	XMethBad2r  1  s    8r[   r  )	r   r  r  r   r   r  r}   r  r6   )rW   r  r  s      rY   "test_annotation_usage_with_methodsz2NamedTupleTests.test_annotation_usage_with_methods$  s    q*A.reBil3U2Y3q!uQx/3~.0: 0 / ~.8J 8 /. /. /.s   <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>.ANrp   r_   r[   rY   r   r  7  r  r[   r   c                       e Zd ZU eed<   y)4NamedTupleTests.test_multiple_inheritance.<locals>.Xr   Nr  r_   r[   rY   r  r  :  r   r[   r  c                       e Zd ZU eed<   y)4NamedTupleTests.test_multiple_inheritance.<locals>.Yr   Nr  r_   r[   rY   r  r  =  r   r[   r  c                       e Zd ZU eed<   y)4NamedTupleTests.test_multiple_inheritance.<locals>.Zr   Nr  r_   r[   rY   r  r  @  r   r[   r  c                       e Zd ZU eed<   y)4NamedTupleTests.test_multiple_inheritance.<locals>.Br   Nr  r_   r[   rY   r   r  B  rs  r[   r   c                       e Zd ZU eed<   y)4NamedTupleTests.test_multiple_inheritance.<locals>.Cr   Nr  r_   r[   rY   r7  r  E  r   r[   r7  )r}   r~   r6   r  )rW   r   r  r  r  r   r7  s          rY   r2
  z)NamedTupleTests.test_multiple_inheritance6  s    	 	y)J  * y)J  * y)J
  *	
 	y)J  *) *) *) *)
 *)s/   CC' C3C?C$'C03C<?Dc                     G d dt         t        t                 }| j                  |j                  t
        t        f       | j                  |j                  t         t        t           f       | j                  |j                  |t
        t        t        f        G d dt        t           t               }| j                  |j                  t        t
        f       | j                  |j                  t        t           t         f       | j                  |j                  |t        t
        t        f       ||fD ]|  }| j                  |      5  | j                  |j                  t        f       | j                  |t           j                  t        f       | j                  t        |t                 t        f       |t           }| j                  |j                  |       | j                  |j                  t        f       | j                  t        |      t        f       | j                  |j                  d        |d      }| j                  t!        |      |       | j                  |j"                  d       | j%                  t&              5  |t        t(        f    d d d        d d d         y # 1 sw Y   xY w# 1 sw Y   xY w)Nc                       e Zd ZU eed<   y)'NamedTupleTests.test_generic.<locals>.Xr   Nr  r_   r[   rY   r  r  I      Dr[   r  c                       e Zd ZU eed<   y)'NamedTupleTests.test_generic.<locals>.Yr   Nr  r_   r[   rY   r  r  O  r  r[   r  r   r_   rP  )r6   r#   r   r   r1	  r  r6	  r  r  ri   r  r  r-   r   r   r  r   r   r}   r~   r   )rW   r  r  r  r   r  s         rY   test_genericzNamedTupleTests.test_genericH  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 2 &%  21 &%s%   EKJ:&K:K?KK	c                 Z    d        }|j                   \  }| j                  |t               | j                  |j                  d       | j                  |j
                  t        t        f       | j                  |j                  t        t        |   f       | j                  |j                  |t        t        t        f       | j                  |j                  |f       | j                  |t           j                  t        f       | j                  |t           j                  d       y )Nc                  >    d xf G fdd
} t         |       S )r   c                   "    e Zd ZW  ZU W ed<   y).NamedTupleTests.test_generic_pep695.<locals>.Xr   Nr  r  s   rY   r  r  h  
     Dr[   r  )r6   r  s    @@rY   z<generic parameters of X>zFNamedTupleTests.test_generic_pep695.<locals>.<generic parameters of X>h  s     	 	: 	r[   r   r_   )rl  r   r   r   r\   r1	  r  r#   r6	  r6   r  r  r  r   r  )rW   r  r   s      rY   test_generic_pep695z#NamedTupleTests.test_generic_pep695g  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)r\   r]   r^   r   r   r  r_   r[   rY   Groupr	  w  s    F7Nr[   r  r_   rb   r   )r6   r   r   r  r  r  r   r   )rW   r  r   r  s       rY   r
  z*NamedTupleTests.test_non_generic_subscriptt  s    	J 	 #Ju-))2.cV,a!Id1gu%QH%r[   c                    t        dt        t              } |dd      }| j                  |t               | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  t        t        t                     | j                  t              5  t        ddt        fgt               d d d        y # 1 sw Y   y xY w)NLocalEmployee)r  ageNick   Namer   r  )r6   r   r   r   r  r   r  r\   r  r   r  r}   r~   )rW   r  nicks      rY   test_namedtuple_keyword_usagez-NamedTupleTests.test_namedtuple_keyword_usage  s    "?#FVR(dE*F+//A..@66#38OPy)vc
|s3 *))s   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  )r  rW   typenamefieldsr|   ra  r  )r6   r   r  r   r  r   r\   r  r  r  rW   r  r  )rW   r  r  s      rY   %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>.CNTNrp   r_   r[   rY   CNTr    r  r[   r  )structr_   )r6   ri   r   r  r  r   r   )rW   r  r  r  s       rY   test_empty_namedtuplez%NamedTupleTests.test_empty_namedtuple  s    	* 	 3iFV,  4  !7!7<  !7!7<%%fh7	 -,  ,,s   A,B++B4	c                 ^   | j                  t              5  t        j                          d d d        | j                  t              5  t                d d d        | j                  t              5  t        ddt        fgd        d d d        | j                  t
              5  t        ddt        fg       d d d        | j                  t              5  t        dt        t               d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   bxY w# 1 sw Y   y xY w)Nr  r  _name)r  r  r  )r}   r~   r6   r  r   r  r   r   s    rY   test_namedtuple_errorsz&NamedTupleTests.test_namedtuple_errors  s    y)  *y)L *y)u}ot4 *z*u~./ +y)CC8 *) *)))))**))s;   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%   rb   )r6   r   r   r  r  r  ri   rf   rg   rh   rg  rf  r   r   r   r   )rW   r  r"  re   rR  jane2s         rY   test_copy_and_picklez$NamedTupleTests.test_copy_and_pickle  s   &# >?d&9&99C#&62"6#:#:Q#>?ET51A"LLOE$$UD1))%5	 @ T
  -%%eS1   -%%eS1 '& :&&s   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>.SimpleNamedTupleNrp   r_   r[   rY   SimpleNamedTupler(    r  r[   r)  c                       e Zd Zy):NamedTupleTests.test_orig_bases.<locals>.GenericNamedTupleNrp   r_   r[   rY   GenericNamedTupler+    r  r[   r,  CallNamedTuple)r   r6   r#   r   r6	  )rW   r   r)  r,  r-  s        rY   r7	  zNamedTupleTests.test_orig_bases  s    CL	z 		
GAJ 	 	)88:-H*99JPQ
;ST#$4b966Fr[   N)r\   r]   r^   r6   r  r.  r  r  r  r2
  r   r  r
  r  r  r  r   r%  r7	  r_   r[   rY   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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  rb   r  r  T)r9   r   r   r  r  rT   r!   r  r  r{  r	  r   r   r   r\   r]   r1	  r   	__total____required_keys__r   r  __optional_keys__rO  rW   r  r  s      rY   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r1  )r  r  r9   r   r   r  r  rT   r!   r  r  r{  r	  r   r   r   r\   r]   r1	  r   r2  r5  s      rY   test_basics_keywords_syntaxz*TypedDictTests.test_basics_keywords_syntax  s    01E4C 2c4(c6#8#89  koo&>&>?u#d3i&Ve,TA&u-20,,s#.FG- 21s   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)r  rW   r  	_typenamer  r  r|   ra  5   r  r`  r  rW   r  r;  r  r  )r  r  r9   r   r  r   r   r  r  r   r\   r   r  rO  )rW   r:  r  s      rY   $test_typeddict_special_keyword_namesz3TypedDictTests.test_typeddict_special_keyword_names  s"   014TPS\`jnoB 2d+++T6WZilx|  JN  .O  	P3R%2u~FVafhk`lm53'6B':.;,8u~&679s|4 21s   +EEc                    | j                  t              5  t        j                          d d d        | j                  t              5  t                d d d        | j                  t              5  t        ddt        fgd        d d d        | j                  t              5  t        dt        t
               d d d        y # 1 sw Y   xY w# 1 sw Y   |xY w# 1 sw Y   VxY w# 1 sw Y   y xY w)Nr  r  )r;  r  r  )r}   r~   r9   r  r   r   r   s    rY   test_typeddict_create_errorsz+TypedDictTests.test_typeddict_create_errors  s    y) *y)K *y)evsm_d3 *y)CC8 *) *)))))))s/   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  rT   r  rb   Hir   r  )
r9   r   r   r   r]   r}   r~   r   r   r  r5  s      rY   test_typeddict_errorsz$TypedDictTests.test_typeddict_errors  s    378--x8u#y)r3 *y)sC  *y)tS! *y)dc3ZLC0 *) *)))))))s0   C<D+DD <DDD D)c                 r   | j                  t        j                  d       | j                  t        j                  t               | j                  t        j                  t
        t
        t        d       | j                  t        j                  t        f       | j                  t        j                  d       | j                  t        t        j                         t        dd      }| j                  |d   d       | j                  |d   d       t        ddd	      }| j                  |d
   d	       y )Nr  r  Tr   rb   r  r   r   hir  )r   r  r\   r]   r   r   r   r1	  r  r2  r  rT   r	  r  )rW   
not_originrd  s      rY   test_py36_class_syntax_usagez+TypedDictTests.test_py36_class_syntax_usage  s    ..?00(;55SsUX7YZ//$9//6  v?qA&
C!,C!,qAT2w.r[   c                    t        dt        t        d      at        ddd      }t	        t
        j                  dz         D ]  }t        j                  ||      }t        j                  |      }| j                  ||       | j                  |ddd       t        j                  t        |      }t        j                  |      }| j                   |ddd      |        y )NEmpDr  r"  r#  rb   )
r9   r   r   rH  rf   rg   rh   rg  rf  r   )rW   r"  re   rR  r$  ZZEmpDnews          rY   r$  zTypedDictTests.test_pickle*  s    #S!9:V2./622Q67ET5)ALLOEUD)UV2$>?dE*Bll2&GWfB%?@$G 8r[   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      @rw  rb   )r  rf   rg   rh   rg  rf  r   )rW   pointre   rR  point2rI  Point2DGenericNews          rY   test_pickle_genericz"TypedDictTests.test_pickle_generic7  s    ,622Q67EUE*A\\!_FVU+V3S%9:ne4B &R 0.Ss/CDeL 8r[   c                    t        dt        t        d      }| j                  t        j
                  |   t        j                  d |f          | j                  t        j                  |   t        j                  |          y )NrH  r  )
r9   r   r   r   rT   r   r   r   r   r   )rW   rH  s     rY   r  zTypedDictTests.test_optionalB  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 )Nr:  r   Fr  rb   r   r   )r  r  r  )	r9   r   r   r2  r3  r  r   r4  r  r  s     rY   
test_totalzTypedDictTests.test_totalH  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>.Point2Dor3DrR  Nr  r_   r[   rY   Point2Dor3DrU  Y  rs  r[   rV  Fr  r   r   rR  )r  r   r3  r  r   r4  )rW   rV  s     rY   test_optional_keysz!TypedDictTests.test_optional_keysX  sz    	' 	 	66	3*8MNk;;YG66	3%8HIk;;YGr[   c                     G d dt               } G d d|d      } G d d|      }| j                  |j                  t        d	g             | j                  |j                  t        g              | j                  |j
                  d	t        i       | j                  |j                  t        d	g             | j                  |j                  t        d
dg             | j                  |j
                  t        t        t        d       | j                  |j                  t        d	dg             | j                  |j                  t        d
dg             | j                  |j
                  t        t        t        t        d       y )Nc                       e Zd ZU eed<   y)8TypedDictTests.test_keys_inheritance.<locals>.BaseAnimalr  Nr  r_   r[   rY   
BaseAnimalrZ  b  r  r[   r[  c                   "    e Zd ZU eed<   eed<   y)4TypedDictTests.test_keys_inheritance.<locals>.AnimalvoicetailN)r\   r]   r^   r   r   r  r_   r[   rY   Animalr]  e  s    JJr[   r`  Fr  c                       e Zd ZU eed<   y)1TypedDictTests.test_keys_inheritance.<locals>.Cat	fur_colorNr  r_   r[   rY   Catrb  i  s    Nr[   rd  r  r_  r^  )r  r_  r^  rc  )rc  r  r_  r^  )r9   r   r3  r  r4  r   r   r  )rW   r[  r`  rd  s       rY   test_keys_inheritancez$TypedDictTests.test_keys_inheritancea  sE   	 		Zu 		& 	 	55y&7JK55y}E33fc]C119fX3FG119fg=N3OP//2
 	 	..	6;:O0PQ..	67:K0LM,,	/
 	r[   c                     G d dt         d      } G d d|      }| j                  |j                  t                      | j                  |j                  t        dg             | j                  |j                  t        dg             | j                  |j                  t                       G d d	t               } G d
 d|      }| j                  |j                  t        dg             | j                  |j                  t        dg             | j                  |j                  t        dg             | j                  |j                  t        dg             y )Nc                       e Zd ZU eed<   y)ETypedDictTests.test_keys_inheritance_with_same_name.<locals>.NotTotalr  Nr  r_   r[   rY   NotTotalrh    rs  r[   ri  Fr  c                       e Zd ZU eed<   y)BTypedDictTests.test_keys_inheritance_with_same_name.<locals>.Totalr  Nr  r_   r[   rY   Totalrk    rs  r[   rl  r  c                   .    e Zd ZU ee   ed<   ee   ed<   y)ATypedDictTests.test_keys_inheritance_with_same_name.<locals>.Baser  r   N)r\   r]   r^   r7   r   r   r8   r_   r[   rY   rf	  rn    s    3}r[   rf	  c                   .    e Zd ZU ee   ed<   ee   ed<   y)BTypedDictTests.test_keys_inheritance_with_same_name.<locals>.Childr  r   N)r\   r]   r^   r8   r   r   r7   r_   r[   rY   r#  rp    s    }3r[   r#  r   )r9   r   r3  r  r4  )rW   ri  rl  rf	  r#  s        rY   $test_keys_inheritance_with_same_namez3TypedDictTests.test_keys_inheritance_with_same_name  s   	y 		H 	 	33Y[A33Yu5EF00)SE2BC00)+>	9 		 D 	  	//C51AB//C51AB00)SE2BC00)SE2BCr[   c                 >    G d dt               } G d dt               } G d d||      }| j                  |j                  dt        t           i       | j                  |j
                  t        dg             | j                  |j                  t                      y )Nc                       e Zd ZU ee   ed<   y)ETypedDictTests.test_multiple_inheritance_with_same_key.<locals>.Base1r  Nr  r_   r[   rY   Base1rt    s    3r[   ru  c                       e Zd ZU ee   ed<   y)ETypedDictTests.test_multiple_inheritance_with_same_key.<locals>.Base2r  Nr  r_   r[   rY   Base2rw    s    }r[   rx  c                       e Zd Zy)ETypedDictTests.test_multiple_inheritance_with_same_key.<locals>.ChildNrp   r_   r[   rY   r#  rz    r  r[   r#  r  )r9   r   r   r8   r   r3  r  r4  )rW   ru  rx  r#  s       rY   'test_multiple_inheritance_with_same_keyz6TypedDictTests.test_multiple_inheritance_with_same_key  s~    	 I 	 	I 		E5 	 	..hsm0DE00)SE2BC00)+>r[   c                    | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t
        j                  t        dh             | j                  t
        j                  t        dh             | j                  t        j                  j                  t                      | j                  t        j                  j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             | j                  t        j                  t        dh             y )Nr  r_  r  )r   r  r3  r  r4  r  rO   ri  r  r  r  r  r   s    rY   test_required_notrequired_keysz-TypedDictTests.test_required_notrequired_keys  s   88"G9-	/88"F8,	. 	55"G9-	/55"F8,	. 	+99KK"	&+99KK"C5)	+ 	99"G9-	/99"F8,	. 	+=="G9-	/+=="F8,	. 	::"G9-	/::"F8,	. 	2DD"G9-	/2DD"F8,	.r[   c                     G d dt               } G d dt               } G d dt         d      }t        d	d
t        i      } G d d      } G d d||      }| j                  |j                  t	        g d             | j                  |j
                  t	        g              | j                  |j                  t        t        t        d        G d d||      }| j                  |j                  t	        ddg             | j                  |j
                  t	        dg             | j                  |j                  t        t        t        d        G d d||d      }| j                  |j                  t	        dg             | j                  |j
                  t	        ddg             | j                  |j                  t        t        t        d        G d d||      }	| j                  |	j                  t	        d
dg             | j                  |	j
                  t	        dg             | j                  |	j                  t        t        t        d       ||f||f|||f||f||fg}
|
D ]G  }| j                  |      5  | j                  t        d      5   G d dg| }d d d        d d d        I y # 1 sw Y   xY w# 1 sw Y   `xY w)Nc                       e Zd ZU eed<   y)5TypedDictTests.test_multiple_inheritance.<locals>.Onerz  Nr  r_   r[   rY   Oner        Hr[   r  c                       e Zd ZU eed<   y)5TypedDictTests.test_multiple_inheritance.<locals>.TwotwoNr  r_   r[   rY   Twor    r  r[   r  c                       e Zd ZU eed<   y)9TypedDictTests.test_multiple_inheritance.<locals>.UntotaluntotalNr  r_   r[   rY   Untotalr    s    Lr[   r  Fr  Inlineinlinec                       e Zd Zy)9TypedDictTests.test_multiple_inheritance.<locals>.RegularNrp   r_   r[   rY   Regularr    r  r[   r  c                       e Zd ZU eed<   y)7TypedDictTests.test_multiple_inheritance.<locals>.ChildchildNr\   r]   r^   r  r   r_   r[   rY   r#  r        Kr[   r#  )rz  r  r  c                       e Zd ZU eed<   y)CTypedDictTests.test_multiple_inheritance.<locals>.ChildWithOptionalr  Nr  r_   r[   rY   ChildWithOptionalr    r  r[   r  rz  r  r  )rz  r  r  c                       e Zd ZU eed<   y)ETypedDictTests.test_multiple_inheritance.<locals>.ChildWithTotalFalser  Nr  r_   r[   rY   ChildWithTotalFalser    r  r[   r  c                       e Zd ZU eed<   y)LTypedDictTests.test_multiple_inheritance.<locals>.ChildWithInlineAndOptionalr  Nr  r_   r[   rY   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>.WrongNrp   r_   r[   rY   Wrongr  !  r
  r[   r  )r9   r  r   r3  r  r4  r   r   r   ri   r   r~   )rW   r  r  r  r  r  r#  r  r  r  wrong_basesr  r  s                rY   r2
  z(TypedDictTests.test_multiple_inheritance  s   	) 		) 		iu 	8h%56	 		C 	##-.	
 	##bM	
 	!!d3	

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

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

	& 	&88x)*	
 	&88yk"	
 	&66d;	
 'NcN#wWg
 !EE*++S 	 +* !  +*s$   
K!K -K K	KK	c                    | j                  t        t              d       | j                  t        t        t        t
        f         d       | j                  t        t                     d       t        ddt
        i      }| j                  t        |      d       | j                  t         |             d       t        d       G fddt        t                 }| j                  t        |      d       | j                  t        |t
                 d       | j                  t         |             d        d        }| j                  t        |      d       | j                  t        |t
                 d       | j                  t         |             d       | j                  t        t              d       y )	NTF
call_basedr  r   c                       e Zd ZU W  ed<   y)4TypedDictTests.test_is_typeddict.<locals>.BarGenericr  Nrt  ru  s   rY   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   rY   r  r  4  r  r[   r  r9   r  s    @@rY   z"<generic parameters of NewGeneric>zLTypedDictTests.test_is_typeddict.<locals>.<generic parameters of NewGeneric>4  s     	 	I 	r[   )	r   r/   r  r   r   r   r9   r   r#   )rW   r  r  r  r   s       @rY   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 )Nrw  )r   r+   r   rT   r   r   r   s    rY   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 )Nrw  c                       e Zd ZU eed<   y)ATypedDictTests.test_get_type_hints_generic.<locals>.FooBarGenericr  Nr  r_   r[   rY   FooBarGenericr  I  rs  r[   r  r  r   r  )r   r+   r  rT   r   r   r   r   )rW   r  s     rY   test_get_type_hints_genericz*TypedDictTests.test_get_type_hints_genericC  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   rY   r   r  R  r  r[   r   r  r  s    @@rY   z<generic parameters of A>zOTypedDictTests.test_pep695_generic_typeddict.<locals>.<generic parameters of A>R  s     	 	9 	r[   r   r_   )rl  r   r   r   r\   r1	  r#   r  r6	  r9   r  r  r  r   r  )rW   r   r   s      rY   test_pep695_generic_typeddictz,TypedDictTests.test_pep695_generic_typeddictQ  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  r_   r[   rY   r   r  `  r  r[   r   r_   c                       e Zd ZU eed<   y)3TypedDictTests.test_generic_inheritance.<locals>.A2r  Nr  r_   r[   rY   A2r  j  r  r[   r  c                       e Zd ZU eed<   y)2TypedDictTests.test_generic_inheritance.<locals>.Br   Nr\   r]   r^   r   r   r_   r[   rY   r   r  t      Er[   r   Fr  r   r  c                       e Zd ZU eed<   y)2TypedDictTests.test_generic_inheritance.<locals>.Cr  Nr  r_   r[   rY   r7  r    rs  r[   r7  Tr  r  c                       e Zd ZU eed<   y8TypedDictTests.test_generic_inheritance.<locals>.Point3Dr  Nr  r_   r[   rY   Point3Dr    r  r[   r  c                       e Zd ZU eed<   yr  r  r_   r[   rY   r  z8TypedDictTests.test_generic_inheritance.<locals>.Point3D  s    r[   )r9   r#   r   r   r1	  r  r6	  r  r  r  r   r  r   r2  r4  r  r3  r  r   r   r}   r~   r  )rW   r   r  r   r7  r  s         rY   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  r_   r[   rY   r   r    r  r[   r   c                       e Zd ZU eed<   y)7TypedDictTests.test_implicit_any_inheritance.<locals>.Br   Nr  r_   r[   rY   r   r    r  r[   r   Fr  c                       e Zd ZU eed<   y)ETypedDictTests.test_implicit_any_inheritance.<locals>.WithImplicitAnyr  Nr  r_   r[   rY   WithImplicitAnyr    rs  r[   r  r_   Tr   r  r  r  )r9   r#   r   r   r   r1	  r  r  r  r  r2  r4  r  r3  r   r   r}   r~   r   )rW   r   r   r  s       rY   test_implicit_any_inheritancez,TypedDictTests.test_implicit_any_inheritance  s   		71: 		"U 		a 	 	22Wd4DE00?GTSY2Z[77<22D9::Ise<LM::IsCj<QR88;
 	
 y)C  *))s   
E&&E/c                 ^    G d dt               }|t           }| j                  |j                  |       | j                  |j                  d       | j                  |j
                  t        f        |d      }| j                  t        |      t               | j                  |ddi       y )Nc                       e Zd ZU eed<   y)5TypedDictTests.test_non_generic_subscript.<locals>.TDr  Nr  r_   r[   rY   r:  r    r  r[   r:  r_   rb   r  r  )	r9   r   r   r  r  r  r   r   r  )rW   r:  r   r  s       rY   r
  z)TypedDictTests.test_non_generic_subscript  s    	 	sGr*))2.cV,!Hd1gt$S!H%r[   c                 $   t        d      } G d dt              } G d d|      } G d d|      } G d d	|||      } G d
 dt        t        |         } G d d|t                 } G d d|t                 } G d d|||t
                 }	 G d d|t           |t
                 }
t        di       }| j                  |j                  t        f       | j                  |j                  |f       | j                  |j                  |f       | j                  |j                  |||f       | j                  |j                  t        t        |   f       | j                  |j                  |t           f       | j                  |j                  |t           f       | j                  |	j                  |||t
           f       | j                  |
j                  |t           |t
           f       | j                  |j                  t        f       y )Nr   c                       e Zd Zy).TypedDictTests.test_orig_bases.<locals>.ParentNrp   r_   r[   rY   Parentr    r  r[   r  c                       e Zd Zy)-TypedDictTests.test_orig_bases.<locals>.ChildNrp   r_   r[   rY   r#  r    r  r[   r#  c                       e Zd Zy)2TypedDictTests.test_orig_bases.<locals>.OtherChildNrp   r_   r[   rY   
OtherChildr    r  r[   r  c                       e Zd Zy)2TypedDictTests.test_orig_bases.<locals>.MixedChildNrp   r_   r[   rY   
MixedChildr    r  r[   r  c                       e Zd Zy)5TypedDictTests.test_orig_bases.<locals>.GenericParentNrp   r_   r[   rY   GenericParentr    r  r[   r  c                       e Zd Zy)4TypedDictTests.test_orig_bases.<locals>.GenericChildNrp   r_   r[   rY   GenericChildr    r  r[   r  c                       e Zd Zy)9TypedDictTests.test_orig_bases.<locals>.OtherGenericChildNrp   r_   r[   rY   OtherGenericChildr    r  r[   r  c                       e Zd Zy)9TypedDictTests.test_orig_bases.<locals>.MixedGenericChildNrp   r_   r[   rY   MixedGenericChildr    r  r[   r  c                       e Zd Zy)<TypedDictTests.test_orig_bases.<locals>.MultipleGenericBasesNrp   r_   r[   rY   MultipleGenericBasesr    r  r[   r  CallTypedDict)r   r9   r#   r   r   rp  r   r6	  )rW   r   r  r#  r  r  r  r  r  r  r  r  s               rY   r7	  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)r\   r]   r^   r6  r8  r=  r?  rB  rF  r$  rO  r  rR  rW  re  rq  r{  r}  r2
  r  r   r  r  r  r  r
  r7	  r_   r[   rY   r/  r/    s    @&. 591/H	MCO H@D2?".HUn62

2M^!2&)Er[   r/  c                   *    e Zd Zd Zd Zd Zd Zd Zy)RequiredTestsc                 h   | j                  t              5  t        t            d d d        | j                  t              5  t        t        t
        f    d d d        | j                  t              5  t        t           t
            d d d        y # 1 sw Y   mxY w# 1 sw Y   HxY w# 1 sw Y   y xY wrS   )r}   r~   r8   r7   r   r   r   s    rY   r.  zRequiredTests.test_basics   su    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   ro   r\   r
  s     rY   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>.CNrp   r_   r[   rY   r7  r     r   r[   r7  c                       e Zd Zy)-RequiredTests.test_cannot_subclass.<locals>.DNrp   r_   r[   rY   r:  r     r   r[   r:  z Cannot subclass typing\.Requiredc                       e Zd Zy)-RequiredTests.test_cannot_subclass.<locals>.ENrp   r_   r[   rY   r  r     r   r[   r  z'Cannot subclass typing\.Required\[int\]c                       e Zd Zy)-RequiredTests.test_cannot_subclass.<locals>.FNrp   r_   r[   rY   r  r      r   r[   r  )r   r~   r   r   r8   r   r
  s        rY   r   z"RequiredTests.test_cannot_subclass   s    ##I/CDDN  E ##I/CDD#'  E ##I35H 5 ##I:<HSM < < ED ED5 5< <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rS   )r}   r~   r8   r   r   r   r   s    rY   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   r   r   s    rY   rA  z RequiredTests.test_no_isinstance)   r
  r
  Nr
  r_   r[   rY   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rS   )r}   r~   r7   r8   r   r   r   s    rY   r.  zNotRequiredTests.test_basics2   sv    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   ro   r\   r
  s     rY   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>.CNrp   r_   r[   rY   r7  r	  C   r   r[   r7  c                       e Zd Zy)0NotRequiredTests.test_cannot_subclass.<locals>.DNrp   r_   r[   rY   r:  r  F   r   r[   r:  z#Cannot subclass typing\.NotRequiredc                       e Zd Zy)0NotRequiredTests.test_cannot_subclass.<locals>.ENrp   r_   r[   rY   r  r  J   r   r[   r  z*Cannot subclass typing\.NotRequired\[int\]c                       e Zd Zy)0NotRequiredTests.test_cannot_subclass.<locals>.FNrp   r_   r[   rY   r  r  N   r   r[   r  )r   r~   r   r   r7   r   r
  s        rY   r   z%NotRequiredTests.test_cannot_subclassA   s    ##I/CDD%  E ##I/CDDS)*  E ##I68K 8 ##I=?K$ ? ? ED ED8 8? ?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rS   )r}   r~   r7   r   r   r   r   s    rY   r>  z!NotRequiredTests.test_cannot_initQ   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   r   r   s    rY   rA  z#NotRequiredTests.test_no_isinstanceY   sT    y)q+c*+ *y)sK( *) *)))r
  Nr
  r_   r[   rY   r  r  0   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 rS   readliner  s    rY   rV  zIOTests.test_io.<locals>.stuffd       ::<r[   )r;   r   r   r   r  rW   rV  r  s      rY   test_iozIOTests.test_iob   s?    	 R 	 F 	  !!#&))F95r[   c                 z    dt         dt        fd}|j                  d   }| j                  |j                  d       y )Nr  r   c                 "    | j                         S rS   r  r  s    rY   rV  z"IOTests.test_textio.<locals>.stuffl   r  r[   r_   )r<   r   r   r   r  r  s      rY   test_textiozIOTests.test_textioj   s=    	 V 	  	  !!#&))2.r[   c                 z    dt         dt        fd}|j                  d   }| j                  |j                  d       y )Nr  r   c                 "    | j                         S rS   r  r  s    rY   rV  z$IOTests.test_binaryio.<locals>.stufft   r  r[   r_   )r=   r  r   r   r  r  s      rY   test_binaryiozIOTests.test_binaryior   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	  r\   r:   z	typing.iorb   )warningscatch_warningsfilterwarningsr  	typing.ior;   r<   r=   r	  r\   r   rT   r   rO  r  )rW   wr;   r<   r=   r	  r\   s          rY   test_io_submodulezIOTests.test_io_submodulez   s    $$D1Q##I8JKIIMM"fii(MM&&--0MM(FOO4S\3/K+LMX{3SVQ' 211s   CC==DN)r\   r]   r^   r  r  r   r+  r_   r[   rY   r  r  `   s    6//	(r[   r  c                   6    e Zd Zd Zd Zd Zd Zd Zd Zd Z	y)	RETestsc                 *   t        j                  dt         j                        }| j                  |j                  t
               | j                  t        |      t
               | j                  |t
               |j                  d      }| j                  |j                  t               | j                  t        |      t               | j                  |t               t
        t        t        t        f       t        t        t        t        f       y )Nz[a-z]+z12345abcde.....)r   compiler  r  r   r>   r   r   searchr?   r   r   r  )rW   r,  mats      rY   r.  zRETests.test_basics   s    jj244(cmmW5d3i1c7+jj*+cmmU3d3i/c5) 	c5j!"eE3J r[   c                 6   | j                  t        t           t        t                  | j                  t        t           t        t                  | j                  t        t           t
        t                  | j                  t        t           t               y rS   )r   r>   r   r   r  r?   r   s    rY   test_alias_equalityzRETests.test_alias_equality   s^    ws|4GCL'%.9GCL%*5GCL#.r[   c                    t         t        t        t        f      }| j	                  t
              5  |t            d d d        | j	                  t
              5  t        dt        t                  d d d        | j	                  t
              5  t        t        t           t        t                  d d d        y # 1 sw Y   xY w# 1 sw Y   VxY w# 1 sw Y   y xY wr{   )	r?   r   r   r  r}   r~   r   r>   r   )rW   r  s     rY   r   zRETests.test_errors   s    %U
#$y)cF *y)r73<( * y)wu~ws|4 *) *))) *)s#   
B8C#C8CCCc                    | j                  t        t              d       | j                  t        t        t                 d       | j                  t        t        t                 d       | j                  t        t
              d       | j                  t        t
        t                 d       | j                  t        t
        t                 d       y )Nztyping.Patternztyping.Pattern[str]ztyping.Pattern[bytes]ztyping.Matchztyping.Match[str]ztyping.Match[bytes])r   r   r>   r   r  r?   r   s    rY   r   zRETests.test_repr   s    g(89gcl+-BCgen-/FGen5eCj)+>?eEl+-BCr[   c                    t        j                  d      5 }t        j                  dt               ddlm}m}m}m} | j                  |t        j
                         | j                  |t        j                         | j                  t        |      t        ddg             | j                  |d	       | j                  t        |      d
       d d d        y # 1 sw Y   y xY w)NTr"  r  r$  r   )r?   r>   r	  r\   r?   r>   	typing.rerb   )r&  r'  r(  r  	typing.rer?   r>   r	  r\   r   rT   r   rO  r  )rW   r*  r?   r>   r	  r\   s         rY   test_re_submodulezRETests.test_re_submodule   s    $$D1Q##I8JKCCMM%.MM'6>>2S\3/C+DEX{3SVQ' 211s   B;CC$c                    t        j                         5  t        j                  dt               ddlm} | j                  |j                  t               | j                  |j                  d       | j                  |j                  t        j                         d d d        | j                  t              5  j                   d d d        y # 1 sw Y   4xY w# 1 sw Y   y xY w)Nerrorr$  r   )r   r7  )r&  r'  r(  r  rT   r   r   rE  r   r   r\   r  r  MappingProxyTyper  r?   )rW   r   s     rY   test_re_submodule_access_basicsz'RETests.test_re_submodule_access_basics   s    $$&##G6HI!!!"**c2R[[+6!!"++u/E/EF ' 01HH 21 '& 21s   BC:CCC%c                    | j                  t        d      5   G d dt        j                        }d d d        | j                  t        d      5   G d dt        j                        }d d d        y # 1 sw Y   BxY w# 1 sw Y   y xY w)Nz/type 're\.Match' is not an acceptable base typec                       e Zd Zy)'RETests.test_cannot_subclass.<locals>.ANrp   r_   r[   rY   r   r@     r   r[   r   z1type 're\.Pattern' is not an acceptable base typec                       e Zd Zy)'RETests.test_cannot_subclass.<locals>.BNrp   r_   r[   rY   r   rB     r   r[   r   )r   r~   rT   r?   r>   r   s      rY   r   zRETests.test_cannot_subclass   sq    ##>
FLL 	
 ##@
FNN 	
 

 

 
s   A2A>2A;>BN)
r\   r]   r^   r.  r3  r   r   r9  r=  r   r_   r[   rY   r-  r-     s&    !/	5D(	r[   r-  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)AnnotatedTestsc                 n    | j                  t        d      5  t                d d d        y # 1 sw Y   y xY w)Nz%Type Annotated cannot be instantiatedr   r~   r@   r   s    rY   test_newzAnnotatedTests.test_new   s-    ##3
 K	
 
 
s   +4c                     | j                  t        t        t        ddf         d       | j                  t        t        t        t           ddf         d       y )NrU  rV  ztyping.Annotated[int, 4, 5]z(typing.Annotated[typing.List[int], 4, 5])r   r   r@   r   r   r   s    rY   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)NrU  )r  r  r  __metadata__rM  )rO  rP  r@   r   ri   rQ  rR  s      rY   rT  zAnnotatedTests.test_dir   sU    Ic1f-./	
M M:mY7 ;:	
 ;:s   AA 	c                     t         t         t        df   df   }| j                  |t         t        ddf          | j                  |j                  d       | j                  |j                  t               y )NrU  rV  rT  )r@   r   r   rJ  r  r  s     rY   r~  zAnnotatedTests.test_flatten   s]    iQ'*+Ic1ai010s+r[   c                 H   | j                  t        t        t        df   t        z        t        t        df   t        f       | j                  t        t        t        t        df   t        f         t        t        df   t        f       | j                  t        t        t        df   t        t        df   z  t        z        t        t        df   t        t        df   t        f       | j                  t        t        t        t        df   t        t        df   t        f         t        t        df   t        t        df   t        f       | j                  t        t        t        df   t        t
        df   z  t        z        t        t        df   t        t
        df   t        f       | j                  t        t        t        t        df   t        t
        df   t        f         t        t        df   t        t
        df   t        f       | j                  t        t        df   t        t        df   z  t        z  t        t        df   t        z         | j                  t        t        t        df   t        t        df   t        f   t        t        t        df   t        f          | j                  t        t
        t        t        i f   z  t        t        t               f   z  t        z        t
        t        t        i f   t        t        t               f   t        f       | j                  t        t        t
        t        t        i f   t        t        t               f   t        f         t
        t        t        i f   t        t        t               f   t        f       | j                  t        t
        t        t        i f   z  t        t
        i f   z  t        z        t
        t        t        i f   t        t
        i f   t        f       | j                  t        t        t
        t        t        i f   t        t
        i f   t        f         t
        t        t        i f   t        t
        i f   t        f       | j                  t        t        t        df   t
        z  t        t
        i f   z  t        z        t        t        df   t
        t        t
        i f   t        f       | j                  t        t        t        t        df   t
        t        t
        i f   t        f         t        t        df   t
        t        t
        i f   t        f       dd l}|j                   G d d             } |dd      }| j                  t        t        t        |f   d z        t        t        |f   t        j                  f       | j                  t        t        t        t        |f   d f         t        t        |f   t        j                  f       | j                  t        t        t        t        |f            t        t        |f   t        j                  f       | j                  t        t        i f   t        t        i f   z  t        z  t        t        i f   t        z         | j                  t        t        i f   t        t        i f   z  t        z  t        t        t        i f   z         | j                  t        t        t        i f   t        t        i f   t        f   t        t        t        i f   t        f          | j                  t        t        t        i f   t        t        i f   t        f   t        t        t        t        i f   f          y )Nrb   r   r   c                   "    e Zd ZU eed<   eed<   y)>AnnotatedTests.test_deduplicate_from_union.<locals>.ValueRangelorD  Nr  r_   r[   rY   
ValueRangerN  !  s    GGr[   rP  )r   r-   r@   r   r   r   rO  dataclasses	dataclassr  r	  r   )rW   rQ  rP  r  s       rY   test_deduplicate_from_unionz*AnnotatedTests.test_deduplicate_from_union   s   )CF"3c"9:#CF+S1	3%	#q&(93(>"?@#CF+S1	3)CF"3iQ6G"G#"MN#CF+YsAv->D	F%	#q&(99S!V;Lc(Q"RS#CF+YsAv->D	F)CF"3iQ6G"G#"MN#CF+YsAv->D	F%	#q&(99S!V;Lc(Q"RS#CF+YsAv->D	F 	36*YsAv->>D"36*S0	2ya0)CF2CSHIya0#56	8 	#	#r'(:":YsCEz=R"RUX"XYyb19S#%Z3H#N	P%YsBw-?3PSPU:AVX[(["\]yb19S#%Z3H#N	P#	#r'(:":YsBw=O"ORU"UVyb19S"W3EsK	M%YsBw-?3PR7ASUX(X"YZyb19S"W3EsK	M 	)CF"3c"9Ic2g<N"NQT"TU#CF+S)CG2DcJ	L%	#q&(93	#r'@RTW(W"XY#CF+S)CG2DcJ	L 					 	 
	 q!)CF"3d":;#CF+U^^<	>%	#q&(94(?"@A#CF+U^^<	>(9S!V+<"=>#CF+U^^<	> 	37+iR.@@3F"37+c1	337+iR.@@3Fyb11	3yb19S"W3EsJKyb1367	9yb19S"W3EsJKsIc2g$667	9r[   c           	      j   t         t        df   t        z  t         t        i f   z  t        z  }t        j                  t        |            D ]G  }| j                  |      5  | j                  |t        t        j                  |             d d d        I t        t         t        df   t        t         t        i f   t        f   }t        j                  t        |            D ]6  }| j                  |      5  | j                  |t        |          d d d        8 y # 1 sw Y   xY w# 1 sw Y   OxY w)Nrb   r  )r@   r   r   r  permutationsr-   ri   r   r   operatoror_r   )rW   expr1r   expr2s       rY   test_order_in_unionz"AnnotatedTests.test_order_in_union2!  s    #q&!C')CG*<<sB**8E?;D4(  x||T(BC )( < iQ'iR.@#EF**8E?;D4(  d4 )( <	 )(
 )(s   !+D8D)D&	)D2	c                 0   t         t        t           df   }t         t        t           df   }| j	                  |t           t         t        t           df          | j	                  |t           j
                  d       | j	                  |t           j                  t        t                  | j                  t              5  |t            d d d        | j                  t              5  |t        t        f    d d d        y # 1 sw Y   7xY w# 1 sw Y   y xY w)Nmy decoration)r\  )
r@   r   r   r   r   rJ  r  r}   r~   rp  )rW   r  LIs      rY   test_specializezAnnotatedTests.test_specialize=!  s    d1g./tCy/12349o+E!FG3,,.@A3**DI6y)sG *y)c5jM *) *)))s    
D 'D D	Dc           	      p   | j                  t        t        t        ddf   t        t        ddf   h      d       | j	                  t        t        ddf   t        t        ddf          | j	                  t        t        ddf   t        t
        ddf          | j	                  t        t        df   t        t        ddf          | j                  t        t        ddf   t        t        ddf   t        t        ddf   ht        t        ddf   t        t        ddf   h       t        t        g f   }| j                  t              5  t        |       d d d         G d d      }t        t         |       f   }| j                  t              5  t        |       d d d        y # 1 sw Y   QxY w# 1 sw Y   y xY w)NrU  rV  rb   c                       e Zd ZdZy)&AnnotatedTests.test_hash_eq.<locals>.ANr  r_   r[   rY   r   ra  V!  r  r[   r   )
r   r  r@   r   r   r   r   r}   r~   r  )rW   a1r   a2s       rY   test_hash_eqzAnnotatedTests.test_hash_eqH!  sl   iQ	2Ic1ai4HIJANIc1ai0)CAI2FGIc1ai0)CAI2FGIc1f-ya/CDsAqy!9S!QY#71a79KLsAqy!9Q1W#56	

 sBwy)H *	 	sACx y)H *) *) *)s   F F, F),F5c                     G fdd      t         df   } |d      } d      }| j                  ||       | j                  |j                  |j                         | j                  |j                  |j                         y )Nc                   "    e Zd ZdZd Z fdZy)*AnnotatedTests.test_instantiate.<locals>.CrU  c                     || _         y rS   r   r   s     rY   r   z3AnnotatedTests.test_instantiate.<locals>.C.__init__`!  r   r[   c                 Z    t        |      st        S |j                  | j                  k(  S rS   )r   NotImplementedr   )rW   rd  r7  s     rY   __eq__z1AnnotatedTests.test_instantiate.<locals>.C.__eq__c!  s&    !%+))ww$&&((r[   N)r\   r]   r^   classvarr   rk  r  s   rY   r7  rg  ]!  s    H)r[   r7  a decorationrV  )r@   r   r   rl  )rW   r   r  r  r7  s       @rY   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 )Nr\  )rU  rU  rV  r   rb   rT  )r@   rT   r  r   r   r   )rW   MyCounts     rY   test_instantiate_genericz'AnnotatedTests.test_instantiate_generico!  sR    FNN1->?+q\:i0aA,?r[   c                 \     G d d      }t         |df   }| j                   |       |       y )Nc                       e Zd Zd Zy)4AnnotatedTests.test_instantiate_immutable.<locals>.Cc                     t        d      )Nzshould be ignored)r  r  s      rY   r  z@AnnotatedTests.test_instantiate_immutable.<locals>.C.__setattr__v!  s     344r[   N)r\   r]   r^   r  r_   r[   rY   r7  rt  u!  s    5r[   r7  rm  )r@   r   rW   r7  r   s      rY   test_instantiate_immutablez)AnnotatedTests.test_instantiate_immutablet!  s1    	5 	5 a'( 	ac1%r[   c                 z    t         d   }| j                  t              5   |d       d d d        y # 1 sw Y   y xY w)N)r   rV  r  rV  )r@   r}   r~   r  s     rY   test_cannot_instantiate_forwardz.AnnotatedTests.test_cannot_instantiate_forward!  s-    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)Nry  rV  )r@   r   r}   r~   r  s     rY    test_cannot_instantiate_type_varz/AnnotatedTests.test_cannot_instantiate_type_var!  s1    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)rV  r!  )r}   r  r@   r   r   r   s    rY   test_cannot_getattr_typevarz*AnnotatedTests.test_cannot_getattr_typevar!  s.    ~.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>.CrU  N)r\   r]   r^   rl  r_   r[   rY   r7  r  !  s    Hr[   r7  rm  rU  rV  )r@   r   rl  r   rv  s      rY   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>.CrU  rm  rl  r?  r  N)
r\   r]   r^   rl  r@   r$   r   r   r  r%   r_   r[   rY   r7  r  !  s2    ABHi~ =>B45E9U3Z015r[   r7  rl  r  )r   r+   r  r$   r   r%   r&  s     rY   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>.CNrp   r_   r[   rY   r7  r  !  r   r[   r7  rF  r&  s     rY   r   z#AnnotatedTests.test_cannot_subclass!  s,    ##I/LMI  NMMrg  c                     | j                  t              5  t        dt        t        df          d d d        y # 1 sw Y   y xY w)NrV  positive)r}   r~   r   r@   r   r   s    rY   test_cannot_check_instancez)AnnotatedTests.test_cannot_check_instance!  s/    y)q)CO45 *))r  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~   r   r   r@   r   s    rY   test_cannot_check_subclassz)AnnotatedTests.test_cannot_check_subclass!  s/    y)sIc:o67 *))s	   =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    rY   test_too_few_type_argsz%AnnotatedTests.test_too_few_type_args!  s'    ##I/GHcN IHHs   .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  rb   )protocolr   c                       e Zd ZdZy)_Annotated_test_Grb   Nr|  r_   r[   rY   r  r  !  r  r[   r  zA decorationr|   r{  )rT   r   r   r   r   r   r   r"   r  r@   rf   rg   rh   ri   rg  rf  r   r#   r   r  ra  r  r   )
rW   r"  rt  r   protr  restoredr  re   rR  s
             rY   r$  zAnnotatedTests.test_pickle!  sr   ::v||CH5??3'sCx??C5%<02 A!S&!Af559:\\4a\8$ll1d3G%||G4H$$Q1 98 ; 	
 	 ',n<=622Q67EQ&AQAQUUB'QUUE*QSS!$ 8 98s   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)Nrm  zanother decoration)r@   r   r   r   r   r}   r~   rT   r    r   r   r   )rW   r  dec2r  r  r:  Itr]  s           rY   
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)
Nrm  r  r   r  r  r_   r  r*  T4)r   r   r@   r  r   r   r   r}   r~   r   r   rp  r  )rW   r  r  r   r  r  r   r   r7  r:  r  r  r  r  r  r*  r  r  r  r   r   s                        rY   test_typevar_substz!AnnotatedTests.test_typevar_subst!  s   $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 )NrV  )r   r@   r   r   r   r  s     rY   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>.XNrp   r_   r[   rY   r  r  a"  r   r[   r  r)  z Annotated should be transparent.)r@   r   r   r  r  r  s     rY   test_annotated_mroz!AnnotatedTests.test_annotated_mro`"  s3    -	#w,'-QV$4;	=r[   c                     G d dt               } G d dt               }t        t          |d      f   }t        t          |d      f   }|j                  d   }|j                  d   }| j                  t	        |      |       | j                  | |d             | j                  t	        |      |       | j                  | |d             | j                  t	        |      t	        |             t        t          |d      f   }t        t          |d      f   }|j                  d   }	|j                  d   }
| j                  t	        |	      |       | j                  |	 |d             | j                  t	        |
      |       | j                  |
 |d             | j                  t	        |	      t	        |
             t        t        df   }t        t        d	f   }t        t        d
f   }| j                  t	        |j                  d         t               | j                  t	        |j                  d         t               | j                  t	        |j                  d         t               y )Nc                       e Zd Zy):AnnotatedTests.test_annotated_cached_with_types.<locals>.ANrp   r_   r[   rY   r   r  f"  r   r[   r   c                       e Zd Zy):AnnotatedTests.test_annotated_cached_with_types.<locals>.BNrp   r_   r[   rY   r   r  g"  r   r[   r   r  r   r  rb   g      ?T)
r   r@   rJ  r   r   r   r	  r   rp  r  )rW   r   r   field_a1field_a2a1_metadataa2_metadatafield_b1field_b2b1_metadatab2_metadatafield_c1field_c2field_c3s                 rY    test_annotated_cached_with_typesz/AnnotatedTests.test_annotated_cached_with_typese"  s   S!C&[)S!C&[)++A.++A.d;'+af-d;'+af-k*D,=>S!C&[)S!C&[)++A.++A.d;'+af-d;'+af-k*D,=>S!V$S#X&S$Y'd80034c:d80034e<d80034d;r[   N)r\   r]   r^   rG  r   rT  r~  rS  rZ  r^  rd  rn  rq  rw  rz  r|  r~  r  r  r   r  r  r  r$  r  r  r  r  r  r_   r[   rY   rD  rD     s    
8,99v	5	(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 rS   ro   rW   r  s     rY   -test_canonical_usage_with_variable_annotationz<TypeAliasTests.test_canonical_usage_with_variable_annotation"  s    #r[   c                     t         }y rS   r  r  s     rY   &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rS   )r}   r~   rD   r   s    rY   r   z&TypeAliasTests.test_cannot_instantiate"  s!    y)K *))r\  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    rY   rA  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  Nrt  r_   r[   rY   r   r  "  s    Nr[   r   r  )r   r+   rD   r  s     rY   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rS   )r}   r~   r   ro   rD   r   s    rY   test_no_issubclassz!TypeAliasTests.test_no_issubclass"  sS    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>.CNrp   r_   r[   rY   r7  r  "  r   r[   r7  c                       e Zd Zy).TypeAliasTests.test_cannot_subclass.<locals>.DNrp   r_   r[   rY   r:  r  "  r   r[   r:  )r   r~   rD   r}   r   r;  s      rY   r   z#TypeAliasTests.test_cannot_subclass"  sb    ##I46I 6
 y)DO  *)6 6
 *)s   A&A2&A/2A;c                 B    | j                  t        t              d       y )Nztyping.TypeAlias)r   r   rD   r   s    rY   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rS   )r}   r~   rD   r   r   s    rY   r2  z$TypeAliasTests.test_cannot_subscript"  s#    y)cN *))r3  N)r\   r]   r^   r  r  r   rA  r  r  r   r   r2  r_   r[   rY   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   r\   r]   rt  s     rY   rm  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  )ro  r   rE   r   r\   r   r]   )rW   rq  r  s      rY   rr  z#ParamSpecTests.test_basic_with_exec"  sS    ?RHsGa+S)allD)r[   c                    t        d      }t        d      }t        |t        f   }| j	                  |j
                  |t        f       | j	                  |j                  |f       t        ||f   }| j	                  |j
                  ||f       | j	                  |j                  ||f       t        j                  j                  |t        f   }| j	                  |j
                  |t        f       | j	                  |j                  |f       t        j                  j                  ||f   }| j	                  |j
                  ||f       | j	                  |j                  ||f       y Nr  r   )	rE   r   r"   r   r   r  r  r  r{  rW   r  r   r&  r'  r(  r)  s          rY   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   rQ  rP  r   r   rG   r   rH   r   r  r   r   r   )rW   r  r  s      rY   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 rS   r_   r   s      rY   ra  z-ParamSpecTests.test_stringized.<locals>.C.foo"  r  r[   N)r   r  r   r  )r\   r]   r^   r"   r   r   ra  r_   r[   rY   r7  r  "  s    38$$r[   r7  r
  r1  )rE   r#   r   r   r  r  r"   r   ra  r   r   r  s      rY   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>.XrX   r   Nr\   r]   r^   r"   r   r   )r  r   s   rY   r  r  "  s    3Dr[   r  rC  rB  r_   .c                   &    e Zd ZU eW  ef   ed<   y),ParamSpecTests.test_user_generics.<locals>.ZrX   Nr  )r  s   rY   r  r  #  s    3r[   r  )r   rE   r#   r   r   r  r  r   r~   r   rF   r  rV	  r  )rW   r  r  r  r  G3G4r  G5G6G7r  r   s              @@rY   test_user_genericsz!ParamSpecTests.test_user_generics"  s+   CLcN	1 	 sCx[sCj1**SF3##I/BCcF D##I/CDc3m E 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$ E##I/CDc4iL EDQ DCDDH EDDDs0   
O O-O:P O*-O7:PPc                    t        d      t        d       G fddt        f         }|t        t        gt        gf   }|t        gt        t        gf   }| j                  ||       | j                  |j                  t        t        ft        ff       | j                  |j                  t        ft        t        ff       y )Nr  r8  c                   <    e Zd ZU eW  ef   ed<   eW ef   ed<   y)CParamSpecTests.test_multiple_paramspecs_in_user_generics.<locals>.XrX   r  N)r\   r]   r^   r"   r   r   r   )r  r8  s   rY   r  r  0#  s!    3C  r[   r  )rE   r#   r   r   r  r   r   r  )rW   r  r  r  r  r8  s       @@rY   )test_multiple_paramspecs_in_user_genericsz8ParamSpecTests.test_multiple_paramspecs_in_user_generics,#  s    cNt_	!2 	! SzE7"#usEl"#B#SzE8&<=vU|&<=r[   c                 l   t        d      t        d       G fddt        g          }|t        t        gf   }| j                  |j                  t        t        ff       |t        t        t        gf   }| j                  |j                  t        t        t        ff       |t        g   }| j                  |j                  t        ff       |g    }| j                  |j                  d       | j                  t              5  |d    d d d         G fddt        g         }|t        gt        f   }| j                  |j                  t        ft        f       |t        gt        t        f   }| j                  |j                  t        ft        t        f       |t        g   }| j                  |j                  t        ff       |g    }| j                  |j                  d       | j                  t              5  |d    d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)	Nr  r  c                   >    e Zd ZU eW  ef   ed<   eg W    ed<   y)KParamSpecTests.test_typevartuple_and_paramspecs_in_user_generics.<locals>.XrX   r  Nr\   r]   r^   r"   r   r   r   r  r  s   rY   r  r  >#      3SbSzMr[   r  )r_   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>.YrX   r  Nr  r  s   rY   r  r  M#  r  r[   r  )
r   rE   r#   r   r  r   r  r   r}   r~   )	rW   r  r  r  r  r  r  r  r  s	          @@rY   1test_typevartuple_and_paramspecs_in_user_genericsz@ParamSpecTests.test_typevartuple_and_paramspecs_in_user_generics:#  s   $cN	Q 	 sUG|_sUHo6sC% !sC%&:;wZxk2rUe,y)bE *	B 	 w|_xo6wS !xc&:;wZxk2rUe,y)bE *) *) *)s   HH*H'*H3c           
         t        d      }t        d      }t        d      }t        t        j
                  j                  fD ]  }| j                  |      5  ||t        g |   f   }|t        t        gt        t        f   }| j                  |j                  t        t        t        t        t        f   f       d d d          G d dt        ||f         }|t        g |   |f   }|t        t        t        t        gf   }| j                  |j                  t        t        t        f   t        t        ff        G d dt        ||f         }||t        g |   f   }|t        t        gt        t        f   }| j                  |j                  t        t        ft        t        t        f   f       y # 1 sw Y   ~xY w)	Nr  r   r  )r  c                       e Zd Zy)MParamSpecTests.test_typevartuple_and_paramspecs_in_generic_aliases.<locals>.XNrp   r_   r[   rY   r  r  g#  r  r[   r  c                       e Zd Zy)MParamSpecTests.test_typevartuple_and_paramspecs_in_generic_aliases.<locals>.YNrp   r_   r[   rY   r  r  n#  r  r[   r  )rE   r   r   r"   r  r{  ri   r   r   r   r  rp  r   r  r#   )	rW   r  r   r  r7  r   r   r  r  s	            rY   3test_typevartuple_and_paramspecs_in_generic_aliaseszBParamSpecTests.test_typevartuple_and_paramspecs_in_generic_aliases\#  ss   cNCL$;??333Aa(assm$sCj%./  c3eUl8K-LM )( 4	1 	 eCRCj!meUS#J&'eE5L&9C;%GH	1 	 assmsCj%&'sCk53F%GH# )(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      rY   r  z$ParamSpecTests.test_var_substitutionu#  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   ri   r}   r~   r  rT   r"   r  r{  )rW   r   r  r  r   s        rY   r  z(ParamSpecTests.test_bad_var_substitution#  s    CLcNT1c#guS#X?C#&&&y1&&s+ 2&&y1OOAqD)#s(3 2&&y1OO,,QT238< 2 '& 111111 '&sT   D7,D>D7D:D7)D+ D7DD7D($D7+D40D77E 	c                    t        d      }t        d      }t        d      }t        d      }t        d      } G d dt        |         }||   }| j	                  |j
                  |f       | j	                  |j                  |ff       | j	                  |t           |t                  ||g   }| j	                  |j
                  |f       | j	                  |j                  |ff       | j	                  |t           |t                  |t        |g   }	| j	                  |	j
                  |f       | j	                  |	j                  t        |ff       | j	                  |	t           |t        t        g          ||t        |g   }
| j	                  |
j
                  ||f       | j	                  |
j                  |t        |ff       | j	                  |
t        t        f   |t        t        t        g          |g |t           }| j	                  |j
                  |f       | j	                  |j                  g |t        f       | j	                  |t        t        f   |t        t        t        g          |t        g|   }| j	                  |j
                  |f       | j	                  |j                  t        g|f       | j	                  |t        t        f   |t        t        t        g          ||g|   }| j	                  |j
                  ||f       | j	                  |j                  |g|f       | j	                  |t        t        t        f   |t        t        t        g          |||g   }| j	                  |j
                  |f       | j	                  |j                  ||ff       | j	                  |t           |t        t        g          ||t        |   g   }| j	                  |j
                  |f       | j	                  |j                  |t        |   ff       | j	                  |t           |t        t        t           g          |t        g |   g|   }| j	                  |j
                  |f       | j	                  |j                  t        g |   g|f       | j	                  |t        t        f   |t        t        t        f   t        t        f          ||   }| j	                  |j
                  |f       | j	                  |j                  |f       | j	                  |t        t        g   |t        t        g           G d d	t        ||f         }|||f   }| j	                  |j
                  ||f       | j	                  |j                  ||f       | j	                  |t        t        gt        gf   |t        t        gt        gf          | j	                  |g g f   |g g f          |t        t        g|f   }| j	                  |j
                  |f       | j	                  |j                  t        t        f|f       | j	                  |t        t        g   |t        t        gt        t        gf          | j	                  |g    |t        t        gg f          ||t        t        gf   }| j	                  |j
                  |f       | j	                  |j                  |t        t        ff       | j	                  |t        t        g   |t        t        gt        t        gf          | j	                  |g    |g t        t        gf          ||t        gt        |gf   }| j	                  |j
                  ||f       | j	                  |j                  |t        ft        |ff       | j	                  |t        t        f   |t        t        gt        t        gf          |g |t        t        |gf   }| j	                  |j
                  ||f       | j	                  |j                  g |t        t        |ff       | j	                  |t        t        t        f   |t        t        t        gt        t        gf          ||t        gt        g|f   }| j	                  |j
                  ||f       | j	                  |j                  |t        ft        g|f       | j	                  |t        t        t        f   |t        t        gt        t        t        gf           G d
 dt        ||f         }|||f   }| j	                  |j
                  ||f       | j	                  |j                  ||f       | j	                  |t        t        gt        f   |t        t        gt        f          |t        |g|f   }| j	                  |j
                  |f       | j	                  |j                  t        |f|f       | j	                  |t           |t        t        gt        f          |t        g||f   }| j	                  |j
                  ||f       | j	                  |j                  t        g||f       | j	                  |t        t        t        f   |t        t        t        gt        f          y )Nr   r  r  r8  r  c                       e Zd Zy)DParamSpecTests.test_type_var_subst_for_other_type_vars.<locals>.BaseNrp   r_   r[   rY   rf	  r  #  r  r[   rf	  c                       e Zd Zy)GParamSpecTests.test_type_var_subst_for_other_type_vars.<locals>.DoublePNrp   r_   r[   rY   DoublePr  #  r  r[   r  c                       e Zd Zy)EParamSpecTests.test_type_var_subst_for_other_type_vars.<locals>.PandTNrp   r_   r[   rY   PandTr  #  r  r[   r  )r   rE   r   r#   r   r  r  r   r   r  r  r   rp  r  )rW   r   r  r  r8  r  rf	  A1r  A3A4A5A5_2A6A7A8A9A10r  B1B2B3B4B5B6r  r&  r'  r(  s                                rY   'test_type_var_subst_for_other_type_varsz6ParamSpecTests.test_type_var_subst_for_other_type_vars#  sS	   CLT]cNt_$	71: 	 !W**QD1tg.C$s),1#Y**QD1tg.C$s),3(^**QD1Qxk2C$Sz"231c2,**QG43|o6CIc3-=(>?*B****RE2zzSzm4CIc4-=(>?SJ2J,,re4#6c4i$S$/?*@A1(r(^**QG4xBxk2CdN+T3T2B-CD1a&\**QD11vi0C$Sz"231d1g,**QD147|o6C$T#Y'7"895":##$**RE2crc
'8R'8&:;CHtE#s(OS#,E'FG2h++bU3u-c3Z$Sz*:;	gaen 	 QU^**QG4q"g.S#J./#tf9L1MNBFWRV_5c3Z^$**RE2Sz2&67T4L)7C#;t3L+MNB#b!9:Qt_%**QD1q4,&78S#J#tTl1J)KLBdD\)9!:;aXbz)***QG43x$&<=CJ#sdE]1J)KLZrZ3Z$+,**RH5zzSzD":&>?C-. #uc!2T5M!AB	D aX{r{*+**QG43x$&=>C-. #sdE5-A!AB	D	GAqDM 	 1a4[**QF3q!f-S#J,-uc3Z5E/FGC8Q;**QD1Qxm4C%c
C"89C:":q=!**RG4zbz1o6Cu,-uc35Eu5L/MNr[   c                    t        d      }t        d      }t        ||f   }t        |   }t        |   }t        |   t
        z  }| j                  |j                  ||f       | j                  |j                  ||f       | j                  |j                  ||f       t        t
        t        gt        f   }| j                  |t
        t        gt        f   t        |          | j                  |t
        t        gt        f   t        |          | j                  |t
        t        gt        f   t        |   t
        z         y )Nr   r  )
r   rE   r"   r   r  r   r   r  r   rp  )rW   r   r  r&  r  r  r  r7  s           rY   !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  r8  r_   .)rE   r"   r   r   r  r   r   rF   )rW   r  r8  r&  r'  s        rY   test_paramspec_gets_copiedz)ParamSpecTests.test_paramspec_gets_copied$  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>.CNrp   r_   r[   rY   r7  r   .$  r   r[   r7  rG   c                       e Zd Zy).ParamSpecTests.test_cannot_subclass.<locals>.DNrp   r_   r[   rY   r:  r"  0$  r   r[   r:  rH   c                       e Zd Zy).ParamSpecTests.test_cannot_subclass.<locals>.ENrp   r_   r[   rY   r  r$  2$  r   r[   r  r  c                       e Zd Zy).ParamSpecTests.test_cannot_subclass.<locals>.FNrp   r_   r[   rY   r  r&  6$  r   r[   r  c                       e Zd Zy).ParamSpecTests.test_cannot_subclass.<locals>.GNrp   r_   r[   rY   r  r(  9$  r   r[   r  c                       e Zd Zy).ParamSpecTests.test_cannot_subclass.<locals>.HNrp   r_   r[   rY   r  r*  <$  r   r[   r  )	r   r~   r  rE   rG   rH   r  r   r   )rW   r7  r:  r  r  r  r  r  s           rY   r   z#ParamSpecTests.test_cannot_subclass,$  s/   ##I/LM$I$ N##I/PQ(M( R##IAR/RS*O* TcN##I(;68A8 ##I(?:<!AFF!< ##I(+<<>#AHH#> > NMQQSS8 8< <> >sG   EE E,E89F4FE E),E58FFFN)r\   r]   r^   rm  rr  r  r  r  r  r  r  r  r  r  r  r  r  r   r_   r[   rY   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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>.MyClassNrp   r_   r[   rY   rc  r/  B$  r   r[   rc  )rE   rF   r   )rW   r  rc  r  s       rY   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  rL  rM  )rE   rO  rP  rF   r   ri   rQ  )rW   r  rS  rN  s       rY   rT  zConcatenateTests.test_dirF$  s^    cNKQ/01	
M M:mY7 ;:
 ;:s   A""A+	c                    t        d      }t        d      }t        t        t        |f   t        f   }| j                  |j                  t        t        |f   t        f       | j                  |j                  |f       t        t        t        ||f   |f   }| j                  |j                  t        t        ||f   |f       | j                  |j                  ||f       t        j                  j                  t        t        |f   t        f   }| j                  |j                  t        t        |f   t        f       | j                  |j                  |f       t        j                  j                  t        t        ||f   |f   }| j                  |j                  t        t        ||f   |f       | j                  |j                  ||f       y r  )
rE   r   r"   rF   r   r   r  r  r  r{  r  s          rY   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                     | j                  t        d      5  t        d    d d d        | j                  t        d      5  t        t            d d d        y # 1 sw Y   6xY w# 1 sw Y   y xY w)NzConcatenate of no typesr_   zLThe last parameter to Concatenate should be a ParamSpec variable or ellipsis)r   r~   rF   r   r   s    rY   test_invalid_usesz"ConcatenateTests.test_invalid_usesa$  s_    ##I/HIO J##1
 
 
 JI
 
s   
AA"A"A+c                    t        d      }t        d      }t        d      }t        ||f   }| j                  |t        |f   t        t        |f          | j                  |t        t
        t        gf   t        t
        t        f       | j                  |t        g f   t        f       | j                  |t        t        t
        |f   f   t        t        t
        |f          | j                  |t        df   t        t        df          t        t        |f   }| j                  ||   t        t        |f          | j                  |t
        t        g   t        t
        t        f       | j                  |t
        t        f   t        t
        t        f       | j                  |g    t        f       | j                  |t        t
        |f      t        t        t
        |f          | j                  |d   t        t        df          y )Nr   r  r8  .)r   rE   rF   r   r   r   rp  )rW   r   r  r8  r7  s        rY   r  z&ConcatenateTests.test_var_substitutionm$  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)r\   r]   r^   r.  rT  r  r3  r  r_   r[   rY   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 rS   r_   r   s    rY   ra  z'TypeGuardTests.test_basics.<locals>.foo$  r  r[   )rI   r   r   r   r}   r~   r   r  s     rY   r.  zTypeGuardTests.test_basics$  sX    #+	#+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   ro   r\   r  r
  s     rY   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>.CNrp   r_   r[   rY   r7  r<  $  r   r[   r7  c                       e Zd Zy).TypeGuardTests.test_cannot_subclass.<locals>.DNrp   r_   r[   rY   r:  r>  $  r   r[   r:  z!Cannot subclass typing\.TypeGuardc                       e Zd Zy).TypeGuardTests.test_cannot_subclass.<locals>.ENrp   r_   r[   rY   r  r@  $  r   r[   r  z(Cannot subclass typing\.TypeGuard\[int\]c                       e Zd Zy).TypeGuardTests.test_cannot_subclass.<locals>.FNrp   r_   r[   rY   r  rB  $  r   r[   r  )r   r~   r   r   rI   r   r
  s        rY   r   z#TypeGuardTests.test_cannot_subclass$  s    ##I/CDDO  E ##I/CDD3(  E ##I$HJI J ##I$OQIcN Q Q ED EDJ JQ Q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rS   )r}   r~   rI   r   r   r   r   s    rY   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   r   r   s    rY   rA  z!TypeGuardTests.test_no_isinstance$  sS    y)q)C.) *y)sI& *) *)))r
  Nr
  r_   r[   rY   r6  r6  $  s     C -'r[   r6  SpecialAttrsPSpecialAttrsTc                   D    e Zd Zd Z ej
                  de      Zd Zd Z	y)SpecialAttrsTestsc           	      B   i t         j                  dt         j                  dt         j                  dt         j                  dt         j
                  dt         j                  dt         j                  dt         j                  dt         j                  d	t         j                  d
t         j                  dt         j                  dt         j                  dt         j                  dt         j                  dt         j                   dt         j"                  di t         j$                  dt         j&                  dt         j(                  dt         j*                  dt         j,                  dt         j.                  dt         j0                  dt         j2                  dt         j4                  dt         j6                  dt         j8                  dt         j:                  dt         j<                  dt         j>                  dt         j@                  d t         jB                  d!t         jD                  d"i t         jF                  d#t         jH                  d$t         jJ                  d%t         jL                  d&t         j                  tN           dt         j                  tN           dt         j                  tN        tN        f   dt         j                  tN           dt         j
                  tN           dt         j                  tN           dt         j                  g tN        f   dt         j                  d'tN        f   dt         j                  tN        tN        f   d	t         j                  tN           d
t         j                  tN           dt         j                  tN           dt         j                  tN        tN        tN        f   di t         j                  tN           dt         j                  tN        tN        f   dt         j                   tN           dt         j"                  tN        tN        f   dt         j$                  tN           dt         j&                  tN        tN        tN        f   dt         j*                  tN        tN        f   dt         j,                  tN           dt         j.                  tN           dt         j0                  tN           dt         j2                  tN           dt         j4                  tN        tN        f   dt         j6                  tN           dt         j8                  tN        tN        f   dt         j:                  tN           dt         j<                  tN           dt         j>                  tN        tN        f   di t         j@                  tN           d t         jB                  tN           d!t         jD                  tN           d"t         jH                  tN           d$t         jH                  tN        d'f   d$t         jJ                  tN           d%t         jL                  tN           d&t         jP                  d(t         jN                  d)t         jR                  d*t         jT                  d+t         jV                  d,t         jX                  d-t         jZ                  d.t         j\                  d/t         j^                  d0t         j`                  d1i t         jb                  d2t         jd                  d3t         jf                  d4t         jh                  d5t         jj                  d6t         jl                  d7t         jP                  tN        d8f   d(t         jP                  tn        d8f   d(t         jR                  tN           d*t         jT                  tN        tp        f   d+t         jV                  tN           d,t         jZ                  tN           d.t         jZ                  d9   d.t         jZ                  d:   d.t         jb                  tN           d2t         jf                  tN           d4t         jj                  tN           d)t         jj                  tn        tr        f   d6i}|ju                         D ]  \  }}| jw                  |;      5  | jy                  |jz                  |t}        |             | jy                  |j~                  |t}        |             | jy                  |j                  d<t}        |             t        t        j                  d=z         D ]?  }t        j                  ||      }t        j                  |      }| j                  ||       A 	 d d d         y # 1 sw Y   xY w)>Nr	  r{  r   r  rn  r  r  r"   r	  r  r	  rm  r  r  r	  r  r    ra	  r  r  	ItemsViewr  r  KeysViewr   r  MappingViewr!   r  r  r  r7  r	  r  r  r   r5   
ValuesView.r@   r   r$   rF   r%   rA   r   r  r   r   r   rD   rI   r   r   rB   
Annotationr  rs  r  rT   rb   )GrT   r	  r{  r   r  rn  r  r  r"   r	  r  r	  rm  r  r  r	  r  r    ra	  r  r  rJ  r  r  rK  r   r  rL  r!   r  r  r  r7  r	  r  r  r   r5   rM  r   r@   r$   rF   r%   rA   r   r  r   r   r   rD   rI   r   r   rB   r   rE  rp  r  ri   r   r\   r   r^   r]   rf   rg   rh   rg  rf  r   )rW   cls_to_checkr  r  re   r   r#  s          rY   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]r\   r^   rT   rb   TypeNamerP  rF  rE  )rT   rA   r   rm  r   r]   rf   rg   rh   r}   r~   rg  rH  rR  r\   r^   rf  r   rF  rE  )rW   rg  re   r   r#  s        rY   test_special_attrs2z%SpecialAttrsTests.test_special_attrs29%  s`    z*Z01^451622Q67E""9-R' .- 8 	*33<<jI&&33(	
 	&&11	

 622Q67E.77?A\\!_FMM+44f= 8 	//A?@118<622Q67E]E2A\\!_FMM-0 8
 	//A?@118<622Q67E]E2A\\!_FMM-0 8G .-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 rS   r_   r   s    rY   r  z8SpecialAttrsTests.test_genericalias_dir.<locals>.Foo.barm%  r  r[   rP  rU  N)r\   r]   r^   r  r`  	__magic__r_   r[   rY   r   rV  l%  s    CIr[   r   )r  r`  r  r  r  rM  rX  )r#   r   rO  rP  r   ri   rQ  rO  )rW   r   rS  rN  s       rY   test_genericalias_dirz'SpecialAttrsTests.test_genericalias_dirk%  ss    	'!* 	 CH&	
M M:mY7 ;:	
 	i0 ;:s   	A99B	N)
r\   r]   r^   r  rT   r  r   rR  rS  rY  r_   r[   rY   rH  rH  $  s)    |/| v~~:C@H01d1r[   rH  c                       e Zd Zd Zy)RevealTypeTestsc                     t               }t               5 }| j                  |t        |             d d d        | j	                  j                         d       y # 1 sw Y   *xY w)NzRuntime type is 'object'
)r  rJ   r   r0   r   getvalue)rW   rW  stderrs      rY   test_reveal_typez RevealTypeTests.test_reveal_type%  sJ    h&MM#{3/0 *,HI s   AA#N)r\   r]   r^   r_  r_   r[   rY   r[  r[  ~%  s    Jr[   r[  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_onlyrd  re  c                     d S )Nc                     | S rS   r_   r  s    rY   r2  zNDataclassTransformTests.test_decorator.<locals>.create_model.<locals>.<lambda>%  s    sr[   r_   rc  s     rY   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  r_   r[   rY   CustomerModelrl  %      Gr[   rm  r_   
eq_defaultrj  ri  frozen_defaultfield_specifiersr   )r  r1   r   r   __dataclass_transform__)rW   rh  	decoratedrm  s       rY   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rd  rd  c                     y rS   r_   )r  rd  s     rY   r  zLDataclassTransformTests.test_base_class.<locals>.ModelBase.__init_subclass__%  s    r[   N)r\   r]   r^   r  r  r_   r[   rY   	ModelBaserx  %  s    9>D$Dr[   r{  T)rp  rj  make_everything_awesomec                       e Zd ZU eed<   y)>DataclassTransformTests.test_base_class.<locals>.CustomerModelr  Nr  r_   r[   rY   rm  r~  %  rn  r[   rm  ry  Fr_   r|  ro  )r1   r   r   rs  r  )rW   r{  	Decoratedrm  s       rY   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>.FieldNrp   r_   r[   rY   Fieldr  %  r   r[   r  c                   *     e Zd Zdddef fdZ xZS )9DataclassTransformTests.test_metaclass.<locals>.ModelMetaTinitr  c                (    t         |   | |||      S rS   )r   r  )r  r  r  	namespacer  r   s        rY   r  zADataclassTransformTests.test_metaclass.<locals>.ModelMeta.__new__%  s     wsD%CCr[   )r\   r]   r^   r  r  r   r   s   @rY   	ModelMetar  %  s    =AD6:D Dr[   r  T)rj  rq  rr  c                       e Zd Zy)9DataclassTransformTests.test_metaclass.<locals>.ModelBaseNrp   r_   r[   rY   r{  r  %  r   r[   r{  r  c                       e Zd ZU eed<   y)=DataclassTransformTests.test_metaclass.<locals>.CustomerModelr  Nr  r_   r[   rY   rm  r  %  rn  r[   rm  Fr  ro  )r   r1   r   r   rs  r   )rW   r  r  r  r{  rm  s         rY   test_metaclassz&DataclassTransformTests.test_metaclass%  s    	D 	D
'tuh

	 	2)1	IE 	 	i+--"!%#("&%*H
	
 	mY7r[   N)r\   r]   r^   ru  r  r  r_   r[   rY   ra  ra  %  s    
4888r[   ra  c                       e Zd ZdZd Zd Zy)AllTestszTests for __all__.c                    ddl m} | j                  d|       | j                  d|       | j                  d|       | j                  d|       | j                  d|       | j                  d|       | j                  d	|       | j                  d
|       | j                  d|       | j                  d|       | j                  d|       | j                  d|       | j                  d|       y )Nr   )r	  r	  rM  r)   r   rm  r{  ior   osrW  Textr.  r%  )rT   r	  rQ  rO  rM
  s     rY   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 )Nrp  >   r  r   )rU	  _contra_cor]   )rO  rT   r	  rP  r  r  r  upperr	  r\   assertSetEqual)rW   
actual_allr  r  computed_alls        rY   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)r\   r]   r^   rE  r  r  r_   r[   rY   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_TYPESri   r   r~   r!	  r  )rW   expected_error_regex	test_typerp  s       rY   test_cannot_iteratez&TypeIterationTests.test_cannot_iterate&  s    7//I9-++I7KLO M++I7KLO M++I7KL& ' M .- 0LLLLL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 rS   )r  r   r  r{  r  )rW   type_to_tests     rY    test_is_not_instance_of_iterablez3TypeIterationTests.test_is_not_instance_of_iterable%&  s,     22L$$\;??3K3KL 3r[   N)r\   r]   r^   r   r   r   r   r   r   r   r"   r@   r  r  r  r_   r[   rY   r  r  
&  sc    c3hc1fa!c!R%
Mr[   r  c                 V    dd l }|j                  |j                  t                     |S rX  )doctestaddTestsDocTestSuiterT   )loaderr  patternr  s       rY   
load_testsr  *&  s!    	NN7''/0Lr[   __main__)rs  r  collections.abcr   	functoolsr   r   r   r  r
  r  rV  rg   r   rW  r&  unittestr   r   r	   unittest.mockr
   r   r   rT   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r5   r6   r7   r8   r9   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   r{  r	  r  r  test.supportrJ   rK   test.support.testcaserL   test.typinganndatarM   rN   rO   r   r  r  rQ   rm   ro   rs   ru   rw   ry   r   r   r  r  r  rK  re  r  r   r  r  r  r  r  rG  r  rc  rw  r  r  rE  rK  rM  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r
  r
  r
  r
  r?  rF  rI  rK  rN  rQ  rB  rD  rI  rr  rs  rt  ru  rv  rw  r  ry  rn  r  r  r   r   r  r  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  rq  r~  rn  r~  r  r  r  r/  r  r  r  r-  rD  r  r  r,  r6  rE  rp  r$  rF  rH  r[  ra  r  r  r  r\   r_   r[   rY   <module>r     s      # . . 	     	 
  ) )   5 5 ; ; 8 8   + + 4 4  < < 7 7 ! '    & 9  ? ? ' ' ! ( &  I I  
     6 1 T T @ C> 8_ 		 		h 		h 		gw 	F| FR&% &%R-(, -(8%| 8 
| 
&65 65r5> 5>ng2< g2TA,S	 A,c49n9M A,RVW\]`WaRb A,H+| +B@L @HB', B'J~
< ~
<B.$ .$bTG TGn)' )'Xd dL		?+\ 	?(0, (x=< x=v T3T]	GBFO 	mBF+ $  J   
H H  	ueX 	 	 H  
	u 	   h  [8L [8|0|< |~!+&L +&Z0# 0#fG6, G6T{9\ {9| $6l 6" +0 0 0 < < <X1l X1v   YCL YC|  env'', %6//4 %   1  
    : j J 
J  	'WcN+,i 	WQZ 	

 
  #..q1  (7E 'iu  IU )5 ) J J, : ,,Y ,,9 ,. .$,.. $V//4 

35Mt  vU| vUr	aT8 aTHSg, Sgl1L 1:$% $%NK( KR< RjbGl bGJhE\ hEV-&L -&`-)| -)`#(l #(LLl L^p<\ p<f*\ *ZG$\ G$T@8| @8D/'\ /'d !  1UGDD1 D1NJl JU8l U8p)6| )6XM M@ zF Ik  66!9??s   7\ ]$\??]