Skip to content
Snippets Groups Projects
Commit 3f0326ef authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

utils: fix a wrong type

parent 01bedbdb
No related branches found
No related tags found
2 merge requests!45Cleanups,!40clone git too
# Useful common code
import re
from typing import List
......@@ -3,6 +4,6 @@
def escape_string(s: str, chars: str, escape: chr = "\\") -> str:
def escape_string(s: str, chars: str, escape: str = "\\") -> str:
"""Escape all unescaped characters in `chars` with `escape`"""
for delim in chars:
delim = re.escape(delim)
......@@ -10,7 +11,7 @@
return s
def split_unescape(s: str, delim: chr, escape: chr = "\\") -> str:
def split_unescape(s: str, delim: str, escape: str = "\\") -> List[str]:
"""Split a string along `delim`, only if not escaped by `escape`
>>> split_unescape('foo,bar', ',')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment