Andrew M. Kuchling
3b015c46a5
[Bug #1622533 ] Make docstrings raw strings because they contain control characters (\0, \1)
2007-01-05 14:24:36 +00:00
Walter Dörwald
0af5d93d8a
SF patch #1359365 : file and cStringIO raise a ValueError when next() is called
...
after calling close(). Change StringIO, so that it behaves the same way.
2006-03-15 08:23:53 +00:00
Raymond Hettinger
6065d32325
SF bug #951915 : fix bug in StringIO.truncate - length not changed
...
(Patch by Armin Rigo.)
2004-12-20 23:51:53 +00:00
Raymond Hettinger
513c8bd6f2
Arghh, checked in wrong draft. Replacing with correct one.
2004-09-23 07:00:47 +00:00
Raymond Hettinger
0336e1fe8c
Use local variables in StringIO.write().
...
Makes it easier on the eyes and a bit more snappy.
2004-09-23 06:43:25 +00:00
Raymond Hettinger
deb4da500b
Add missing docstrings.
2004-03-14 07:54:37 +00:00
Raymond Hettinger
6ec099658a
SF patch #907403 : Improvements to cStringIO.writelines()
...
The writelines() method now accepts any iterable argument and writes
the lines one at a time rather than using ''.join(lines) followed by
a single write. Results in considerable memory savings and makes
the method suitable for use with generator expressions.
2004-03-08 18:17:31 +00:00
Walter Dörwald
70a6b49821
Replace backticks with repr() or "%r"
...
From SF patch #852334 .
2004-02-12 17:35:32 +00:00
Tim Peters
58eb11cf62
Whitespace normalization.
2004-01-18 20:29:55 +00:00
Walter Dörwald
c2fcf9bb6b
Make the module docstring a raw string, so that the backslash in
...
"read until end of line ('\n') or EOF" will be treated literally.
Fixes SF bug #860155 .
2003-12-15 10:16:09 +00:00
Martin v. Löwis
9e62ff287b
Patch #822994 : Consolidate tests for self.closed.
2003-10-18 10:20:42 +00:00
Guido van Rossum
c1265bd9a6
Make StringIO its own iterator, similar to real files.
...
(This should also be done to cStringIO.)
2003-01-31 16:04:15 +00:00
Fred Drake
d679e09970
write(): Special case the common situation of a stream that's only
...
being used to dump output (no seeks), so we can avoid a lot
of extra checks being made.
2002-09-17 18:10:34 +00:00
Walter Dörwald
65230a2de7
Remove uses of the string and types modules:
...
x in string.whitespace => x.isspace()
type(x) in types.StringTypes => isinstance(x, basestring)
isinstance(x, types.StringTypes) => isinstance(x, basestring)
type(x) is types.StringType => isinstance(x, str)
type(x) == types.StringType => isinstance(x, str)
string.split(x, ...) => x.split(...)
string.join(x, y) => y.join(x)
string.zfill(x, ...) => x.zfill(...)
string.count(x, ...) => x.count(...)
hasattr(types, "UnicodeType") => try: unicode except NameError:
type(x) != types.TupleTuple => not isinstance(x, tuple)
isinstance(x, types.TupleType) => isinstance(x, tuple)
type(x) is types.IntType => isinstance(x, int)
Do not mention the string module in the rlcompleter docstring.
This partially applies SF patch http://www.python.org/sf/562373
(with basestring instead of string). (It excludes the changes to
unittest.py and does not change the os.stat stuff.)
2002-06-03 15:58:32 +00:00
Tim Peters
8ac1495a6a
Whitespace normalization.
2002-05-23 15:15:30 +00:00
Raymond Hettinger
d1fa3db52d
Added docstrings excerpted from Python Library Reference.
...
Closes patch 556161.
2002-05-15 02:56:03 +00:00
Michael W. Hudson
e1c67d1dc0
Make StringIO work in --disable-unicode builds...
2002-05-13 09:42:16 +00:00
Jeremy Hylton
e037665f99
Use isinstance() in preference to comparison of type by is.
2002-05-10 21:00:35 +00:00
Guido van Rossum
8ca162f417
Partial introduction of bools where appropriate.
2002-04-07 06:36:23 +00:00
Neal Norwitz
9fb289d826
SF #515000 , print result of f.tell() in test() instead of ignoring
2002-02-11 17:52:18 +00:00
Marc-André Lemburg
f853be980e
Restore Python 2.1 StringIO.py behaviour: support concatenating
...
Unicode string snippets to larger Unicode strings.
This fix should also go into Python 2.2.1.
2002-01-06 17:15:05 +00:00
Marc-André Lemburg
e47df7a211
StringIO patch #462596 : let's [c]StringIO accept read buffers on
...
input to .write() too.
2001-09-24 17:34:52 +00:00
Barry Warsaw
bdefa0b3de
__iter__(): New method so that StringIO's can participate in the
...
iterator protocol.
2001-09-22 04:34:54 +00:00
Marc-André Lemburg
85d6edfc83
Remove silly EMPTYSTRING global. Saves a global lookup.
2001-02-09 13:37:37 +00:00
Skip Montanaro
e99d5ea25b
added __all__ lists to a number of Python modules
...
added test script and expected output file as well
this closes patch 103297.
__all__ attributes will be added to other modules without first submitting
a patch, just adding the necessary line to the test script to verify
more-or-less correct implementation.
2001-01-20 19:54:20 +00:00