#16216: Improve PEP8 compliance: replace "== None" by "is None"
-------------------------------------+-------------------------------------
Reporter: wluebbe | Owner:
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-6.2
Component: build | Resolution:
Keywords: pep8 | Merged in:
Authors: Wilfried Luebbe | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/wluebbe/ticket/16216 | 1219d56b731119122356714ed4d26ae33c63cd5d
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by leif):
Replying to [comment:17 vdelecroix]:
> Instead of the for loop, it is faster and cleaner to use xargs. The
following one-line command takes care of py and pyx files.
> {{{
> find -regex ".*pyx?" | xargs sed -i \
> -e's/\s\?==\s*None\b/ is None/g' \
> -e's/\s\?!=\s*None\b/ is not None/g'
> }}}
`-regex` is not portable; one should use `-name \*.py -o -name \*.pyx`
[`-o -name \*.rst`] instead. (And you can also use `sed ... $(find ...)`,
or -- preferably -- `find ... -exec sed ...`, because the latter reduces
the required size of the environment, i.e. `argv`.)
`sed -i ...` is (unfortunately) also not portable, nor is `\s`, and IIRC
neither `\b` nor `\?`.
[[BR]]
> PS: sed is not Unix but [[http://www.gnu.org/|GNU]]!
`sed` is UNIX from the very beginning, while '''G'''NU's '''N'''ot
'''U'''nix! ;-)
--
Ticket URL: <http://trac.sagemath.org/ticket/16216#comment:20>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.