This removes some obfuscation as far as pytype is concerned and
corrects many bogus type errors.
Details
Details
- Reviewers
indygreg - Group Reviewers
hg-reviewers - Commits
- rHG5f2a8dabb0d8: encoding: define local identify functions with explicit type comments
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
- a/mercurial/encoding.py
+++ b/mercurial/encoding.py
@@ -241,8 +241,15 @@strfromlocal = unifromlocal strmethod = unimethodelse:
- strtolocal = pycompat.identity
- strfromlocal = pycompat.identity
+
+ def strtolocal(s):
+ # type: (str) -> bytes
+ return s
+
+ def strfromlocal(s):
+ # type: (bytes) -> str
+ return s
It disables the fast path f is identity in pycompat.rapply. I don't
think that matters, but I just noted.