util: rename "dict" arg
dict is a built-in Python type. Don't use it as a variable name.
This commit is contained in:
parent
de15f887b9
commit
ff93556f3e
1 changed files with 5 additions and 5 deletions
10
koji/util.py
10
koji/util.py
|
|
@ -190,19 +190,19 @@ def multi_fnmatch(s, patterns):
|
|||
return False
|
||||
|
||||
|
||||
def dslice(dict, keys, strict=True):
|
||||
def dslice(dict_, keys, strict=True):
|
||||
"""Returns a new dictionary containing only the specified keys"""
|
||||
ret = {}
|
||||
for key in keys:
|
||||
if strict or key in dict:
|
||||
if strict or key in dict_:
|
||||
#for strict we skip the has_key check and let the dict generate the KeyError
|
||||
ret[key] = dict[key]
|
||||
ret[key] = dict_[key]
|
||||
return ret
|
||||
|
||||
|
||||
def dslice_ex(dict, keys, strict=True):
|
||||
def dslice_ex(dict_, keys, strict=True):
|
||||
"""Returns a new dictionary with only the specified keys removed"""
|
||||
ret = dict.copy()
|
||||
ret = dict_.copy()
|
||||
for key in keys:
|
||||
if strict or key in ret:
|
||||
del ret[key]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue