#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 | 05ae6c01d83821d60b76bf5a1aa7b2bca745ad71
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
1) The script can be done with only one call to sed and is much faster
that way (took less than 10 secs on my computer)
{{{
#!/usr/bin/env bash
for f in $(find . -name "*py");
do
echo "processing $f"
sed -i -e's/\ *==\ *None$/ is None/g' \
-e's/\ *==\ *None\([ :)]\)/ is None\1/g' \
-e's/\ *!=\ *None$/ is not None/g' \
-e's/\ *!=\ *None\([ :)]\)/ is not None\1/g' $f
done
}}}
2) There are few things to fix by hand. For example, some occurrences
appear in the docstrings and the script did bad to them
(src/sage/ext/gen_interpreters.py, src/sage/geometry/polyhedron/misc.py,
...)
For Wilfried:
3) It is not a good idea to provide a git branch (it will certainly create
plenty of conflicts). The best would be to apply the script just before
the stable release.
4) If you used a script different from mine, it would be nice that you
provide it!
--
Ticket URL: <http://trac.sagemath.org/ticket/16216#comment:11>
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.