Python-list Digest, Vol 201, Issue 9
Rhodri James
rhodri at kynesim.co.uk
Tue Jun 9 14:56:36 EDT 2020
On 09/06/2020 18:31, Joseph Jenne via Python-list wrote:
> On 2020-06-09 09:00, zljubisic at gmail.com wrote:
>
>> Well the problem that I am facing with is, that I have to establish
>> interface between python and outer system.
>>
>> Original question was about creation of input object (data that I have
>> received from outer system). If I accept recommendation to use "from_"
>> instead of "from", it could work, for processing input, because
>> processing is under my control.
>>
>> However, my process will create output object that I should json
>> serialize and return back to outer system as a response to the input.
>> If I will have "from_" object property instead of "from", I believe
>> that I should write a custom object to json serializer in order to
>> support changing names from "from_" to "from".
>
> It should be possible to name it from_ and then insert it into the
> __dict__ as 'from', although a custom serializer
> would probably be preferable from a design standpoint.
Might it be simpler to use a dict from the start? You could have a
dictionary key of "from" without any problems.
--
Rhodri James *-* Kynesim Ltd
More information about the Python-list
mailing list