App: use Python number protocol in Expression
This adds support to do mul/div with matrix and vector, as well as Python formated string with operator %.
This commit is contained in:
@@ -705,7 +705,7 @@ void Sheet::updateProperty(CellAddress key)
|
||||
Base::PyGILStateLocker lock;
|
||||
auto py_expr = freecad_dynamic_cast<PyObjectExpression>(output.get());
|
||||
if(py_expr)
|
||||
setObjectProperty(key, py_expr->getPyObject());
|
||||
setObjectProperty(key, py_expr->getPyValue());
|
||||
else
|
||||
setObjectProperty(key, Py::Object());
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ class SpreadsheetCases(unittest.TestCase):
|
||||
self.assertEqual(sheet.H2, u'ERR: Quantity::operator <(): quantities need to have same unit to compare')
|
||||
self.assertEqual(sheet.H3, u'ERR: Quantity::operator >(): quantities need to have same unit to compare')
|
||||
self.assertEqual(sheet.H4, 4)
|
||||
self.assertEqual(sheet.H5, u'ERR: Quantity::operator +(): Unit mismatch in minus operation')
|
||||
self.assertEqual(sheet.H5, u'ERR: Quantity::operator -(): Unit mismatch in minus operation')
|
||||
self.assertEqual(sheet.H6, u'ERR: Quantity::operator +=(): Unit mismatch in plus operation')
|
||||
|
||||
def assertMostlyEqual(self, a, b):
|
||||
|
||||
Reference in New Issue
Block a user