X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/d5c95f6a8f274f42cce81bfe544266a7bb53474b..47480ca33143b250cb33ba501f201838269173ce:/.vim/bundle/black/src/blib2to3/pgen2/literals.py diff --git a/.vim/bundle/black/src/blib2to3/pgen2/literals.py b/.vim/bundle/black/src/blib2to3/pgen2/literals.py index b5fe4285..53c0b8ac 100644 --- a/.vim/bundle/black/src/blib2to3/pgen2/literals.py +++ b/.vim/bundle/black/src/blib2to3/pgen2/literals.py @@ -4,11 +4,9 @@ """Safely evaluate Python string literals without using eval().""" import re +from typing import Dict, Match -from typing import Dict, Match, Text - - -simple_escapes: Dict[Text, Text] = { +simple_escapes: Dict[str, str] = { "a": "\a", "b": "\b", "f": "\f", @@ -22,7 +20,7 @@ simple_escapes: Dict[Text, Text] = { } -def escape(m: Match[Text]) -> Text: +def escape(m: Match[str]) -> str: all, tail = m.group(0, 1) assert all.startswith("\\") esc = simple_escapes.get(tail) @@ -44,7 +42,7 @@ def escape(m: Match[Text]) -> Text: return chr(i) -def evalString(s: Text) -> Text: +def evalString(s: str) -> str: assert s.startswith("'") or s.startswith('"'), repr(s[:1]) q = s[0] if s[:3] == q * 3: