From fb1657d54d5ecdcdcee730908673a31b675c844b Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Tue, 12 Nov 2024 23:42:37 +0000 Subject: [PATCH] Improvements to the switch function documentation --- src/calibre/utils/formatter_functions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/calibre/utils/formatter_functions.py b/src/calibre/utils/formatter_functions.py index 9adc3f2516..0098d4df39 100644 --- a/src/calibre/utils/formatter_functions.py +++ b/src/calibre/utils/formatter_functions.py @@ -773,10 +773,10 @@ class BuiltinSwitch(BuiltinFormatterFunction): category = 'Iterating over values' __doc__ = doc = _( r''' -``switch(value, [pattern, value,]+ else_value)`` -- for each ``pattern, value`` pair, -checks if the value matches the regular expression ``pattern`` and if so returns -the associated ``value``. If no ``pattern`` matches, then ``else_value`` is -returned. You can have as many ``pattern, value`` pairs as you wish. The first +``switch(value, [patternN, valueN,]+ else_value)`` -- for each ``patternN, valueN`` pair, +checks if the ``value`` matches the regular expression ``patternN`` and if so returns +the associated ``valueN``. If no ``patternN`` matches, then ``else_value`` is +returned. You can have as many ``patternN, valueN`` pairs as you wish. The first match is returned. ''')