mirror of
https://github.com/searxng/searxng.git
synced 2024-11-22 20:17:45 +01:00
[mod] searx.utils.dict_subset: rewrite with comprehension
This commit is contained in:
parent
3b0f70ed0f
commit
697ebeddcc
@ -262,11 +262,7 @@ def dict_subset(d, properties):
|
|||||||
>>> >> dict_subset({'A': 'a', 'B': 'b', 'C': 'c'}, ['A', 'D'])
|
>>> >> dict_subset({'A': 'a', 'B': 'b', 'C': 'c'}, ['A', 'D'])
|
||||||
{'A': 'a'}
|
{'A': 'a'}
|
||||||
"""
|
"""
|
||||||
result = {}
|
return {k: d[k] for k in properties if k in d}
|
||||||
for k in properties:
|
|
||||||
if k in d:
|
|
||||||
result[k] = d[k]
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
def get_torrent_size(filesize, filesize_multiplier):
|
def get_torrent_size(filesize, filesize_multiplier):
|
||||||
|
Loading…
Reference in New Issue
Block a user