Message229841
This issue should go in the Documentation component but that is not an option in the issue tracker.
Suggestion to improve documentation for join() (str method). Applies to versions 2.7.5, 3.3.6, 3.5.0a0.
--quote
str.join(iterable)
Returns a string. Uses the string str to join strings from
iterable. Raises TypeError for non-string found in iterable including
object of bytes.
>>> # the iterable consists of number
>>> try:
>>> print "-".join([0, 1, 2, 3])
>>> except TypeError:
>>> print "A non-string is found in the iterable."
A non-string is found in the iterable.
>>> # the iterable consists of string
>>> try:
>>> print ", ".join(["x", "y", "z", "0", "1", "2", "3"])
>>> print " - ".join(["x", "y", "z", "0", "1", "2", "3"])
>>> print " + ".join(["x", "y", "z", "0", "1", "2", "3"])
>>> except TypeError:
>>> print "A non-string is found in the iterable."
x, y, z, 0, 1, 2, 3
x - y - z - 0 - 1 - 2 - 3
x + y + z + 0 + 1 + 2 + 3
--quote-- |
|
Date |
User |
Action |
Args |
2014-10-22 22:37:22 | vy0123 | set | recipients:
+ vy0123, ronaldoussoren, ned.deily |
2014-10-22 22:37:21 | vy0123 | set | messageid: <1414017441.98.0.187335340973.issue22702@psf.upfronthosting.co.za> |
2014-10-22 22:37:21 | vy0123 | link | issue22702 messages |
2014-10-22 22:37:21 | vy0123 | create | |
|