From: Raymond Hettinger Date: Sat, 4 Apr 2020 18:03:04 +0000 (-0700) Subject: Convert tuples to sets for faster searches (GH-19365) X-Git-Tag: v3.9.0a6~194 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1ae6445391cc3519733df69a4448059d6eff3c6f;p=thirdparty%2FPython%2Fcpython.git Convert tuples to sets for faster searches (GH-19365) --- diff --git a/Lib/typing.py b/Lib/typing.py index 0a685d304bd9..53518830002c 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1716,11 +1716,11 @@ def _make_nmtuple(name, types): # attributes prohibited to set in NamedTuple class syntax -_prohibited = ('__new__', '__init__', '__slots__', '__getnewargs__', +_prohibited = {'__new__', '__init__', '__slots__', '__getnewargs__', '_fields', '_field_defaults', '_field_types', - '_make', '_replace', '_asdict', '_source') + '_make', '_replace', '_asdict', '_source'} -_special = ('__module__', '__name__', '__annotations__') +_special = {'__module__', '__name__', '__annotations__'} class NamedTupleMeta(type):