File: aslist.py

package info (click to toggle)
python-schema-salad 2.2.20170111180227-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,168 kB
  • ctags: 213
  • sloc: python: 2,991; makefile: 138
file content (11 lines) | stat: -rw-r--r-- 246 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
import sys
from typing import Any, List


def aslist(l):  # type: (Any) -> List
    """Convenience function to wrap single items and lists, and return lists unchanged."""

    if isinstance(l, list):
        return l
    else:
        return [l]