Closed bobpaul closed 7 years ago
It looks like this was caused by the fixing of issue 10 on the old Google Code project, released as pyp-beta (pyp 2.11 is the latest version in pypi, which is what I was using). You must have based this repo on the beta code?
I believe issue 10 was fixed incorrectly. The option --ignore_blanks
is defined as "remove blank lines from output". But it's implemented as "remove blank lines from input". This means that if you have non-blank lines in your input which result in a blank line of output, you get a blank line in your output. It also means you can't use --ignore_blanks
with --blank_inputs n
.
--ignore_blanks
should be changed such that it's a filter on the output. I'll try to find the original commit(s) that implemented this so they can be reverted and this can be re-implemented as documented. doesn't look like they developed in the open; just pushed when changes were ready.
Also.... maybe someone should go through the examples in the manual and see how this affects them. I wouldn't be surprised if some of the examples broken by this change in default behavior.
After reviewing the output of pyp -h
a bit more I think my proposal above was wrong.
--ignore_blanks
documentation should say it removes blank lines from input.
p.re()
(sp.re, fp.re...) should return False for blank lines, just like filters do. If a user wants the blanks, they can use the --keep_false
option. This also remains consistent with older versions of pyp.
In the original pyp, unmatched lines are removed. Ex:
But in pyp3, all the unmatched lines appear.