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
Hi Dmitriy!
Unfortunately, the following example fails for me.
import fast_json from collections import namedtuple MyType = namedtuple("MyType", ["name", "value"]) @fast_json.convert.register(MyType) def _(value): return "name={0.name} value={0.value}".format(value) print( fast_json.dumps({ "one": MyType(name="foo", value="bar") }) )
outputs {"one": ["foo", "bar"]}
{"one": ["foo", "bar"]}
This might be due to new code in json for Python 3.8 https://github.com/python/cpython/blob/3.8/Lib/json/encoder.py
json
You might want to update python_requires='<=3.7 in setup.py, or adapt to new code.
python_requires='<=3.7
setup.py
The problem in new json realization might be that default method gets invoked only if general parsing failed (but it doesn't fail for namedtuples).
default
Thank you!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi Dmitriy!
Unfortunately, the following example fails for me.
outputs
{"one": ["foo", "bar"]}
This might be due to new code in
json
for Python 3.8 https://github.com/python/cpython/blob/3.8/Lib/json/encoder.pyYou might want to update
python_requires='<=3.7
insetup.py
, or adapt to new code.The problem in new
json
realization might be thatdefault
method gets invoked only if general parsing failed (but it doesn't fail for namedtuples).Thank you!
The text was updated successfully, but these errors were encountered: