You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OpenMath standard requires the OMOBJ tag, and hence, when converting from OpenMath to Python, py-openmath should accept also OpenMath objects with that tag, even if that tag is not generated when converting in the opposite direction.
Implementing the OMOBJ tag is easy, just take the child of the OMOBJ node, and call again converter.to_python applied to it.
>>> converter.to_python( decoder.decode_bytes( b'<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd"><OMI>3</OMI></OMOBJ>', snippet=True ) )
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/dist-packages/openmath/convert.py", line 149, in to_python
raise ValueError('Cannot convert object of class %s to Python.' % omobj.__class__.__name__)
ValueError: Cannot convert object of class OMObject to Python.
>>>
The text was updated successfully, but these errors were encountered:
The OpenMath standard requires the OMOBJ tag, and hence, when converting from OpenMath to Python, py-openmath should accept also OpenMath objects with that tag, even if that tag is not generated when converting in the opposite direction.
Implementing the OMOBJ tag is easy, just take the child of the OMOBJ node, and call again converter.to_python applied to it.
The text was updated successfully, but these errors were encountered: