[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-10 Thread Guido van Rossum
Guido van Rossum added the comment: Committed revision 58093. -- resolution: - accepted status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1125 __

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-08 Thread Stefan Sonnenberg-Carstens
Stefan Sonnenberg-Carstens added the comment: IMHO I also aggree that strings and bytes (list of bytes) should have the same interface. It is common sense that talking about strings most programmers think of a list of bytes composing it (char *). So the abbreviation should also hold true with

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-08 Thread Guido van Rossum
Guido van Rossum added the comment: Updated patch that also modifies bytes.*strip(). __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1125 __Index: Objects/bytesobject.c

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-08 Thread Guido van Rossum
Guido van Rossum added the comment: New version with corrected docstrings and buffer support for *split() as well. Added unittests. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1125 __Index: Objects/bytesobject.c

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-08 Thread Guido van Rossum
Changes by Guido van Rossum: __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1125 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-08 Thread Guido van Rossum
Changes by Guido van Rossum: __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1125 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Georg Brandl
Georg Brandl added the comment: I don't think so. They can't have the same behavior, and split is the most reasonable name for what the bytes method does. There have always been subtle differences between the behavior of string and unicode methods; this was even more objectable because they

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Walter Dörwald
Walter Dörwald added the comment: Because it's not clear whether b'\xa0' *is* whitespace or not. Bytes have no meaning, characters do. -- nosy: +doerwalter __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1125 __

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Nir Soffer
Nir Soffer added the comment: Why bytes should not use a default whitespace split behavior as str? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1125 __ ___ Python-bugs-list

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Guido van Rossum
Guido van Rossum added the comment: I tend to agree with the author; I've run into this myself. For whitespace, I propose to use only the following: tab LF FF VT CR space. These are the whitespace ASCII characters according to isspace() in libc. (Unicode also treats hex 1C, 1D, 1E and 1F as

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Guido van Rossum
Changes by Guido van Rossum: __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1125 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Guido van Rossum
Guido van Rossum added the comment: Here's a patch that fixes bytes.split and .rsplit. I'll hold off for a while in case there's strong disagreement. I might add a patch for bytes.strip later (it's simpler). -- keywords: +patch __ Tracker [EMAIL

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-07 Thread Guido van Rossum
Changes by Guido van Rossum: -- components: +Interpreter Core -Library (Lib) type: rfe - behavior __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1125 __ ___

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-06 Thread Nir Soffer
New submission from Nir Soffer: b'foo bar'.split() Traceback (most recent call last): File stdin, line 1, in module TypeError: split() takes at least 1 argument (0 given) b'foo bar'.split(None) Traceback (most recent call last): File stdin, line 1, in module TypeError: expected an

[issue1125] bytes.split shold have same interface as str.split, or different name

2007-09-06 Thread Nir Soffer
Nir Soffer added the comment: set type -- type: - rfe __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1125 __ ___ Python-bugs-list mailing list Unsubscribe: