projects
/
python-bulletml.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
INumberDef: Rounding version of NumberDef.
[python-bulletml.git]
/
bulletml
/
expr.py
diff --git
a/bulletml/expr.py
b/bulletml/expr.py
index
8022476
..
9ca82ec
100644
(file)
--- a/
bulletml/expr.py
+++ b/
bulletml/expr.py
@@
-62,3
+62,8
@@
class NumberDef(object):
def __repr__(self):
return "%s(%r)" % (type(self).__name__, self.__original)
def __repr__(self):
return "%s(%r)" % (type(self).__name__, self.__original)
+
+class INumberDef(NumberDef):
+ """A NumberDef, but returns rounded integer results."""
+ def __call__(self, params, rank):
+ return int(round(super(INumberDef, self).__call__(params, rank)))