Mercurial > hg
comparison mercurial/changelog.py @ 51729: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 | 69c5f8d6c710 |
children | f4733654f144 |
comparison
equal
deleted
inserted
replaced
51728:2e9e62242451 | 51729:278af66e6595 |
---|---|
4 # | 4 # |
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
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 typing | |
10 | |
9 from .i18n import _ | 11 from .i18n import _ |
10 from .node import ( | 12 from .node import ( |
11 bin, | 13 bin, |
12 hex, | 14 hex, |
13 ) | 15 ) |
14 from .thirdparty import attr | 16 from .thirdparty import attr |
17 | |
18 # Force pytype to use the non-vendored package | |
19 if typing.TYPE_CHECKING: | |
20 # noinspection PyPackageRequirements | |
21 import attr | |
15 | 22 |
16 from . import ( | 23 from . import ( |
17 encoding, | 24 encoding, |
18 error, | 25 error, |
19 metadata, | 26 metadata, |