def as_tuple_or_list(obj):
"""
Make sure that `obj` is a tuple or a list and eventually converts it into a list with a single element
:param obj:
:return: A `tuple` or a `list`
"""
return obj if isinstance(obj, (list, tuple)) else [obj]
评论列表
文章目录