From b95b22d8c0f9f26e33e1912d8ee205319fc20362 Mon Sep 17 00:00:00 2001 From: Abdulhaq Emhemmed Date: Fri, 10 Feb 2023 22:56:30 +0100 Subject: Fix docs for `case` expression to match new syntax (#9279) * Fix docs for `case` expression to match new syntax Previously (before v1.4), the `whens` arg (when `value` is *not* used) used to be a list of conditions (a 2 item-tuple of condition + value). From v1.4, these are passed as positional args and the old syntax is not supported anymore. * Fix long lines --- lib/sqlalchemy/sql/_elements_constructors.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/sql/_elements_constructors.py') diff --git a/lib/sqlalchemy/sql/_elements_constructors.py b/lib/sqlalchemy/sql/_elements_constructors.py index 98f5a1cc6..5c7019718 100644 --- a/lib/sqlalchemy/sql/_elements_constructors.py +++ b/lib/sqlalchemy/sql/_elements_constructors.py @@ -757,10 +757,10 @@ def case( .. versionchanged:: 1.4 the :func:`_sql.case` function now accepts the series of WHEN conditions positionally - In the first form, it accepts a list of 2-tuples; each 2-tuple - consists of ``(, )``, where the SQL - expression is a boolean expression and "value" is a resulting value, - e.g.:: + In the first form, it accepts multiple 2-tuples passed as positional + arguments; each 2-tuple consists of ``(, )``, + where the SQL expression is a boolean expression and "value" is a + resulting value, e.g.:: case( (users_table.c.name == 'wendy', 'W'), -- cgit v1.2.1