update docstring
This commit is contained in:
parent
a957417c79
commit
aeaff1d663
1 changed files with 4 additions and 1 deletions
|
|
@ -372,6 +372,7 @@ def iter_to_str(iterable, sep=",", endsep=", and", addquote=False):
|
||||||
iterable (any): Usually an iterable to print. Each element must be possible to
|
iterable (any): Usually an iterable to print. Each element must be possible to
|
||||||
present with a string. Note that if this is a generator, it will be
|
present with a string. Note that if this is a generator, it will be
|
||||||
consumed by this operation.
|
consumed by this operation.
|
||||||
|
sep (str, optional): The string to use as a separator for each item in the iterable.
|
||||||
endsep (str, optional): The last item separator will be replaced with this value.
|
endsep (str, optional): The last item separator will be replaced with this value.
|
||||||
addquote (bool, optional): This will surround all outgoing
|
addquote (bool, optional): This will surround all outgoing
|
||||||
values with double quotes.
|
values with double quotes.
|
||||||
|
|
@ -389,7 +390,9 @@ def iter_to_str(iterable, sep=",", endsep=", and", addquote=False):
|
||||||
'1, 2, 3'
|
'1, 2, 3'
|
||||||
>>> list_to_string([1,2,3], ensdep='and')
|
>>> list_to_string([1,2,3], ensdep='and')
|
||||||
'1, 2 and 3'
|
'1, 2 and 3'
|
||||||
>>> list_to_string([1,2,3], endsep=', and', addquote=True)
|
>>> list_to_string([1,2,3], sep=';', endsep=';')
|
||||||
|
'1; 2; 3'
|
||||||
|
>>> list_to_string([1,2,3], addquote=True)
|
||||||
'"1", "2", and "3"'
|
'"1", "2", and "3"'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue