diff --git a/src/pylib/pystring/split/reimporter.nim b/src/pylib/pystring/split/reimporter.nim index 0d6c3c997..bfd565c20 100644 --- a/src/pylib/pystring/split/reimporter.nim +++ b/src/pylib/pystring/split/reimporter.nim @@ -3,7 +3,8 @@ import ../errHandle import ../consts import ../../builtins/list +import ../../noneType -export errHandle, list, consts +export errHandle, list, consts, noneType diff --git a/src/pylib/pystring/split/split.nim b/src/pylib/pystring/split/split.nim index d4dfc3b15..d5c32f3e6 100644 --- a/src/pylib/pystring/split/split.nim +++ b/src/pylib/pystring/split/split.nim @@ -6,7 +6,7 @@ import ./reimporter import ./split_whitespace -iterator split*(a: PyStr, maxsplit = -1): PyStr = +iterator split*(a: PyStr, sep = None, maxsplit = -1): PyStr = ## with unicode whitespaces as sep. ## ## treat runs of whitespaces as one sep (i.e. @@ -28,7 +28,7 @@ iterator split*(a: StringLike, noEmptySep sep for i in splitNoCheck($a, sep, maxsplit): yield i -proc split*(a: StringLike, maxsplit = -1): PyList[PyStr] = +proc split*(a: StringLike, sep = None, maxsplit = -1): PyList[PyStr] = str(a).split_whitespace(maxsplit) # strutils.split func does not use any predicted capacity.