Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in join function definition #41564

Closed
yseb mannequin opened this issue Feb 11, 2005 · 3 comments
Closed

Problem in join function definition #41564

yseb mannequin opened this issue Feb 11, 2005 · 3 comments
Labels
docs Documentation in the Doc dir

Comments

@yseb
Copy link
Mannequin

yseb mannequin commented Feb 11, 2005

BPO 1120862
Nosy @rhettinger

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 = None
closed_at = <Date 2005-02-12.19:22:44.000>
created_at = <Date 2005-02-11.15:43:00.000>
labels = ['invalid', 'docs']
title = 'Problem in join function definition'
updated_at = <Date 2005-02-12.19:22:44.000>
user = 'https://bugs.python.org/yseb'

bugs.python.org fields:

activity = <Date 2005-02-12.19:22:44.000>
actor = 'rhettinger'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2005-02-11.15:43:00.000>
creator = 'yseb'
dependencies = []
files = []
hgrepos = []
issue_num = 1120862
keywords = []
message_count = 3.0
messages = ['24262', '24263', '24264']
nosy_count = 3.0
nosy_names = ['effbot', 'rhettinger', 'yseb']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1120862'
versions = ['Python 2.5']

@yseb
Copy link
Mannequin Author

yseb mannequin commented Feb 11, 2005

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.

@yseb yseb mannequin closed this as completed Feb 11, 2005
@yseb yseb mannequin added invalid docs Documentation in the Doc dir labels Feb 11, 2005
@yseb yseb mannequin closed this as completed Feb 11, 2005
@yseb yseb mannequin added invalid docs Documentation in the Doc dir labels Feb 11, 2005
@effbot
Copy link
Mannequin

effbot mannequin commented Feb 12, 2005

Logged In: YES
user_id=38376

And? If the documentation explains how something works,
does it also have to list a couple of other things that doesn't
work?

@rhettinger
Copy link
Contributor

Logged In: YES
user_id=80475

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant