From abd1a5a27ea40422c5a54817e50c4b623582cb75 Mon Sep 17 00:00:00 2001 From: Mingye Wang Date: Wed, 19 Oct 2016 14:38:47 -0400 Subject: [PATCH] Use dict.update properly; fix #27 Should I write a test too? --- __init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/__init__.py b/__init__.py index 02ff046..c5210da 100644 --- a/__init__.py +++ b/__init__.py @@ -198,17 +198,18 @@ def translate_array(self, texts, to_lang, from_lang=None, **options): State: User state to help correlate request and response. The same contents will be returned in the response. """ - options = { + opts = { 'Category': "general", 'Contenttype': "text/plain", 'Uri': '', 'User': 'default', 'State': '' - }.update(options) + } + opts.update(options) params = { 'texts': json.dumps(texts), 'to': to_lang, - 'options': json.dumps(options), + 'options': json.dumps(opts), } if from_lang is not None: params['from'] = from_lang