suggestion: json.dump() does not support default keyword argument
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
collections.deque constructor does not take keyword arguments
I would like to construct a deque as follows collections.deque(maxlen=10). For this to work, iterables must have a default. The default should be an empty tuple or None, see: https://docs.python.org/3/library/collections.html#collections.deque
maxlen should also support keyword arguments but would not require a default, i.e not optional, since I don't need arbitrarily (unbounded) length deques.