Mercurial > public > mercurial-scm > hg
comparison mercurial/revlogutils/deltas.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 | f4733654f144 |
comparison
equal
deleted
inserted
replaced
51724:2e9e62242451 | 51725:278af66e6595 |
---|---|
9 | 9 |
10 | 10 |
11 import abc | 11 import abc |
12 import collections | 12 import collections |
13 import struct | 13 import struct |
14 import typing | |
14 | 15 |
15 # import stuff from node for others to import from revlog | 16 # import stuff from node for others to import from revlog |
16 from ..node import nullrev | 17 from ..node import nullrev |
17 from ..i18n import _ | 18 from ..i18n import _ |
18 | 19 |
28 REVIDX_ISCENSORED, | 29 REVIDX_ISCENSORED, |
29 REVIDX_RAWTEXT_CHANGING_FLAGS, | 30 REVIDX_RAWTEXT_CHANGING_FLAGS, |
30 ) | 31 ) |
31 | 32 |
32 from ..thirdparty import attr | 33 from ..thirdparty import attr |
34 | |
35 # Force pytype to use the non-vendored package | |
36 if typing.TYPE_CHECKING: | |
37 # noinspection PyPackageRequirements | |
38 import attr | |
33 | 39 |
34 from .. import ( | 40 from .. import ( |
35 error, | 41 error, |
36 mdiff, | 42 mdiff, |
37 util, | 43 util, |