DOC: single string vs. list of strings in `@()`

This commit is contained in:
christopher 2018-05-04 12:18:22 -04:00
parent abf1e9cc2c
commit c357cb2894
2 changed files with 20 additions and 0 deletions

View file

@ -502,6 +502,12 @@ result is automatically converted to a string. For example,
42 yo
>>> echo "hello" | @(lambda a, s=None: s.read().strip() + " world\n")
hello world
>>> @(['echo', 'hello world'])
hello world
.. warning::
If the expression is a string and not a list then it will be passed to the
subprocess as a single argument.
This syntax can be used inside of a captured or uncaptured subprocess, and can
be used to generate any of the tokens in the subprocess command list.

14
news/doc_at_cmd.rst Normal file
View file

@ -0,0 +1,14 @@
**Added:**
* Docs for using ``@(<expr>)`` as a way to run commands and a gotcha about
list of strings vs single string expressions.
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None