diff options
author | Eugene Eeo <xe0jun@hotmail.com> | 2014-12-13 15:21:21 +0800 |
---|---|---|
committer | Eugene Eeo <xe0jun@hotmail.com> | 2014-12-13 15:21:21 +0800 |
commit | 835e9b5d276cd7cf6fdc399a820ef210d805b0bd (patch) | |
tree | dc3356dc4487b94b89dba4e9f9a8145ffb937578 /uritemplate/template.py | |
parent | fbd9790a82b4391dea93e778be091870375762c8 (diff) | |
download | uritemplates-835e9b5d276cd7cf6fdc399a820ef210d805b0bd.tar.gz |
minor refactor of code
Diffstat (limited to 'uritemplate/template.py')
-rw-r--r-- | uritemplate/template.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/uritemplate/template.py b/uritemplate/template.py index 239c1b6..0d45214 100644 --- a/uritemplate/template.py +++ b/uritemplate/template.py @@ -121,10 +121,9 @@ class URITemplate(object): ``val2`` will be used instead of ``val1``. """ - var_dict = var_dict or {} - var_dict.update(kwargs) + kwargs.update(var_dict or {}) - return self._expand(var_dict, False) + return self._expand(kwargs, False) def partial(self, var_dict=None, **kwargs): """Partially expand the template with the given parameters. @@ -142,7 +141,6 @@ class URITemplate(object): t.partial() # => URITemplate('https://api.github.com{/end}') """ - var_dict = var_dict or {} - var_dict.update(kwargs) + kwargs.update(var_dict or {}) - return URITemplate(self._expand(var_dict, True)) + return URITemplate(self._expand(kwargs, True)) |