comparison docs/introduction.rst @ 353:a7491f835cb0

Changelog and minimal docu for `None` and `Empty` filters
author Franz Glasner <f.glasner@feldmann-mg.com>
date Thu, 24 Jun 2021 19:39:20 +0200
parents d7daec119383
children bd28fb4565e1
comparison
equal deleted inserted replaced
352:2b209bdf6995 353:a7491f835cb0
415 415
416 ``lower`` 416 ``lower``
417 417
418 ``upper`` 418 ``upper``
419 419
420 Also available are special filter functions ``None`` and ``Empty``.
421 They are useful in variable interpolation context because they
422 suppress possible lookup errors (aka :py:exception:`KeyError`) and
423 instead return with :py:obj:`None` or an empty string.
424
420 425
421 Examples 426 Examples
422 ~~~~~~~~ 427 ~~~~~~~~
423 428
424 :: 429 ::
451 Configuration tree references 456 Configuration tree references
452 ----------------------------- 457 -----------------------------
453 458
454 With ``{{ref:#my.other.key}}`` 459 With ``{{ref:#my.other.key}}``
455 460
456 - think of it as a sort of a symbolic link to other parts of the 461 - think of it as a sort of a symbolic link to other parts of the
457 configuration tree 462 configuration tree
458 - by employing the special namespace ``ref`` 463 - by employing the special namespace ``ref``
459 - can not be quoted currently in variable interpolation syntax 464 - can not be quoted currently in variable interpolation syntax
460 - No special handling when merging is done -- merging is agnostic of 465 - No special handling when merging is done -- merging is agnostic of
461 tree references 466 tree references
462 - Keys within :meth:`.Configuration.getvar_s`, 467 - Keys within :meth:`.Configuration.getvar_s`,
463 :py:meth:`.Configuration.getvar`, :py:meth:`.Configuration.getvarl` 468 :py:meth:`.Configuration.getvar`, :py:meth:`.Configuration.getvarl`
464 and :py:meth:`.Configuration.getvarl_s` are handled 469 and :py:meth:`.Configuration.getvarl_s` are handled
465 - in :py:meth:`.Configuration.getvar` only, when it is the directly 470 - in :py:meth:`.Configuration.getvar` only, when it is the directly
466 referenced value 471 referenced value
467 - recursive expansion in :py:meth:`.Configuration.getvar_s` and 472 - recursive expansion in :py:meth:`.Configuration.getvar_s` and