mirror of https://github.com/flaggo/pydu.git
add list.tolist which converts obj to list
This commit is contained in:
parent
e9cfa5101c
commit
3c054aff73
|
@ -15,3 +15,9 @@ def uniq(seq, key=None):
|
|||
seen.add(uniq_value)
|
||||
uniq_list.append(value)
|
||||
return uniq_list
|
||||
|
||||
|
||||
def tolist(obj):
|
||||
if not isinstance(obj, list):
|
||||
return [obj]
|
||||
return obj
|
||||
|
|
Loading…
Reference in New Issue