mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Improvements to the switch function documentation
This commit is contained in:
parent
38b9f15897
commit
fb1657d54d
@ -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.
|
||||
''')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user