#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             |  166bc6c497e13febf34e7f64cd947d3bd2dc99c3
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Thanks Leif. I will ask Volker directly if he does not answer on sage-
 devel.

 The script was not the good one (because of things like
 "my_variable!=None"), new try
 {{{
 #!/usr/bin/env bash

 for f in $(find . -name "*py");
 do
     echo "processing $f"
     sed -i -e's/\ *==\ *None$/ is None/g' $f
     sed -i -e's/\ *==\ *None\([ :)]\)/ is None\1/g' $f
     sed -i -e's/\ *!=\ *None$/ is not None/g' $f
     sed -i -e's/\ *!=\ *None\([ :)]\)/ is not None\1/g' $f
 done
 }}}
 I applied it to Sage source code, and obtain 505 occurrences... and Sage
 even starts after that!!

--
Ticket URL: <http://trac.sagemath.org/ticket/16216#comment:8>
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.

Reply via email to