comparison mercurial/pathutil.py @ 51285:9d3721552b6c

pytype: import typing directly First we no longer needs the pycompat layer, second having the types imported in all case will allow to use them more directly in type annotation, something important to upgrade the old "type comment" to proper type annotation. A lot a stupid assert are needed to keep pyflakes happy. We should be able to remove most of them once the type comment have been upgraded.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 20 Dec 2023 12:51:20 +0100
parents d718eddf01d9
children f15cb5111a1e
comparison
equal deleted inserted replaced
51284:58d39c7865e5 51285:9d3721552b6c
20 util, 20 util,
21 ) 21 )
22 22
23 rustdirs = policy.importrust('dirstate', 'Dirs') 23 rustdirs = policy.importrust('dirstate', 'Dirs')
24 parsers = policy.importmod('parsers') 24 parsers = policy.importmod('parsers')
25
26 # keeps pyflakes happy
27 assert [
28 Any,
29 Callable,
30 Iterator,
31 Optional,
32 ]
25 33
26 34
27 def _lowerclean(s): 35 def _lowerclean(s):
28 # type: (bytes) -> bytes 36 # type: (bytes) -> bytes
29 return encoding.hfsignoreclean(s.lower()) 37 return encoding.hfsignoreclean(s.lower())