[Python-checkins] r78749 - in python/trunk/Lib: argparse.py test/test_argparse.py

benjamin.peterson python-checkins at python.org
Sun Mar 7 01:29:45 CET 2010


Author: benjamin.peterson
Date: Sun Mar 7 01:29:44 2010
New Revision: 78749
Log:
eliminate py3k warnings in argparse
Modified:
 python/trunk/Lib/argparse.py
 python/trunk/Lib/test/test_argparse.py
Modified: python/trunk/Lib/argparse.py
==============================================================================
--- python/trunk/Lib/argparse.py	(original)
+++ python/trunk/Lib/argparse.py	Sun Mar 7 01:29:44 2010
@@ -1143,6 +1143,8 @@
 for name in kwargs:
 setattr(self, name, kwargs[name])
 
+ __hash__ = None
+
 def __eq__(self, other):
 return vars(self) == vars(other)
 
Modified: python/trunk/Lib/test/test_argparse.py
==============================================================================
--- python/trunk/Lib/test/test_argparse.py	(original)
+++ python/trunk/Lib/test/test_argparse.py	Sun Mar 7 01:29:44 2010
@@ -73,6 +73,8 @@
 kwarg_str = ', '.join(['%s=%r' % tup for tup in sorted_items])
 return '%s(%s)' % (type(self).__name__, kwarg_str)
 
+ __hash__ = None
+
 def __eq__(self, other):
 return vars(self) == vars(other)
 
@@ -1383,6 +1385,8 @@
 def __init__(self, name):
 self.name = name
 
+ __hash__ = None
+
 def __eq__(self, other):
 if other in self.seen:
 text = self.seen[other]
@@ -1446,6 +1450,8 @@
 def __init__(self, name):
 self.name = name
 
+ __hash__ = None
+
 def __eq__(self, other):
 if other not in self.seen:
 text = 'Check that file is writable.'
@@ -1511,6 +1517,8 @@
 def __init__(self, value):
 self.value = value
 
+ __hash__ = None
+
 def __eq__(self, other):
 return (type(self), self.value) == (type(other), other.value)
 
@@ -1533,6 +1541,8 @@
 def __init__(self, value):
 self.value = value
 
+ __hash__ = None
+
 def __eq__(self, other):
 return (type(self), self.value) == (type(other), other.value)
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /