Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6b31fd0f
Commit
6b31fd0f
authored
Mar 07, 2010
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eliminate py3k warnings in argparse
parent
9c4742e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
Lib/argparse.py
Lib/argparse.py
+2
-0
Lib/test/test_argparse.py
Lib/test/test_argparse.py
+10
-0
No files found.
Lib/argparse.py
View file @
6b31fd0f
...
...
@@ -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
)
...
...
Lib/test/test_argparse.py
View file @
6b31fd0f
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment