]> granicus.if.org Git - python/commitdiff
Minor readability tweak
authorRaymond Hettinger <python@rcn.com>
Wed, 17 Aug 2016 07:46:48 +0000 (00:46 -0700)
committerRaymond Hettinger <python@rcn.com>
Wed, 17 Aug 2016 07:46:48 +0000 (00:46 -0700)
Lib/collections/__init__.py

index f465e7477079eb6f100045ee85269431e5504ccc..03ecea27cc1c47d3289fa99bfb71ef6487d50d60 100644 (file)
@@ -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 '