[Erp5-report] r29758 - /erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 16 14:11:29 CEST 2009


Author: nicolas.dumazet
Date: Fri Oct 16 14:11:28 2009
New Revision: 29758

URL: http://svn.erp5.org?rev=29758&view=rev
Log:
improve code readability
- several statements belong to several lines
- use bools over ints
- not(foo in bar) -> foo not in bar
- (if not b: return 0; else: return 1) -> return b

Modified:
    erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py

Modified: erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py?rev=29758&r1=29757&r2=29758&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py [utf8] (original)
+++ erp5/trunk/products/ERP5Banking/tests/TestERP5BankingMixin.py [utf8] Fri Oct 16 14:11:28 2009
@@ -32,11 +32,12 @@
 
 def isSameSet(a, b):
   for i in a:
-    if not(i in b) : return 0
+    if i not in b:
+      return False
   for i in b:
-    if not(i in a): return 0
-  if len(a) != len(b) : return 0
-  return 1
+    if i not in a:
+      return False
+  return len(a) == len(b)
 
 class TestERP5BankingMixin:
   """




More information about the Erp5-report mailing list