Commit Graph

22 Commits

Author SHA1 Message Date
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
Raymond Hettinger 094662a165 Replace boolean test with is None 2002-06-01 01:29:16 +00:00
Raymond Hettinger aef22fb9cd Patch 560023 adding docstrings. 2.2 Candidate (after verifying modules were not updated after 2.2). 2002-05-29 16:18:42 +00:00
Andrew M. Kuchling 8ea9227b1b Remove empty __init__ (PyChecker) 2001-08-13 14:55:17 +00:00
Fred Drake 6f6a14f888 Remove a bare try/except completely -- it just did not make sense!
Add a comment elsewhere making clear an assumption in the code.
2001-05-11 19:25:08 +00:00
Eric S. Raymond b08b2d3166 String method conversion. 2001-02-09 11:10:16 +00:00
Tim Peters 88869f9787 Whitespace normalization. 2001-01-14 23:36:06 +00:00
Guido van Rossum 4b8c6eaf8b Actually, the previous batch's comment should have been different;
*this* set of patches is Ka-Ping's final sweep:

The attached patches update the standard library so that all modules
have docstrings beginning with one-line summaries.

A new docstring was added to formatter.  The docstring for os.py
was updated to mention nt, os2, ce in addition to posix, dos, mac.
2000-02-04 15:39:30 +00:00
Fred Drake f4bb656a4f DumbWriter.send_paragraph(): Fix problem with DumbWriter reported to
the newsgroup by Raymond Tong Leng Ng <rntl@yahoo.com>.
1999-01-12 18:13:27 +00:00
Guido van Rossum 45e2fbc2e7 Mass check-in after untabifying all files that need it. 1998-03-26 21:13:24 +00:00
Guido van Rossum a8832b45e7 Removed unneeded imports of regex and regsub. 1997-10-22 20:50:37 +00:00
Fred Drake 2823168c46 (formatter.py): Add a flush() method to the writer interface. This really
needs to be a standard part of the interface, so we'll have it in
	for the next release.
1996-12-31 20:50:51 +00:00
Fred Drake ca8cdc6066 (formatter.py): Simplify NullFormatter definition of add_hor_rule() to match
documentation.
1996-10-08 21:57:47 +00:00
Guido van Rossum ccd8b19c99 Add provisions to set the (to be documented!) instance variable
'writer' of the NullFormatter to the writter passed in, or to a
NullWriter if none (or None) is passed in.
1996-10-07 21:29:49 +00:00
Guido van Rossum 8e44991b34 Three sets of changes from Grail:
date: 1996/08/14 17:27:21;  author: fdrake;  state: Exp;  lines: +11 -9
(formatter.py):  Establish a consistent space-handling policy, so that all
        spaces are handled by the outermost context in which they might be
        considered.  (I.e., softspaces at element boundaries migrate
        outwards.)

        For instance: "<A> <IMG> </A>" becomes " <A><IMG></A> ".

        This avoids some of those nasty underlined spaces around images.  It
        does not affect spaces *between* images within an anchor.

date: 1996/08/01 17:02:09;  author: fdrake;  state: Exp;  lines: +3 -2
(formatter.py):  Added required parameter to the NullFormatter class; this
        was omitted by accident.

        Made AbstractFormatter.add_literal_data() handle preceeding softspace
        correctly instead of expecting the caller to do it.

date: 1996/07/23 22:18:56;  author: fdrake;  state: Exp;  lines: +1 -1
(formatter.py):  Correct assert_line_data() to update all internal conditions;
        This now handles headers with only image content immediately followed
        by anything.
1996-08-26 16:19:23 +00:00
Guido van Rossum 3672aa2dcd change DumbWriter to derive from NullWriter 1996-05-29 00:02:30 +00:00
Guido van Rossum 9787bdafe0 Many improvements dure to Fred Drake 1996-05-28 23:50:49 +00:00
Guido van Rossum 7bb7ecd39e even better way to normalize spaces in add_flowing_data 1996-02-13 00:01:28 +00:00
Guido van Rossum 93dc801b06 better way to normalize spaces in add_flowing_data 1996-02-12 23:59:54 +00:00
Guido van Rossum 909507dd0b added NullFormatter 1995-10-06 15:31:30 +00:00
Guido van Rossum c7ae92069d add flush_softspace() interface 1995-09-30 16:49:58 +00:00
Guido van Rossum a0eab1d367 Initial revision 1995-08-07 20:07:36 +00:00