typing: constrain argument/return types of encoding.toutf8b()
authorYuya Nishihara <yuya@tcha.org>
Sat, 16 Nov 2019 15:34:47 +0900
changeset 43682 83a349aaeba3
parent 43681 b65fcccd9100
child 43683 7f51bc36194d
typing: constrain argument/return types of encoding.toutf8b()
mercurial/encoding.py
--- a/mercurial/encoding.py	Sat Nov 16 15:27:12 2019 +0900
+++ b/mercurial/encoding.py	Sat Nov 16 15:34:47 2019 +0900
@@ -560,7 +560,7 @@
 
 
 def getutf8char(s, pos):
-    # type: (Any, Any) -> Any
+    # type: (bytes, int) -> bytes
     '''get the next full utf-8 character in the given string, starting at pos
 
     Raises a UnicodeError if the given location does not start a valid
@@ -579,7 +579,7 @@
 
 
 def toutf8b(s):
-    # type: (Any) -> Any
+    # type: (bytes) -> bytes
     '''convert a local, possibly-binary string into UTF-8b
 
     This is intended as a generic method to preserve data when working