[Python-checkins] cpython: Minor readability tweak

raymond.hettinger python-checkins at python.org
Wed Aug 17 03:47:08 EDT 2016


https://hg.python.org/cpython/rev/576128ef551b
changeset:   102717:576128ef551b
user:        Raymond Hettinger <python at rcn.com>
date:        Wed Aug 17 00:46:48 2016 -0700
summary:
  Minor readability tweak

files:
  Lib/collections/__init__.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -393,7 +393,7 @@
                 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 '

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list