diff --git a/django/core/management/base.py b/django/core/management/base.py index db131ed757..1f2d59b096 100644 --- a/django/core/management/base.py +++ b/django/core/management/base.py @@ -42,9 +42,9 @@ class CommandParser(ArgumentParser): SystemExit in several occasions, as SystemExit is unacceptable when a command is called programmatically. """ - def __init__(self, **kwargs): - self.missing_args_message = kwargs.pop('missing_args_message', None) - self.called_from_command_line = kwargs.pop('called_from_command_line', None) + def __init__(self, *, missing_args_message=None, called_from_command_line=None, **kwargs): + self.missing_args_message = missing_args_message + self.called_from_command_line = called_from_command_line super().__init__(**kwargs) def parse_args(self, args=None, namespace=None): diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py index ce311639da..f6bc0bd030 100644 --- a/django/db/models/query_utils.py +++ b/django/db/models/query_utils.py @@ -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):