From: Raymond Hettinger Date: Wed, 17 Aug 2016 07:46:48 +0000 (-0700) Subject: Minor readability tweak X-Git-Tag: v3.6.0b1~694 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8579a8fd630a0d34f90a0b4745518b362b2ea774;p=python Minor readability tweak --- diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index f465e74770..03ecea27cc 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -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 '