On Sat, Jan 26, 2019 at 02:04:12PM +0100, Thomas Güttler Lists wrote:
> Example:
>
> status = backend.transmit_data()
>
> But later you want to add something to the API.
[...]
> How could kwargs for return look like?
return {'status': True, 'messages': []}
Or perhaps better:
return ResultObject(status=True, messages=[])
I don't see anything here that can't be done by returning a dict, a
namedtuple (possibly with optional fields), or some other object with
named fields. They can be optional, they can have defaults, and you can
extend the object by adding new fields without breaking backwards
compatibility.
--
Steve
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/