Commit Graph

9 Commits

Author SHA1 Message Date
Eli Schwartz 90ce084144
treewide: automatic rewriting of all comment-style type annotations
Performed using https://github.com/ilevkivskyi/com2ann

This has no actual effect on the codebase as type checkers (still)
support both and negligible effect on runtime performance since
__future__ annotations ameliorates that. Technically, the bytecode would
be bigger for non function-local annotations, of which we have many
either way.

So if it doesn't really matter, why do a large-scale refactor? Simple:
because people keep wanting to, but it's getting nickle-and-dimed. If
we're going to do this we might as well do it consistently in one shot,
using tooling that guarantees repeatability and correctness.

Repeat with:

```
com2ann mesonbuild/
```
2023-08-11 13:41:03 -04:00
Eli Schwartz 61d525cc16
refactor a few subsystem-relative imports that imported the wrong location
Inside of mesonbuild.ast.* we can and should import from .foobar, rather
than importing from .__init__'s re-exported version of that object.

Failing to do so results in an extremely brittle codebase where simply
changing the order of lines in __init__.py can result in ImportError.
2023-02-28 15:46:53 -05:00
Eli Schwartz 0703ee0aef
move various unused typing-only imports into type-checking blocks 2022-07-03 14:11:31 -04:00
Daniel Mensinger 3489442848
typing: completely type ast 2020-09-08 20:15:55 +02:00
Daniel Mensinger d67888bf9b
types: Remove redundant __init__() -> None annotation 2020-03-02 10:52:59 +01:00
Daniel Mensinger 0302a697b8
types: Use import typing as T 2020-03-02 10:51:07 +01:00
Daniel Mensinger a75255bc4c
types: Annotate the AST visitors 2020-03-02 10:34:55 +01:00
Daniel Mensinger f9b41d5ecb
mintro: Dependencies from source 2019-03-03 23:19:03 +01:00
Daniel Mensinger 277dc10a5d
AST post processing 2019-01-22 16:09:34 +01:00