Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
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
|
|
|
|
In one case, we actually specifically want to catch IndexError only. In
the other case, excepting Exception rather than BaseException is quite
fine.
|
|
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.
|
|
|