comparison mercurial/logcmdutil.py @ 51725:278af66e6595

typing: induce pytype to use the standard `attr` instead of the vendored copy What was previously happening with the vendored copy was that pytype would stub out all(?) classes that were decorated with `@attr.s` as `Any`. After this, we get a ton of classes defined, and numerous fields and methods now have proper types.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 23 Jul 2024 19:20:22 -0400
parents f4a0806081f2
children 460e80488cf0
comparison
equal deleted inserted replaced
51724:2e9e62242451 51725:278af66e6595
7 7
8 8
9 import itertools 9 import itertools
10 import os 10 import os
11 import posixpath 11 import posixpath
12 import typing
12 13
13 from typing import ( 14 from typing import (
14 Any, 15 Any,
15 Callable, 16 Callable,
16 Dict, 17 Dict,
21 22
22 from .i18n import _ 23 from .i18n import _
23 from .node import wdirrev 24 from .node import wdirrev
24 25
25 from .thirdparty import attr 26 from .thirdparty import attr
27
28 # Force pytype to use the non-vendored package
29 if typing.TYPE_CHECKING:
30 # noinspection PyPackageRequirements
31 import attr
26 32
27 from . import ( 33 from . import (
28 dagop, 34 dagop,
29 diffutil, 35 diffutil,
30 error, 36 error,