Method: pylint.utils.utils._splitstrip
Calls: 5669, Exceptions: 0, Paths: 1Back
Path 1: 5669 calls (1.0)
'' (4021) '\nsuppressed-message,\nlocally-disabled,\nuseless-suppression,' (682) 'pylint.extensions.docparams' (76) 'all' (60) '\npylint.extensions.ch...
',' (5669)
[] (4021) ['suppressed-message', 'locally-disabled', 'useless-suppression'] (682) ['pylint.extensions.docparams'] (80) ['all'] (64) ['pylint.extension...
1def _splitstrip(string: str, sep: str = ",") -> list[str]:
2 """Return a list of stripped string by splitting the string given as
3 argument on `sep` (',' by default), empty strings are discarded.
4
5 >>> _splitstrip('a, b, c , 4,,')
6 ['a', 'b', 'c', '4']
7 >>> _splitstrip('a')
8 ['a']
9 >>> _splitstrip('a,\nb,\nc,')
10 ['a', 'b', 'c']
11
12 :type string: str or unicode
13 :param string: a csv line
14
15 :type sep: str or unicode
16 :param sep: field separator, default to the comma (',')
17
18 :rtype: str or unicode
19 :return: the unquoted string (or the input string if it wasn't quoted)
20 """
21 return [word.strip() for word in string.split(sep) if word.strip()]