|
1 | 1 | // spell-checker:ignore typecode tofile tolist fromfile |
2 | | - |
3 | 2 | use rustpython_vm::{PyRef, VirtualMachine, builtins::PyModule}; |
4 | 3 |
|
5 | 4 | pub(crate) fn make_module(vm: &VirtualMachine) -> PyRef<PyModule> { |
@@ -44,8 +43,8 @@ mod array { |
44 | 43 | AsObject, Py, PyObject, PyObjectRef, PyPayload, PyRef, PyResult, VirtualMachine, |
45 | 44 | atomic_func, |
46 | 45 | builtins::{ |
47 | | - PositionIterInternal, PyByteArray, PyBytes, PyBytesRef, PyDictRef, PyFloat, PyInt, |
48 | | - PyList, PyListRef, PyStr, PyStrRef, PyTupleRef, PyTypeRef, |
| 46 | + PositionIterInternal, PyByteArray, PyBytes, PyBytesRef, PyDictRef, PyFloat, |
| 47 | + PyGenericAlias, PyInt, PyList, PyListRef, PyStr, PyStrRef, PyTupleRef, PyTypeRef, |
49 | 48 | }, |
50 | 49 | class_or_notimplemented, |
51 | 50 | convert::{ToPyObject, ToPyResult, TryFromBorrowedObject, TryFromObject}, |
@@ -1195,6 +1194,15 @@ mod array { |
1195 | 1194 |
|
1196 | 1195 | false |
1197 | 1196 | } |
| 1197 | + |
| 1198 | + #[pyclassmethod] |
| 1199 | + fn __class_getitem__( |
| 1200 | + cls: PyTypeRef, |
| 1201 | + args: PyObjectRef, |
| 1202 | + vm: &VirtualMachine, |
| 1203 | + ) -> PyGenericAlias { |
| 1204 | + PyGenericAlias::from_args(cls, args, vm) |
| 1205 | + } |
1198 | 1206 | } |
1199 | 1207 |
|
1200 | 1208 | impl Comparable for PyArray { |
|
0 commit comments