QUERY · ISSUE
suggestion: json.dump() does not support default keyword argument
enhancement
Description
In the standard Python3 JSON library (https://docs.python.org/3/library/json.html), json.dump() or json.dumps() support the default keyword argument which specifies how to serialize non-standard data types.
default (callable | None) – A function that is called for objects that can’t otherwise be serialized. It should return a JSON encodable version of the object or raise a TypeError. If None (the default), TypeError is raised.
Currently, this is not implemented:
>>> json.dumps({}, default=None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: extra keyword arguments given
I think this will be a useful addition. Thanks!
Code Size
No response
Implementation
I hope the MicroPython maintainers or community will implement this feature
Code of Conduct
Yes, I agree
CANDIDATE · ISSUE
`flush` keyword argument for `print()`?
enhancementpy-core
CPython 3.3+ supports a flush keyword argument.
https://docs.python.org/3/library/functions.html#print
$ micropython
MicroPython 4fe0332-dirty on 2021-10-27; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> print(5, flush=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: extra keyword arguments given