Commit e3e419fe authored by Vincent Pelletier's avatar Vincent Pelletier

Comment weirdness, simplify code, and add a comment about suspicious code.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15784 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1e3f641e
No related merge requests found
...@@ -441,14 +441,15 @@ class ComplexQuery(QueryMixin): ...@@ -441,14 +441,15 @@ class ComplexQuery(QueryMixin):
Used in order to concatenate many queries Used in order to concatenate many queries
""" """
def __init__(self, *args, **kw): def __init__(self, *args, **kw):
# XXX: python weirdness
# >>> def foo(a='a', *args):
# ... pass
# ...
# >>> foo('something', a='test')
# TypeError: foo() got multiple values for keyword argument 'a'
self.query_list = args self.query_list = args
operator = None self.operator = kw.pop('operator', 'AND')
if kw.has_key('operator'): # XXX: What is that used for ?! It's utterly dangerous.
operator = kw['operator']
del kw['operator']
if operator is None:
operator = 'AND'
self.operator = operator
self.__dict__.update(kw) self.__dict__.update(kw)
def __call__(self): def __call__(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment