1. Armin Rigo
  2. cpython-withatomic

Commits

Victor Stinner  committed 96ffe4a

cgi: use isinstance(x, list) instead of type(x) == type([])

  • Participants
  • Parent commits d864328
  • Branches default

Comments (0)

Files changed (1)

File Lib/cgi.py

View file
         """Dictionary style get() method, including 'value' lookup."""
         if key in self:
             value = self[key]
-            if type(value) is type([]):
+            if isinstance(value, list):
                 return [x.value for x in value]
             else:
                 return value.value
         """ Return the first value received."""
         if key in self:
             value = self[key]
-            if type(value) is type([]):
+            if isinstance(value, list):
                 return value[0].value
             else:
                 return value.value
         """ Return list of received values."""
         if key in self:
             value = self[key]
-            if type(value) is type([]):
+            if isinstance(value, list):
                 return [x.value for x in value]
             else:
                 return [value.value]