Fix type errors in arithmetic expressions; add safety checks.
- Adds checks for Scalar and ScalarHistory type addition, so that it raises an error when adding unsupported types (instead of silently creating an invalid ScalarHistory that then leads to an error downstream)
- Fixes "Scalar + ScalarHistory" expressions to create valid ScalarHistory outputs
- Removes the __iadd__ overload for Scalar, since it can be triggered even via in-place operations on local variables. Without __iadd__, Python will automatically treat it as an add and an assignment. (See https://docs.python.org/3/reference/datamodel.html#object.__iadd__)
- Adds support for assigning integers to tables.
Fixes #38
合并状态:已合并 合并于 2024-09-01 关闭于 2024-09-01 1 条评论