from bulletml.errors import Error
+__all__ = ["ExprError", "NumberDef", "INumberDef"]
+
class ExprError(Error):
"""Raised when an invalid expression is evaluated/compiled."""
pass
"""BulletML numeric expression.
This translates BulletML numeric expressions into Python expressions.
- The
Examples:
35
self._value = int(round(self._value))
def __call__(self, params, rank):
+ # Avoid int(round(__call__())) overhead for constants.
if self._value is not None:
return self._value
return int(round(super(INumberDef, self).__call__(params, rank)))