Skip to content

Commit 48d6d62

Browse files
authored
Merge pull request #925 from mgxd/enh/listify-int
FIX: Listify numbers
2 parents 8ba2914 + 664a860 commit 48d6d62

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

niworkflows/utils/connections.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def listify(value):
6767
[0.1, 0.2]
6868
>>> listify(None) is None
6969
True
70+
>>> listify(1)
71+
[1]
7072
7173
"""
7274
from pathlib import Path
@@ -77,4 +79,6 @@ def listify(value):
7779
return value
7880
if isinstance(value, (str, bytes, Path)):
7981
return [str(value)]
82+
if isinstance(value, (int, float)):
83+
return [value]
8084
return list(value)

0 commit comments

Comments
 (0)