D7267: encoding: define local identify functions with explicit type comments

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Nov 7 03:31:59 EST 2019


Closed by commit rHG5f2a8dabb0d8: encoding: define local identify functions with explicit type comments (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7267?vs=17637&id=17684

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7267/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7267

AFFECTED FILES
  mercurial/encoding.py

CHANGE DETAILS

diff --git a/mercurial/encoding.py b/mercurial/encoding.py
--- a/mercurial/encoding.py
+++ b/mercurial/encoding.py
@@ -241,8 +241,15 @@
     strfromlocal = unifromlocal
     strmethod = unimethod
 else:
-    strtolocal = pycompat.identity
-    strfromlocal = pycompat.identity
+
+    def strtolocal(s):
+        # type: (str) -> bytes
+        return s
+
+    def strfromlocal(s):
+        # type: (bytes) -> str
+        return s
+
     strmethod = pycompat.identity
 
 if not _nativeenviron:



To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel


More information about the Mercurial-devel mailing list