]> granicus.if.org Git - python/commitdiff
eliminate py3k warnings in argparse
authorBenjamin Peterson <benjamin@python.org>
Sun, 7 Mar 2010 00:29:44 +0000 (00:29 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sun, 7 Mar 2010 00:29:44 +0000 (00:29 +0000)
Lib/argparse.py
Lib/test/test_argparse.py

index 5148d640e53147c08b200859857238d85860da27..836fa5c70999af50784c893e6c5be668f815d0ae 100644 (file)
@@ -1143,6 +1143,8 @@ class Namespace(_AttributeHolder):
         for name in kwargs:
             setattr(self, name, kwargs[name])
 
+    __hash__ = None
+
     def __eq__(self, other):
         return vars(self) == vars(other)
 
index 944a97d3927c2aa52d3af716704bef992357ea79..6676f1680ecbd04e71967fda611a3ba72cfbaea1 100644 (file)
@@ -73,6 +73,8 @@ class NS(object):
         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 @@ class RFile(object):
     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 @@ class WFile(object):
     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 @@ class TestTypeUserDefined(ParserTestCase):
         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 @@ class TestTypeClassicClass(ParserTestCase):
         def __init__(self, value):
             self.value = value
 
+        __hash__ = None
+
         def __eq__(self, other):
             return (type(self), self.value) == (type(other), other.value)