Replaced kwargs.pop() with keyword-only arguments.

This commit is contained in:
Jon Dufresne 2018-10-08 12:06:02 -07:00 committed by Tim Graham
parent 2ba588e773
commit 1e87c9fe71
2 changed files with 5 additions and 7 deletions

View file

@ -55,10 +55,8 @@ class Q(tree.Node):
default = AND
conditional = True
def __init__(self, *args, **kwargs):
connector = kwargs.pop('_connector', None)
negated = kwargs.pop('_negated', False)
super().__init__(children=[*args, *sorted(kwargs.items())], connector=connector, negated=negated)
def __init__(self, *args, _connector=None, _negated=False, **kwargs):
super().__init__(children=[*args, *sorted(kwargs.items())], connector=_connector, negated=_negated)
def _combine(self, other, conn):
if not isinstance(other, Q):