Refs #28909 -- Simplifed code using unpacking generalizations.

This commit is contained in:
Sergey Fedoseev 2018-09-28 18:57:12 +05:00 committed by Tim Graham
parent 4fc8fb7dda
commit 8ef8bc0f64
33 changed files with 84 additions and 97 deletions

View file

@ -58,7 +58,7 @@ class Q(tree.Node):
def __init__(self, *args, **kwargs):
connector = kwargs.pop('_connector', None)
negated = kwargs.pop('_negated', False)
super().__init__(children=list(args) + sorted(kwargs.items()), connector=connector, negated=negated)
super().__init__(children=[*args, *sorted(kwargs.items())], connector=connector, negated=negated)
def _combine(self, other, conn):
if not isinstance(other, Q):