Commit Graph

1334 Commits

Author SHA1 Message Date
Guido van Rossum
11fbef5f92 Sjoerd sez: global substitute \240 with \177. 1997-12-02 17:45:39 +00:00
Guido van Rossum
376467ada6 Added stropts.h to the list of files automatically regenerated. 1997-12-02 14:37:20 +00:00
Barry Warsaw
5284589097 Generated from Solaris 2.6's /usr/include/sys/stropts.h via
Tools/scripts/h2py.py.  This file contains many useful streamio(7)
constants, especially the ones that support passing open file
descriptors through a pipe: I_RECVFD and I_SENDFD.
1997-12-02 04:49:09 +00:00
Guido van Rossum
893a8cbae7 *** empty log message *** 1997-12-02 03:42:17 +00:00
Guido van Rossum
cf4559a62e Added Pareto and Weibull distributions, courtesy Jeremy Hylton. 1997-12-02 02:47:39 +00:00
Barry Warsaw
c99a239f42 Added strop.split tests when sep is None. 1997-12-02 00:30:04 +00:00
Guido van Rossum
06ba34c5d4 In string.split(), honor maxsplit (if > 0).
In string.splitfields(), ignore maxsplit if <= 0, rather than ignoring
maxsplit=0 but effectively treating negative numbers the same as
maxsplit=1.  Also made the test for maxsplit slightly more efficient
(set it to the length of the string when <= 0 so the test for its
presence can be omitted from the loop).
1997-12-01 15:25:19 +00:00
Barry Warsaw
58a88b3e34 _Environ(): Added __getinitargs__() method so os.environ.copy() works,
as does unpickling, as in: pickle.loads(pickle.dumps(os.environ)).

Hope this is right!  Don't shoot me Guido. :-)
1997-12-01 04:30:19 +00:00
Barry Warsaw
9181190c76 Added tests of strop.replace() 1997-11-29 00:25:30 +00:00
Guido van Rossum
0b23348aa9 The usual 1997-11-26 15:44:34 +00:00
Guido van Rossum
e2d4dd194b Use fuzzy comparison from test_support to compare outcome of
pow(x,y,z) to pow(x,y)%z.
1997-11-24 22:24:22 +00:00
Guido van Rossum
8e9ebfd337 os2 patch by Jeff Rush 1997-11-22 21:53:48 +00:00
Guido van Rossum
c0b93191e6 bind_class should return a value 1997-11-22 21:49:56 +00:00
Guido van Rossum
be7c45eec4 New address parser by Ben Escoto replaces
Sjoerd Mullender's parseaddr()
1997-11-22 21:49:19 +00:00
Guido van Rossum
e6c128f428 Use fstat if we can; write MAGIC into file last. 1997-11-22 21:48:26 +00:00
Guido van Rossum
7d5b99d8bf A new standard module, as discussed on comp.lang.python, to simplify
the writing of filters.

Typical use is:

    import fileinput
    for line in fileinput.input():
        process(line)

This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty or when a filename is
'-'.

There is also an option to use this to direct the output back to the
input files.
1997-11-21 17:12:59 +00:00
Barry Warsaw
3d96d522ec (Queue.Empty): When class based exceptions are in force, derive this
class from the standard base exception Exception.  Otherwise define
Queue.Empty as a string exception.

(Queue): 8-space to 4-space indentation conversion.  Also, basically
recast all method comments into docstrings.
1997-11-20 19:56:38 +00:00
Guido van Rossum
bd1169a93e Add Martin von Loewis as the author of this module. 1997-11-19 19:02:09 +00:00
Guido van Rossum
eef1d4e8b1 User-level locale module. A wrapper around _locale which adds
format(), str(), atof(), and atoi().  The last three are locale
sensitive versions of the corresponding standard functions (only for
numbers though); format() does general %[efg] formatting taking the
locale into account, optionally with thousands grouping.
1997-11-19 19:01:43 +00:00
Guido van Rossum
83600050d0 Assert that the proxies object passed in to the URLopener constructor
is indeed a dictionary (or a mapping).
1997-11-18 15:50:39 +00:00
Guido van Rossum
421c224044 Added docstrings (contributed by Martin von Loewis). 1997-11-18 15:47:55 +00:00
Guido van Rossum
5d68e8e312 Fixed case sensitivity of attributes (they are case *sensitive*). 1997-11-18 15:27:20 +00:00
Guido van Rossum
a219efaa7b Sjoerd Mullender's xml parser (based on sgmllib, somewhat). 1997-11-18 15:09:54 +00:00
Guido van Rossum
368e06b6f0 Some restructuring.
All geometry manager methods that apply to a master widget instead of
to a slave widget have been moved to the Misc class, which is
inherited by all of Tk(), Toplevel() and Widget().  They have been
renamed to have their geometry manager name as a prefix,
e.g. pack_propagate(); the short names can still be used where
ambiguities are resolved so that pack has priority over place has
priority over grid (since this was the old rule).

Also, the method definitions in the Pack, Place and Grid classes now
all have their respective geometry manager name as a prefix
(e.g. pack_configure); the shorter names are aliases defined through
assignment.

A similar renaming has been done for all config() methods found
elsewhere; these have been renamed to configure() with config being
the alias (instead of the other way around).  (This may not make much
of a difference but the official Tk command name is now 'configure'
and it may help in debugging tracebacks.)

Finally, a new base class BaseWidget has been introduced, which
implements the methods common between Widget and Toplevel (the
difference between those two classes is that Toplevel has a different
__init__() but also that Toplevel doesn't inherit from Pack, Place or
Grid.
1997-11-07 20:38:49 +00:00
Guido van Rossum
c1189eb524 Separate out a function pystones(loops=LOOPS) which runs the benchmark
and returns a (benchtime, stones) tuple.  The main() function now
calls this and prints the report.  Fred Drake's code.
1997-11-06 15:45:05 +00:00
Guido van Rossum
f849291e2b Add __init__.py to test package. 1997-11-06 15:41:23 +00:00
Guido van Rossum
bfa9f13e14 islink() returns false, but there is no constant false! Return 0 instead. 1997-11-04 18:40:53 +00:00
Guido van Rossum
19f44560f2 Use `0'' instead of `None'' to reset the underlying object in close
methods.  Using None causes problems if the destructor is called after
the __builtin__ module has already been destroyed (unfortunately, this
can happen!).  I can't just delete the object because it is actually
tested for (if self._sock: ...).  Setting it to 0 is a bit weird but
works.
1997-11-04 17:32:59 +00:00
Guido van Rossum
e8d113976c Add empty __init__.py files to the test packages so the new policy
will recognize them.
1997-10-31 18:33:41 +00:00
Guido van Rossum
613418aa09 New version from Sjoerd, small bugfix + optimizations. 1997-10-30 15:27:37 +00:00
Guido van Rossum
0874f7fdaf Tests for tokenize.py (Ka-Ping Yee) 1997-10-27 22:15:06 +00:00
Guido van Rossum
fefc922cef New, fixed version with proper r"..." and R"..." support from Ka-Ping. 1997-10-27 21:17:24 +00:00
Guido van Rossum
3b631775b2 Redone (by Ka-Ping) using the new re module, and adding recognition
for r"..." raw strings.  (And R"..." string support added by Guido.)
1997-10-27 20:44:15 +00:00
Guido van Rossum
036309b13e This should hopefully finally clean up the remaining __del__ related
problems with this module, even if an instance of a derived class is
kept alive longer than the urllib module itself...
1997-10-27 18:56:19 +00:00
Guido van Rossum
af8d2bf4d8 Bugfix in match() -- the number of registers shouldn't be divided by two! 1997-10-27 18:17:19 +00:00
Guido van Rossum
e6eef4b4a3 Use __dict__.update(state) instead of for loop over state.items() and
call to setattr().  This changes semantics, following the change
already implemented in pickle.

Also reindented a few lines properly.
1997-10-26 17:00:25 +00:00
Guido van Rossum
31626bce66 re -> regex conversions by Sjoerd. 1997-10-24 14:46:16 +00:00
Guido van Rossum
f81e5b9c78 New module -- converts regex regular expressions to re style.
There are two ways to use this -- as a filter (e.g. using C-U M-| on a
regex string literal in an Emacs buffer) or from a Python program
which imports this as a module.  Read the doc string for more info,
and also some caveats (some cases aren't handled right).
1997-10-23 22:43:50 +00:00
Guido van Rossum
1fef181183 Although it's hard to be sure, I *think* this is a working conversion
from regex to re style regular expressions.  This should make sgmllib
and htmllib threadsafe, so I can now create a threaded version of
webchecker...
1997-10-23 19:09:21 +00:00
Guido van Rossum
57a68e08f9 Remove redundant import regsub. 1997-10-23 17:50:10 +00:00
Guido van Rossum
9694fcab53 Convert all remaining *simple* cases of regex usage to re usage. 1997-10-22 21:00:49 +00:00
Guido van Rossum
426916e50e Add pcre to the list of safe modules. 1997-10-22 20:56:32 +00:00
Guido van Rossum
f7a8b45d71 Remove outdated comments. 1997-10-22 20:54:50 +00:00
Guido van Rossum
12f86ade21 Removed some unneeded imports, moved others around. 1997-10-22 20:52:53 +00:00
Guido van Rossum
a8832b45e7 Removed unneeded imports of regex and regsub. 1997-10-22 20:50:37 +00:00
Guido van Rossum
acfb82a530 Use re instead of regex. Also remove bogus return statement from __init__(). 1997-10-22 20:49:52 +00:00
Guido van Rossum
8566e474b4 Added pgrep() function, which is like grep/egrep/emgrep but uses Perl
syntax, by virtue of the new re module.
1997-10-22 20:44:58 +00:00
Guido van Rossum
b49144244c Deleted this long-obsolete module 1997-10-22 16:29:53 +00:00
Guido van Rossum
24986204cf Added "new" symbol defns for RE_ANSI_HEX and RE_NO_GNU_EXTENSIONS --
hopefully the last maintenance on this module, ever.
1997-10-22 16:28:53 +00:00
Guido van Rossum
4e8ef5fcd3 Catch KeyboardInterrupt separately and propagate it, instead of
reporting a "crash".

Use sys.exc_info() instead of sys.exc_type and sys.exc_value.
1997-10-20 23:46:54 +00:00