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

split() description not fully accurate #42694

Closed
kace mannequin opened this issue Dec 14, 2005 · 4 comments
Closed

split() description not fully accurate #42694

kace mannequin opened this issue Dec 14, 2005 · 4 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@kace
Copy link
Mannequin

kace mannequin commented Dec 14, 2005

BPO 1380970
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 = 'https://github.com/rhettinger'
closed_at = <Date 2007-01-06.02:19:22.000>
created_at = <Date 2005-12-14.23:33:49.000>
labels = ['docs']
title = 'split() description not fully accurate'
updated_at = <Date 2007-01-06.02:19:22.000>
user = 'https://bugs.python.org/kace'

bugs.python.org fields:

activity = <Date 2007-01-06.02:19:22.000>
actor = 'rhettinger'
assignee = 'rhettinger'
closed = True
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2005-12-14.23:33:49.000>
creator = 'kace'
dependencies = []
files = []
hgrepos = []
issue_num = 1380970
keywords = []
message_count = 4.0
messages = ['27070', '27071', '27072', '27073']
nosy_count = 3.0
nosy_names = ['collinwinter', 'rhettinger', 'kace']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1380970'
versions = ['Python 2.4']

@kace
Copy link
Mannequin Author

kace mannequin commented Dec 14, 2005

The page http://docs.python.org/lib/string-methods.html
reads, in part, "If sep is not specified or is None, a
different splitting algorithm is applied. First,
whitespace characters (spaces, tabs, newlines, returns,
and formfeeds) are stripped from both ends." However,
this is not the behaviour that I'm seeing. (Although,
I should note that I'd find the described behaviour
more desirable.) Example,

>>> trow = '1586\tsome-int-name\tNODES: 111_222\n'
>>> print trow
1234    some-int-name   NODES: 111_222

>>> trow.split(None,2)
['1234', 'some-int-name', 'NODES: 111_222\n']
# end example.

Notice that the trailing newline has not been stripped
as the documentation said it should be. Thanks all.

K.C.

@kace kace mannequin closed this as completed Dec 14, 2005
@kace kace mannequin assigned rhettinger Dec 14, 2005
@kace kace mannequin added the docs Documentation in the Doc dir label Dec 14, 2005
@kace kace mannequin closed this as completed Dec 14, 2005
@kace kace mannequin assigned rhettinger Dec 14, 2005
@kace kace mannequin added the docs Documentation in the Doc dir label Dec 14, 2005
@kace
Copy link
Mannequin Author

kace mannequin commented Dec 14, 2005

Logged In: YES
user_id=741142

Also, (oops) the example comes from the most recent version:

$ python
Python 2.4.2 (#2, Oct 4 2005, 13:57:10)
[GCC 3.4.2 [FreeBSD] 20040728] on freebsd5
Type "help", "copyright", "credits" or "license" for more
information.

>>

@collinwinter
Copy link
Mannequin

collinwinter mannequin commented Jan 26, 2006

Logged In: YES
user_id=1344176

I've provided a patch for this: bpo-1414934.

@rhettinger
Copy link
Contributor

I prefer the docs as they currently read.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 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