aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/primitives/range.py
AgeCommit message (Collapse)AuthorFilesLines
2025-06-17interpreter: make operators per-classPaolo Bonzini1-4/+3
Do not call update() and Enum.__hash__ a gazillion times; operators are the same for every instance of the class. In order to access the class for non-trivial operators, the operators are first marked using a decorator, and then OPERATORS is built via __init_subclass__. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-17interpreter: make operator functions binaryPaolo Bonzini1-1/+1
In preparation for moving them to the class, make the operator functions binary. Adjust the lambdas for trivial operators, and store unbound methods for non-trivial ones. Note that this requires adding operators manually for every override, even subclasses. It's decidedly ugly at this temporary stage; later it will result in just an extra @InterpreterObject.operator decorator on the subclasses. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker1-1/+1
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-02-01treewide: add future annotations importEli Schwartz1-0/+1
2022-02-16flake8: do not use bare exceptionsEli Schwartz1-1/+1
In one case, we actually specifically want to catch IndexError only. In the other case, excepting Exception rather than BaseException is quite fine.
2022-02-14FeatureNew: add mypy type annotations for subproject argEli Schwartz1-1/+4
Use a derived type when passing `subproject` around, so that mypy knows it's actually a SubProject, not a str. This means that passing anything other than a handle to the interpreter state's subproject attribute becomes a type violation, specifically when the order of the *four* different str arguments is typoed.
2021-10-06interpreter: Move RangeHolder out of interpreterbase to interpreterDaniel Mensinger1-0/+34