From c357cb2894b80bc6e19fce15340ed887752e1fa2 Mon Sep 17 00:00:00 2001 From: christopher Date: Fri, 4 May 2018 12:18:22 -0400 Subject: [PATCH] DOC: single string vs. list of strings in ``@()`` --- docs/tutorial.rst | 6 ++++++ news/doc_at_cmd.rst | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 news/doc_at_cmd.rst diff --git a/docs/tutorial.rst b/docs/tutorial.rst index cd749d19d..c57b262c1 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -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. diff --git a/news/doc_at_cmd.rst b/news/doc_at_cmd.rst new file mode 100644 index 000000000..348e4726e --- /dev/null +++ b/news/doc_at_cmd.rst @@ -0,0 +1,14 @@ +**Added:** + +* Docs for using ``@()`` 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