X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/d90297c77bab6e22831b05ffc099bfc709cc7785..d1aee5f7fa136b1f0a7d8dfc318af81009074070:/.vim/bundle/black/src/blib2to3/pgen2/literals.py?ds=sidebyside diff --git a/.vim/bundle/black/src/blib2to3/pgen2/literals.py b/.vim/bundle/black/src/blib2to3/pgen2/literals.py index b5fe428..53c0b8a 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: