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
7b16da72
Commit
7b16da72
authored
Dec 06, 2013
by
peastman
Browse files
Merge pull request #227 from pgrinaway/units
Implemented equality and inequality operators for BaseDimension
parents
4c5e01a1
8d6d5521
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
wrappers/python/simtk/unit/basedimension.py
wrappers/python/simtk/unit/basedimension.py
+10
-0
No files found.
wrappers/python/simtk/unit/basedimension.py
View file @
7b16da72
...
@@ -90,6 +90,16 @@ class BaseDimension(object):
...
@@ -90,6 +90,16 @@ class BaseDimension(object):
def
__repr__
(
self
):
def
__repr__
(
self
):
return
'BaseDimension("%s")'
%
self
.
name
return
'BaseDimension("%s")'
%
self
.
name
def
__eq__
(
self
,
other
):
if
isInstance
(
other
,
BaseDimension
):
return
self
.
_index
==
other
.
_index
return
False
def
__ne__
(
self
,
other
):
if
isInstance
(
other
,
BaseDimension
):
return
self
.
_index
!=
other
.
_index
return
False
# run module directly for testing
# run module directly for testing
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
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