You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2005-02-12.19:22:44.000>created_at=<Date2005-02-11.15:43:00.000>labels= ['invalid', 'docs']
title='Problem in join function definition'updated_at=<Date2005-02-12.19:22:44.000>user='https://bugs.python.org/yseb'
There is a problem in the last sentence of the join
definition.
==========================================
join( words[, sep])
Concatenate a list or tuple of words with intervening
occurrences of sep. The default value for sep is a single
space character. It is always true that "string.join
(string.split(s, sep), sep)" equals s.
==========================================
It is true that string.join(string.split(s, sep), sep)" is
always equals to s.
But string.join(string.split(s)) is not always equals to s
especially for repeated sequence of spaces.
I concur. The sentence is correct:
>>> s =' the quick brown \t\t fox jumped '
>>> sep =''
>>> s == string.join(string.split(s, sep), sep)
True
Possibly the docs could go on to talk about
string.join(string.split(s)). However that would just be
adding rambling verbiage that is unlikely to be helpful to
anyone who has just read what string.split(s) actually does.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: