
    01i                     L   % S r SSKJrJrJrJrJrJr  SSKrSSK	r
SSKJr  SSKJr   " S S\5      rS\S\4S jr\" \R$                  \R$                  R&                  \
R(                  5      r\" \" \R,                  5      \" \R,                  5      R&                  \5      \" \" \R.                  5      \" \R.                  5      R&                  \5      \" \R0                  S	S5      \S
.r\R4                  R7                  S\R9                  5       \R;                  5       S9S\S\SS4S j5       r\R4                  R7                  S\R9                  5       \R;                  5       S9S\S\SS4S j5       r \R4                  R7                  S\R9                  5       \R;                  5       S9S\S\SS4S j5       r!\R4                  R7                  S\R9                  5       \R;                  5       S9S\S\SS4S j5       r"SS jr#\RH                  \
RJ                  " S5      4\RL                  \
RJ                  " S5      4\RN                  S/4S.r(\)\*\+\\   \,4   4   \-S'   \R4                  R7                  S\(R]                  5       \(R;                  5       S9 " S S5      5       r/g)z)Test the runtime usage of `numpy.typing`.    )Any
NamedTupleUnionget_args
get_originget_type_hintsNc                   D    \ rS rSr% \\S'   \\S4   \S'   \S-  \S'   Srg)TypeTup   typ.argsNorigin )__name__
__module____qualname____firstlineno__type__annotations__tuple__static_attributes__r       Y/home/james-whalen/.local/lib/python3.13/site-packages/numpy/typing/tests/test_runtime.pyr
   r
      s     	I
c	
4Kr   r
   treturnc                     [        U SU 5      $ )N	__value__)getattr)r   s    r   _flatten_type_aliasr      s    1k1%%r   r   )	ArrayLike	DTypeLikeNBitBaseNDArrayzname,tup)idsnametupc                 V    UR                   UR                  p2[        U5      nXC:X  d   eg)zTest `typing.get_args`.N)r   r   r   r%   r&   r   refouts        r   test_get_argsr+   0   s&     ww
3-C::r   c                 V    UR                   UR                  p2[        U5      nXC:X  d   eg)zTest `typing.get_origin`.N)r   r   r   r(   s        r   test_get_originr-   8   s&     ww


S/C::r   c                 n    UR                   nSUSS4S jn[        U5      nU[        S5      S.nXE:X  d   eg)zTest `typing.get_type_hints`.ar   Nc                     g Nr   r/   s    r   func!test_get_type_hints.<locals>.funcE   s    dr   r/   r   )r   r   r   )r%   r&   r   r3   r*   r)   s         r   test_get_type_hintsr6   @   s<     ''C"""

CtDz
*C::r   c                     SU  3UR                   p2SUSS4S jn[        U5      n[        [        [	        U 5      5      [        S5      S.nXV:X  d   eg)zATest `typing.get_type_hints` with string-representation of types.znpt.r/   r   Nc                     g r1   r   r2   s    r   r3   %test_get_type_hints_str.<locals>.funcQ   s    $r   r5   )r   r   r   nptstrr   )r%   r&   typ_strr   r3   r*   r)   s          r   test_get_type_hints_strr=   L   sO     $=#''S&&D&

CSY'4:
>C::r   c                  l    [         R                  5       n [        [        R                  5      nX:X  d   eg)zCTest that ``TYPES.keys()`` and ``numpy.typing.__all__`` are synced.N)TYPESkeyssetr:   __all__)r@   r)   s     r   	test_keysrC   X   s%    ::<D
ckk
C;;r   
      )_SupportsArray_SupportsArrayFunc_NestedSequence	PROTOCOLSzcls,objc                   L    \ rS rSrS\\   S\SS4S jrS\\   S\SS4S jrSr	g)	TestRuntimeProtocolf   clsobjr   Nc                 N    [        X!5      (       d   e[        S U5      (       a   eg r1   )
isinstanceselfrM   rN   s      r   test_isinstance#TestRuntimeProtocol.test_isinstanceh   s)    #####dC(((((r   c                 t    [        [        U5      U5      (       d   e[        [        S 5      U5      (       a   eg r1   )
issubclassr   rQ   s      r   test_issubclass#TestRuntimeProtocol.test_issubclassl   s3    $s)S))))d4j#.....r   r   )
r   r   r   r   r   r   objectrS   rW   r   r   r   r   rK   rK   f   s>    )49 )6 )d )/49 /6 /d /r   rK   )r   N)0__doc__typingr   r   r   r   r   r   pytestnumpynpnumpy._typing_typing_nptnumpy.typingr:   r
   r   r#   __args__ndarray
NDArrayTupr    r!   r"   r?   markparametrizeitemsr@   r   r+   r-   r6   r=   rC   rF   arangerG   rH   rI   dictr;   r   rY   r   valuesrK   r   r   r   <module>rl      s   /     j &3 &3 &
 S[[#++"6"6

C
 CMM*CMM*33
 CMM*CMM*33
 b$/	  U[[]

E 7 t  F U[[]

E$ W   F U[[]

Ed  T  F U[[]

E$ W   F **BIIbM:22BIIbMB,,qc22	4U49f,--.  I$4$4$6INN<LM/ / N/r   