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
Tagged types using cbor.TagMapper() can not be nested:
cbor.TagMapper()
#!/usr/bin/env python3 import cbor from collections import namedtuple test = namedtuple('test', 'x y') cbor_test = cbor.ClassTag(15309737, test, tuple, lambda x: test(*x)) cbor_set = cbor.ClassTag(15309738, set, tuple, lambda x: set(x)) mapper = cbor.TagMapper(class_tags=(cbor_test, cbor_set), raise_on_unknown_tag=True) x = {7:test(1,{1,2,3})} y = mapper.loads(mapper.dumps(x)) print(y == x) Traceback (most recent call last): File "./z.py", line 13, in <module> y = mapper.loads(mapper.dumps(x)) File "/usr/local/lib/python3.6/site-packages/cbor/tagmap.py", line 99, in dumps return dumps(self.encode(obj)) ValueError: cannot serialize unknown object: {1, 2, 3}
The text was updated successfully, but these errors were encountered:
I have a patch for this. Should I do a pull request here or in BitBucket?
Sorry, something went wrong.
No branches or pull requests
Tagged types using
cbor.TagMapper()
can not be nested:The text was updated successfully, but these errors were encountered: