comparison mercurial/cmdutil.py @ 51302: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 b8f9911c8dca
children f15cb5111a1e
comparison
equal deleted inserted replaced
51301:58d39c7865e5 51302:9d3721552b6c
16 Any, 16 Any,
17 AnyStr, 17 AnyStr,
18 Dict, 18 Dict,
19 Iterable, 19 Iterable,
20 Optional, 20 Optional,
21 TYPE_CHECKING,
21 cast, 22 cast,
22 ) 23 )
23 24
24 from .i18n import _ 25 from .i18n import _
25 from .node import ( 26 from .node import (
69 70
70 from .revlogutils import ( 71 from .revlogutils import (
71 constants as revlog_constants, 72 constants as revlog_constants,
72 ) 73 )
73 74
74 if pycompat.TYPE_CHECKING: 75 if TYPE_CHECKING:
75 from . import ( 76 from . import (
76 ui as uimod, 77 ui as uimod,
77 ) 78 )
78 79
79 stringio = util.stringio 80 stringio = util.stringio