Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.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 | ca7bde5dbafb |
children | 454feddab720 |
comparison
equal
deleted
inserted
replaced
51724:2e9e62242451 | 51725:278af66e6595 |
---|---|
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 | 8 |
9 import collections | 9 import collections |
10 import struct | 10 import struct |
11 import typing | |
11 | 12 |
12 from .i18n import _ | 13 from .i18n import _ |
13 from .node import nullrev | 14 from .node import nullrev |
14 from .thirdparty import attr | 15 from .thirdparty import attr |
16 | |
17 # Force pytype to use the non-vendored package | |
18 if typing.TYPE_CHECKING: | |
19 # noinspection PyPackageRequirements | |
20 import attr | |
21 | |
15 from .utils import stringutil | 22 from .utils import stringutil |
16 from .dirstateutils import timestamp | 23 from .dirstateutils import timestamp |
17 from . import ( | 24 from . import ( |
18 copies, | 25 copies, |
19 encoding, | 26 encoding, |