How can I spread an objects/dict(?) properties and into a new object/dict?
Simple Javascript:
const obj = {x: '2', y: '1'}
const thing = {...obj, x: '1'}
// thing = {x: '1', y: 1}
Python:
regions = []
for doc in locations_addresses['documents']:
regions.append(
{
**doc, # this will not work
'lat': '1234',
'lng': '1234',
}
)
return json.dumps({'regions': regions, 'offices': []})