We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
range
Hi! I'm trying to fix an issue where ruamel (strangely) can't serialize range objects which are part of the MiniZinc model's output:
ruamel
|| def represent_undefined(self, data: Any) -> None: || > raise RepresenterError(f'cannot represent an object: {data!s}') || E ruamel.yaml.representer.RepresenterError: cannot represent an object: range(1, 5)
I don't know why a python range is not a default registered class for ruamel, but adding yaml.register_class(range) also doesn't work:
yaml.register_class(range)
|| self = <ruamel.yaml.representer.SafeRepresenter object at 0x7f529a523ee0> || tag = '!range', data = range(1, 5), cls = <class 'range'>, flow_style = None || || def represent_yaml_object( || self, tag: Any, data: Any, cls: Any, flow_style: Any = None || ) -> MappingNode: || if hasattr(data, '__getstate__'): || state = data.__getstate__() || else: || > state = data.__dict__.copy() || E AttributeError: 'range' object has no attribute '__dict__'. Did you mean: '__dir__'?
Any ideas on how to fix it so ranges are serialized normally?
The text was updated successfully, but these errors were encountered:
Should be fixed by MiniZinc/minizinc-python#90
Sorry, something went wrong.
No branches or pull requests
Hi! I'm trying to fix an issue where
ruamel
(strangely) can't serialize range objects which are part of the MiniZinc model's output:I don't know why a python range is not a default registered class for ruamel, but adding
yaml.register_class(range)
also doesn't work:Any ideas on how to fix it so ranges are serialized normally?
The text was updated successfully, but these errors were encountered: