Mercurial > public > mercurial-scm > hg
comparison mercurial/util.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 | ed28085827ec |
children | 92845af308b4 |
comparison
equal
deleted
inserted
replaced
51724:2e9e62242451 | 51725:278af66e6595 |
---|---|
46 Tuple, | 46 Tuple, |
47 ) | 47 ) |
48 | 48 |
49 from .node import hex | 49 from .node import hex |
50 from .thirdparty import attr | 50 from .thirdparty import attr |
51 | |
52 # Force pytype to use the non-vendored package | |
53 if typing.TYPE_CHECKING: | |
54 # noinspection PyPackageRequirements | |
55 import attr | |
56 | |
51 from .pycompat import ( | 57 from .pycompat import ( |
52 open, | 58 open, |
53 ) | 59 ) |
54 from hgdemandimport import tracing | 60 from hgdemandimport import tracing |
55 from . import ( | 61 from . import ( |