Mercurial > hg
comparison mercurial/linelog.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 | a65c2dddbf5d |
children | f4733654f144 |
comparison
equal
deleted
inserted
replaced
51728:2e9e62242451 | 51729:278af66e6595 |
---|---|
26 from typing import ( | 26 from typing import ( |
27 List, | 27 List, |
28 ) | 28 ) |
29 | 29 |
30 from .thirdparty import attr | 30 from .thirdparty import attr |
31 | |
32 # Force pytype to use the non-vendored package | |
33 if typing.TYPE_CHECKING: | |
34 # noinspection PyPackageRequirements | |
35 import attr | |
36 | |
31 from . import pycompat | 37 from . import pycompat |
32 | 38 |
33 _llentry = struct.Struct(b'>II') | 39 _llentry = struct.Struct(b'>II') |
34 | 40 |
35 | 41 |