)
from collections.abc import *
from contextlib import AbstractContextManager, AbstractAsyncContextManager
+from mmap import mmap
from ipaddress import IPv4Network, IPv4Interface, IPv6Network, IPv6Interface
from itertools import chain
from os import DirEntry
from re import Pattern, Match
-from types import GenericAlias, MappingProxyType
+from types import GenericAlias, MappingProxyType, AsyncGeneratorType
import typing
from typing import TypeVar
"""Test basics."""
def test_subscriptable(self):
- for t in (type, tuple, list, dict, set, frozenset,
+ for t in (type, tuple, list, dict, set, frozenset, enumerate,
+ mmap,
defaultdict, deque,
OrderedDict, Counter, UserDict, UserList,
Pattern, Match,
Mapping, MutableMapping, MappingView,
KeysView, ItemsView, ValuesView,
Sequence, MutableSequence,
- MappingProxyType,
+ MappingProxyType, AsyncGeneratorType,
DirEntry,
IPv4Network, IPv4Interface, IPv6Network, IPv6Interface,
- MappingProxyType, DirEntry,
chain,
):
tname = t.__name__
#ifdef MS_WINDOWS
{"__sizeof__", (PyCFunction) mmap__sizeof__method, METH_NOARGS},
#endif
+ {"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_O|METH_CLASS,
+ PyDoc_STR("See PEP 585")},
{NULL, NULL} /* sentinel */
};
static PyMethodDef enum_methods[] = {
{"__reduce__", (PyCFunction)enum_reduce, METH_NOARGS, reduce_doc},
+ {"__class_getitem__", (PyCFunction)Py_GenericAlias,
+ METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
{NULL, NULL} /* sentinel */
};
{"asend", (PyCFunction)async_gen_asend, METH_O, async_asend_doc},
{"athrow",(PyCFunction)async_gen_athrow, METH_VARARGS, async_athrow_doc},
{"aclose", (PyCFunction)async_gen_aclose, METH_NOARGS, async_aclose_doc},
+ {"__class_getitem__", (PyCFunction)Py_GenericAlias,
+ METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
{NULL, NULL} /* Sentinel */
};