Skip to content

Commit

Permalink
Advise against using : in ternary WithProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
pepsiman committed Sep 4, 2012
1 parent 30d2859 commit 550fa37
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions master/docs/manual/cfg-properties.rst
Expand Up @@ -248,15 +248,16 @@ syntaxes in the parentheses.
If ``propname`` exists, substitute ``replacement``; otherwise,
substitute an empty string.

``propname:?:sub_if_exists:sub_if_missing``
``propname:?|sub_if_exists|sub_if_missing``

``propname:#?:sub_if_true:sub_if_false``
``propname:#?|sub_if_true|sub_if_false``
Ternary substitution, depending on either ``propname`` being present (with
``:?``, similar to ``:+``) or being ``True`` (with ``:#?``, like ``:~``).
Notice that there is a colon immediately following the question mark *and*
Notice that there is a pipe immediately following the question mark *and*
between the two substitution alternatives. The character that follows the
question mark is used as the delimeter between the two alternatives. In the
above examples, it is a colon, but any single character can be used.
above examples, it is a pipe, but any single character can be used. Using
colon is not advised.


Although these are similar to shell substitutions, no other
Expand Down

0 comments on commit 550fa37

Please sign in to comment.