add list.tolist which converts obj to list

This commit is contained in:
Prodesire 2018-01-16 01:02:47 +08:00
parent e9cfa5101c
commit 3c054aff73
1 changed files with 6 additions and 0 deletions

View File

@ -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