zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
U
O±dOã    @sÒdZddlmZddlZddlZddlmZddlZddlZ    ddl
m Z Gdd„dƒZ Gdd    „d    ƒZejjejd
kd d ej d e    je    je    je    je    jg¡Gdd„dƒƒƒZejjejd
kdd ddœdd„ƒZdS)z
This file tests the generic aspects of ArrayMethod.  At the time of writing
this is private API, but when added, public API may be added here.
é)Ú annotationsN)ÚAny)Ú_get_castingimplc @sdeZdZeee d¡ƒee d¡ƒƒZej     
ddddde d¡dffe d¡d    ffg¡d
d „ƒZ d    S) ÚTestResolveDescriptorsÚdÚfÚargs©T©N©)NNN)©NNTNc    Cs&t t¡|jj|ŽW5QRXdSr
)ÚpytestÚraisesÚ    TypeErrorÚmethodZ_resolve_descriptors)Úselfr©rúXd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/core/tests/test_arraymethod.pyÚtest_invalid_argumentss     z-TestResolveDescriptors.test_invalid_arguments) Ú__name__Ú
__module__Ú __qualname__Úget_castingimplÚtypeÚnpÚdtyperr ÚmarkÚ parametrizerrrrrrsúrc@sôeZdZeee d¡ƒee d¡ƒƒZej     
ddgde fde fde fde fe  d    ¡e  d    ¡ffe fej d    d
d ej d    d d ffe fej d dd ej d dd ffefej d    dd ej ddd ffefejddd ejddd ffefg    ¡dd„ƒZdS)ÚTestSimpleStridedCallrrrÚerrorr    )r
r r éz>d)rz<f)ér!ésx00x00x00x00x00x00s x00x00x00c    Cs&t |¡|jj|ŽW5QRXdSr
)r rrZ_simple_strided_call)rrrrrrr-s z,TestSimpleStridedCall.test_invalid_argumentsN)rrrrrrrrr rrrZarangeZonesÚ
ValueErrorZ
frombufferrrrrrr&s. ÿÿÿ  ÿþôr)r é    zRequires python 3.9)ÚreasonÚclsc@s@eZdZdddœdd„Zej dedƒ¡dddd    œd
d „ƒZd S) ÚTestClassGetItemztype[np.ndarray]ÚNone)r&ÚreturncCs.|ttf}t|tjƒst‚|j|ks*t‚dS)z!Test `ndarray.__class_getitem__`.N)rÚ
isinstanceÚtypesZ GenericAliasÚAssertionErrorÚ
__origin__)rr&ÚaliasrrrÚtest_class_getitemHs z#TestClassGetItem.test_class_getitemÚarg_lenr"Úint)r&r0r)c    Cs^tf|}|dkr ||sZt‚n:d|dkr.dnd›d}tjt|d||W5QRXdS)N)ér!zToo rÚfewÚmanyz
 arguments©Úmatch)rr,r rr)rr&r0Zarg_tupr6rrrÚtest_subscript_tupNs 
z#TestClassGetItem.test_subscript_tupN)    rrrr/r rrÚranger7rrrrr'Csr'zRequires python 3.8r()r)c    Cs0d}tjt|dtjttfW5QRXdS)Nz(Type subscription requires python >= 3.9r5)r rrrÚndarrayrr5rrrÚtest_class_getitem_38Ysr:)Ú__doc__Ú
__future__rÚsysr+Útypingrr ÚnumpyrZnumpy.core._multiarray_umathrrrrrZskipifÚ version_inforr9ZrecarrayZ    chararrayZmatrixZmemmapr'r:rrrrÚ<module>s"   ÿ