mirror of
https://github.com/django/django.git
synced 2025-08-31 07:47:37 +00:00
Fixed #28860 -- Removed unnecessary len() calls.
This commit is contained in:
parent
3d94ee8500
commit
d2afa5eb23
33 changed files with 56 additions and 55 deletions
|
@ -161,7 +161,7 @@ class BaseExpression:
|
|||
return []
|
||||
|
||||
def set_source_expressions(self, exprs):
|
||||
assert len(exprs) == 0
|
||||
assert not exprs
|
||||
|
||||
def _parse_expressions(self, *expressions):
|
||||
return [
|
||||
|
@ -780,7 +780,7 @@ class ExpressionList(Func):
|
|||
template = '%(expressions)s'
|
||||
|
||||
def __init__(self, *expressions, **extra):
|
||||
if len(expressions) == 0:
|
||||
if not expressions:
|
||||
raise ValueError('%s requires at least one expression.' % self.__class__.__name__)
|
||||
super().__init__(*expressions, **extra)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue