]> granicus.if.org Git - python/commitdiff
Oops, forgot to test this after the merge.
authorGuido van Rossum <guido@python.org>
Fri, 16 Nov 2007 00:48:13 +0000 (00:48 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 16 Nov 2007 00:48:13 +0000 (00:48 +0000)
Lib/collections.py

index 7b23948c66b681594a45cc9b9fb516b3cc80df1b..a553c9f04f02905d8a46b7d7d4b7419e0a07e64b 100644 (file)
@@ -70,7 +70,7 @@ def namedtuple(typename, field_names, verbose=False):
             return dict(zip(%(field_names)r, self))
         def __replace__(self, **kwds):
             'Return a new %(typename)s object replacing specified fields with new values'
-            return %(typename)s(**dict(zip(%(field_names)r, self) + kwds.items()))  \n''' % locals()
+            return %(typename)s(**dict(list(zip(%(field_names)r, self)) + list(kwds.items())))  \n''' % locals()
     for i, name in enumerate(field_names):
         template += '        %s = property(itemgetter(%d))\n' % (name, i)
     if verbose:
@@ -105,7 +105,7 @@ if __name__ == '__main__':
 
     # test and demonstrate ability to override methods
     Point.__repr__ = lambda self:  'Point(%.3f, %.3f)' % self
-    print p
+    print(p)
 
     import doctest
     TestResults = namedtuple('TestResults', 'failed attempted')