[Checkins] SVN: z3c.pt/trunk/src/z3c/pt/clauses.py This variant is substantially faster.

Malthe Borch mborch at gmail.com
Wed Sep 10 16:27:10 EDT 2008


Log message for revision 91044:
  This variant is substantially faster.

Changed:
  U   z3c.pt/trunk/src/z3c/pt/clauses.py

-=-
Modified: z3c.pt/trunk/src/z3c/pt/clauses.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/clauses.py	2008-09-10 20:23:56 UTC (rev 91043)
+++ z3c.pt/trunk/src/z3c/pt/clauses.py	2008-09-10 20:27:09 UTC (rev 91044)
@@ -540,8 +540,8 @@
             assign = Assign(value)
             assign.begin(stream, temp)
 
-            # only include attribute if expression is not None
-            stream.write("if %s not in (False, None):" % temp)
+            # only include attribute if expression is not ``None`` or ``False``
+            stream.write("if %s is not None and %s is not False:" % (temp, temp))
             stream.indent()
 
             # if an encoding is specified, we need to check



More information about the Checkins mailing list