mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Minor readability tweak
This commit is contained in:
parent
4d02b1b2bb
commit
8579a8fd63
1 changed files with 1 additions and 1 deletions
|
@ -393,7 +393,7 @@ def namedtuple(typename, field_names, *, verbose=False, rename=False):
|
|||
field_names[index] = '_%d' % index
|
||||
seen.add(name)
|
||||
for name in [typename] + field_names:
|
||||
if type(name) != str:
|
||||
if type(name) is not str:
|
||||
raise TypeError('Type names and field names must be strings')
|
||||
if not name.isidentifier():
|
||||
raise ValueError('Type names and field names must be valid '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue