Generic itertools.chain (GH-19417)

This commit is contained in:
Ethan Smith 2020-04-09 20:28:08 -07:00 committed by GitHub
parent 38ada3bac8
commit a8403d057d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -7,6 +7,7 @@ from collections import (
) )
from collections.abc import * from collections.abc import *
from contextlib import AbstractContextManager, AbstractAsyncContextManager from contextlib import AbstractContextManager, AbstractAsyncContextManager
from itertools import chain
from os import DirEntry from os import DirEntry
from re import Pattern, Match from re import Pattern, Match
from types import GenericAlias, MappingProxyType from types import GenericAlias, MappingProxyType
@ -35,7 +36,8 @@ class BaseTest(unittest.TestCase):
Mapping, MutableMapping, MappingView, Mapping, MutableMapping, MappingView,
KeysView, ItemsView, ValuesView, KeysView, ItemsView, ValuesView,
Sequence, MutableSequence, Sequence, MutableSequence,
MappingProxyType, DirEntry MappingProxyType, DirEntry,
chain,
): ):
tname = t.__name__ tname = t.__name__
with self.subTest(f"Testing {tname}"): with self.subTest(f"Testing {tname}"):

View file

@ -2028,6 +2028,8 @@ static PyMethodDef chain_methods[] = {
reduce_doc}, reduce_doc},
{"__setstate__", (PyCFunction)chain_setstate, METH_O, {"__setstate__", (PyCFunction)chain_setstate, METH_O,
setstate_doc}, setstate_doc},
{"__class_getitem__", (PyCFunction)Py_GenericAlias,
METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
{NULL, NULL} /* sentinel */ {NULL, NULL} /* sentinel */
}; };