.. versionchanged:: 3.5
memoryviews can now be indexed with tuple of integers.
+ .. versionchanged:: next
+ memoryview is now a :term:`generic type`.
+
:class:`memoryview` has several methods:
.. method:: __eq__(exporter)
:mod:`copyable <copy>`.
(Contributed by Serhiy Storchaka in :gh:`125767`.)
+* The :class:`memoryview` type now supports subscription,
+ making it a :term:`generic type`.
+ (Contributed by Brian Schubert in :gh:`126012`.)
+
New modules
===========
class BaseTest(unittest.TestCase):
"""Test basics."""
- generic_types = [type, tuple, list, dict, set, frozenset, enumerate,
+ generic_types = [type, tuple, list, dict, set, frozenset, enumerate, memoryview,
defaultdict, deque,
SequenceMatcher,
dircmp,
--- /dev/null
+The :class:`memoryview` type now supports subscription, making it a
+:term:`generic type`.
MEMORYVIEW__FROM_FLAGS_METHODDEF
{"__enter__", memory_enter, METH_NOARGS, NULL},
{"__exit__", memory_exit, METH_VARARGS, memory_exit_doc},
+ {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
{NULL, NULL}
};