Browse Source

Removed redundant update method for adding key-value pair in dict.

It is simpler to do it directly rather than via update method. This also eliminates the overhead of constructing another dictionary and calling a method, so should slightly improve performance. [ Read at Sourcery]
pull/5852/head
Kushal Subedi 2 years ago
committed by GitHub
parent
commit
9b5b853f63
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      docs_src/body_multiple_params/tutorial001.py

4
docs_src/body_multiple_params/tutorial001.py

@ -22,7 +22,7 @@ async def update_item(
):
results = {"item_id": item_id}
if q:
results.update({"q": q})
results.["q"]= q
if item:
results.update({"item": item})
results["item"]=item
return results

Loading…
Cancel
Save