# import types, weakref # Deferred to single_dispatch()
from reprlib import recursive_repr
from _thread import RLock
+from types import GenericAlias
################################################################################
def __isabstractmethod__(self):
return getattr(self.func, "__isabstractmethod__", False)
+ __class_getitem__ = classmethod(GenericAlias)
+
+
# Helper functions
def _unwrap_partial(func):
)
raise TypeError(msg) from None
return val
+
+ __class_getitem__ = classmethod(GenericAlias)
from concurrent.futures import Future
from concurrent.futures.thread import _WorkItem
from contextlib import AbstractContextManager, AbstractAsyncContextManager
+from functools import partial, partialmethod, _lru_cache_wrapper, cached_property
from ctypes import Array, LibraryLoader
from difflib import SequenceMatcher
from filecmp import dircmp
FileInput,
OrderedDict, Counter, UserDict, UserList,
Pattern, Match,
+ partial, partialmethod, cached_property,
AbstractContextManager, AbstractAsyncContextManager,
Awaitable, Coroutine,
AsyncIterable, AsyncIterator,
static PyMethodDef partial_methods[] = {
{"__reduce__", (PyCFunction)partial_reduce, METH_NOARGS},
{"__setstate__", (PyCFunction)partial_setstate, METH_O},
+ {"__class_getitem__", (PyCFunction)Py_GenericAlias,
+ METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
{NULL, NULL} /* sentinel */
};