• Ayush Tiwari's avatar
    erp5_catalog: Update the Filter and FilterDict class removing the useless methods · 91fcd576
    Ayush Tiwari authored
    More comments about dict-like objects in Python:
    - do not use .keys() whenever you don't need a list copy of keys
    - do not implement a has_key method that would only be an alias of __contains__ (btw, there's still a lot of uses on dict.has_key in ERP5 and they should be replaced by in)
    - do not implement a get method that calls __getitem__ unless it is used often; if performance is important, you may consider to duplicate the code of __getitem__
    - similarly, we could remove the keymethod: the caller could still cast to list
    
    /suggested by @jm
    91fcd576
ERP5Catalog.py 17.4 KB