[CMF-checkins] CVS: CMF/CMFCore - CatalogTool.py:1.33

Florent Guillaume fg@nuxeo.com
Wed, 31 Jul 2002 16:14:21 +0200


In article <200207311333.g6VDX3S11272@cvs.baymountain.com> you write:
> Log Message:
> Avoided mutable default arguments.  (They are a source of potential bugs.)
> 
> 
> === CMF/CMFCore/CatalogTool.py 1.32 => 1.33 ===
>  
>      manage_catalogFind = DTMLFile( 'catalogFind', _dtmldir )
>  
> -    def catalog_object(self, object, uid, idxs=[]):
> +    def catalog_object(self, object, uid, idxs=()):
>          # Wraps the object with workflow and accessibility
>          # information just before cataloging.
>          wf = getattr(self, 'portal_workflow', None)

The problem with your changes is that we depend on the value []: Deep
inside ZCatalog.Catalog.Catalog we have this code:

        if idxs==[]: use_indexes = self.indexes.keys()
        else:        use_indexes = idxs

So please revert.


Florent


-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com