Skip to content

Commit 3b3ffaf

Browse files
committed
No dangerous default value
1 parent bd538fa commit 3b3ffaf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

meilisearch/index.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,7 @@ def get_stats(self):
199199
)
200200
)
201201

202-
# pylint: disable=dangerous-default-value
203-
# Not dangerous because opt_params is not modified in the method
204-
# See: https://stackoverflow.com/questions/26320899/why-is-the-empty-dictionary-a-dangerous-default-value-in-python
205-
def search(self, query, opt_params={}):
202+
def search(self, query, opt_params=None):
206203
"""Search in meilisearch
207204
208205
Parameters
@@ -217,6 +214,8 @@ def search(self, query, opt_params={}):
217214
results: `dict`
218215
Dictionnary with hits, offset, limit, processingTime and initial query
219216
"""
217+
if opt_params is None:
218+
opt_params = {}
220219
search_param = {'q': query}
221220
params = {**search_param, **opt_params}
222221
return self.http.get(

0 commit comments

Comments
 (0)