diff options
author | alandonovan <adonovan@google.com> | 2018-12-14 19:09:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-14 19:09:49 -0500 |
commit | 88085a499633e675c9b29c3ff8ea2073480047a5 (patch) | |
tree | 1de58871171f8da5715cf3dd45e3a14b7c4c6a02 /doc | |
parent | 2c65f9e0f5e155edb22bcf767d709321069553e9 (diff) | |
download | starlark-go-88085a499633e675c9b29c3ff8ea2073480047a5.tar.gz |
print: disallow **kwargs (#73)
...but add a sep=" " parameter.
Updates bazelbuild/starlark#22
Diffstat (limited to 'doc')
-rw-r--r-- | doc/spec.md | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/spec.md b/doc/spec.md index 8acccdb..b8f7379 100644 --- a/doc/spec.md +++ b/doc/spec.md @@ -3055,14 +3055,17 @@ See also: `chr`. ### print -`print(*args, **kwargs)` prints its arguments, followed by a newline. -Arguments are formatted as if by `str(x)` and separated with a space. +`print(*args, sep=" ")` prints its arguments, followed by a newline. +Arguments are formatted as if by `str(x)` and separated with a space, +unless an alternative separator is specified by a `sep` named argument. Keyword arguments are preceded by their name. Example: ```python -print(1, "hi", x=3) # "1 hi x=3\n" +print(1, "hi") # "1 hi\n" +print("hello", "world") # "hello world\n" +print("hello", "world", sep=", ") # "hello, world\n" ``` Typically the formatted string is printed to the standard error file, |