From 1cb13cd75fdec6c29f79985b71f8c119c7364584 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Mon, 1 Oct 2007 08:10:05 +0000
Subject: [PATCH] use "in {}" instead of "{}.has_key" and remove some commented
 out LOGs

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16736 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Base.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index 7fcbe8fe7d..2709f13aea 100644
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -393,7 +393,7 @@ def initializePortalTypeDynamicProperties(self, klass, ptype):
 
   id = ''
   #LOG('before aq_portal_type %s' % id, 0, str(ptype))
-  if not Base.aq_portal_type.has_key(ptype):
+  if ptype not in Base.aq_portal_type:
     # Mark as generated
     #prop_holder = Base.aq_portal_type[ptype] = PropertyHolder()
     prop_holder = PropertyHolder()
@@ -744,14 +744,10 @@ class Base( CopyContainer,
     # and per class. Other uses are possible (ex. WebSection).
     ptype = self.portal_type
 
-    #LOG('_aq_dynamic', 0, 'self = %r, id = %r, ptype = %r' % (self, id, ptype))
-    #LOG("In _aq_dynamic", 0, str((id, ptype, self)))
-
     # If this is a portal_type property and everything is already defined
     # for that portal_type, try to return a value ASAP
-    if Base.aq_portal_type.has_key(ptype):
+    if ptype in Base.aq_portal_type:
       accessor = getattr(Base.aq_portal_type[ptype], id, None)
-      #LOG('_aq_dynamic', 0, 'self = %r, id = %r, accessor = %r' % (self, id, accessor))
       if accessor is not None:
         # Clearly this below has a bad effect in CMFCategory.
         # Someone must investigate why. -yo
-- 
2.30.9