Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/request.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 | 9ed281bbf864 |
children | f4733654f144 |
comparison
equal
deleted
inserted
replaced
51724:2e9e62242451 | 51725:278af66e6595 |
---|---|
7 # GNU General Public License version 2 or any later version. | 7 # GNU General Public License version 2 or any later version. |
8 | 8 |
9 | 9 |
10 # import wsgiref.validate | 10 # import wsgiref.validate |
11 | 11 |
12 import typing | |
13 | |
12 from ..thirdparty import attr | 14 from ..thirdparty import attr |
15 | |
16 # Force pytype to use the non-vendored package | |
17 if typing.TYPE_CHECKING: | |
18 # noinspection PyPackageRequirements | |
19 import attr | |
20 | |
13 from .. import ( | 21 from .. import ( |
14 error, | 22 error, |
15 pycompat, | 23 pycompat, |
16 util, | 24 util, |
17 ) | 25 ) |