]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Convert tuples to sets for faster searches (GH-19365)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Sat, 4 Apr 2020 18:03:04 +0000 (11:03 -0700)
committerGitHub <noreply@github.com>
Sat, 4 Apr 2020 18:03:04 +0000 (11:03 -0700)
Lib/typing.py

index 0a685d304bd96f4e0f86a25423489083ee068d19..53518830002ca9949451a53b3062807a8c91e125 100644 (file)
@@ -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):