| Age | Commit message (Collapse) | Author |
|
Makes the prefix used in .config files configurable.
Also add pip installation note to README.
|
|
Saves a few source lines as well as bytes of bytecode.
|
|
Saves a source line as well as some bytecode.
Tuple evaluation is guaranteed to be from left to right:
https://docs.python.org/2/reference/expressions.html#evaluation-order
|
|
|
|
Saves a few source lines as well as bytes of bytecode.
|
|
|
|
Ifs do not have an object representation, so 'parent' can never be an
if.
|
|
|
|
Mostly to get coverage for _FileFeed.peek_next(), which is only used
while reading the header. The tested behavior probably doesn't make much
sense for .config files and stems from _FileFeed reuse. It's fairly
obscure at least.
|
|
|
|
Typo - 'res' should be 'line'.
Only affected .config header reading.
|
|
|
|
|
|
This is what the C implementation does, and it simplifies the code a
bit.
|
|
|
|
|
|
Don't bother with the accessors internally as they're unlikely to do
anything but return a variable. Direct access shaves a percent or two
off parsing.
|
|
print -> print().
Skip 'from __future__ import print_function' by only having a single
argument (to avoid interpretation as tuples in Python 2). Keeps the
examples simple.
|
|
Was returning a dict_values.
|
|
|
|
Consistent with other internal names and avoids the collision with the
function in a neater way.
|
|
- Inline _add_dependent_ignore_siblings().
- Copy the original 'dep' set and add the recursive dependencies to it
instead of creating an initially empty set.
No discernible performance improvement, but bit neater.
|
|
Make somewhat consistent with the other classes.
|
|
Make somewhat consistent with the other classes.
|
|
Put getters together and make consistent with Symbol.
|
|
Put getters together.
|
|
Split into logical sections and put more related methods closer to one
another.
|
|
The old note no longer seems to apply. Going through the defconfig part
of the test suite without verification in PyPy drops from ~5:50 to
~5:30, and line_prof shows some improvement for CPython too.
Passing the 'write' method around instead was a bit slower.
|
|
|
|
Cleaner to just check for more tokens in the few spots that used it.
Seems slightly faster too, though it might be in the noise.
|
|
The most common case by far (> 85% for both && and || with the x86
Kconfigs) is a single operand (i.e., no && or ||). Sticking it in a list
and then immediately throwing the list away is wasteful.
Makes _parse_expr() at least 10% faster during testing.
|
|
|
|
Matches their function.
|
|
Instantiating that nested function with free variables turned out to be
quite expensive in cProfile.
For the _build_dep() case, it would be even neater to have a function
like _add_sym_deps(sym, expr) that adds 'sym' to each 'deps' set in
'expr', removing the need for a temporary set. Unfortunately,
_get_expr_syms() is used elsewhere too, and it's probably not worthwhile
having another very similar function just as a small optimization.
|
|
Redundant, plus we get more coverage for the default state.
|
|
Bit friendlier.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Simpler.
|
|
|
|
|
|
Speeds _Feed creation up a bit during tokenization. Keep public classes
slotless for flexibility.
|
|
Optimization. Saves an 'if None' check for each 'help'.
|
|
Small optimization. No need to fetch it for 'help' tokens, which return
early.
|
|
The regexes handle most stripping of trailing space now too.
|
|
|