Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
8d6d5521
Commit
8d6d5521
authored
Dec 05, 2013
by
Patrick Grinaway
Browse files
Check type in __eq__() and __ne__(), simplify code
parent
1f1a28b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
wrappers/python/simtk/unit/basedimension.py
wrappers/python/simtk/unit/basedimension.py
+5
-5
No files found.
wrappers/python/simtk/unit/basedimension.py
View file @
8d6d5521
...
...
@@ -91,14 +91,14 @@ class BaseDimension(object):
return
'BaseDimension("%s")'
%
self
.
name
def
__eq__
(
self
,
other
):
if
self
.
_index
==
other
.
_index
:
return
True
if
isInstance
(
other
,
BaseDimension
)
:
return
self
.
_index
==
other
.
_index
return
False
def
__ne__
(
self
,
other
):
if
self
.
_index
==
other
.
_index
:
return
False
return
Tru
e
if
isInstance
(
other
,
BaseDimension
)
:
return
self
.
_index
!=
other
.
_index
return
Fals
e
# run module directly for testing
...
...
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