]> granicus.if.org Git - python/log
python
22 years agoAdd tests for including __dict__ and/or __weakref__ in __slots__.
Guido van Rossum [Tue, 13 Aug 2002 18:26:26 +0000 (18:26 +0000)]
Add tests for including __dict__ and/or __weakref__ in __slots__.
Add some more rigor to slotmultipleinheritance().

22 years agoSF bug #574235, convert_path fails with empty pathname
Neal Norwitz [Tue, 13 Aug 2002 17:42:57 +0000 (17:42 +0000)]
SF bug #574235, convert_path fails with empty pathname

22 years agoAllow docstrings to be removed during compilation
Neal Norwitz [Tue, 13 Aug 2002 17:18:45 +0000 (17:18 +0000)]
Allow docstrings to be removed during compilation

22 years agoAdd test for SF bug # 575229, multiple inheritance w/ slots dumps core
Neal Norwitz [Tue, 13 Aug 2002 17:16:49 +0000 (17:16 +0000)]
Add test for SF bug # 575229, multiple inheritance w/ slots dumps core
Fix already checked in by Guido

22 years agoRemove ugly irregular spaces from in front of some comments.
Fred Drake [Tue, 13 Aug 2002 13:59:55 +0000 (13:59 +0000)]
Remove ugly irregular spaces from in front of some comments.

22 years agoBug #556025: list(xrange(1e9)) --> seg fault
Jason Tishler [Tue, 13 Aug 2002 11:42:41 +0000 (11:42 +0000)]
Bug #556025: list(xrange(1e9)) --> seg fault

Close the bug report again -- this time for Cygwin due to a newlib bug.
See the following for the details:

http://sources.redhat.com/ml/newlib/2002/msg00369.html

Note that this commit is only a documentation (i.e., comment) change.

22 years agoAdd an improvement wrinkle to Neil Schemenauer's change to int_mul
Guido van Rossum [Tue, 13 Aug 2002 10:05:56 +0000 (10:05 +0000)]
Add an improvement wrinkle to Neil Schemenauer's change to int_mul
(rev. 2.86).  The other type is only disqualified from sq_repeat when
it has the CHECKTYPES flag.  This means that for extension types that
only support "old-style" numeric ops, such as Zope 2's ExtensionClass,
sq_repeat still trumps nb_multiply.

22 years agotest_division(): Added one larger digits value, to ensure that the
Tim Peters [Tue, 13 Aug 2002 02:24:25 +0000 (02:24 +0000)]
test_division():  Added one larger digits value, to ensure that the
"lopsided Karatsuba" driver also gets some exercise.

22 years agoMachines-- and Python --are a lot faster in relevant ways since this
Tim Peters [Tue, 13 Aug 2002 02:17:11 +0000 (02:17 +0000)]
Machines-- and Python --are a lot faster in relevant ways since this
test was written.  So boosted the number of "digits" this generates, and
also beefed up the "* / divmod" test to tickle numbers big enough to
trigger the Karatsuba algorithm.  It takes about 2 seconds now on my box.

22 years agoFix comment for PyLong_AsUnsignedLong() to say that the return value
Guido van Rossum [Tue, 13 Aug 2002 00:24:58 +0000 (00:24 +0000)]
Fix comment for PyLong_AsUnsignedLong() to say that the return value
is an *unsigned* long.

22 years agoFix wanrings about unsigned hex constants.
Guido van Rossum [Mon, 12 Aug 2002 22:11:28 +0000 (22:11 +0000)]
Fix wanrings about unsigned hex constants.

22 years agok_lopsided_mul(): This allocated more space for bslice than necessary.
Tim Peters [Mon, 12 Aug 2002 22:10:00 +0000 (22:10 +0000)]
k_lopsided_mul():  This allocated more space for bslice than necessary.

22 years agoThe auto-reply text for the python-docs address. This is not automatically
Fred Drake [Mon, 12 Aug 2002 22:01:42 +0000 (22:01 +0000)]
The auto-reply text for the python-docs address.  This is not automatically
updated when checkins are made, but I can get that updated when needed.

22 years agoAdded new function k_lopsided_mul(), which is much more efficient than
Tim Peters [Mon, 12 Aug 2002 22:01:34 +0000 (22:01 +0000)]
Added new function k_lopsided_mul(), which is much more efficient than
k_mul() when inputs have vastly different sizes, and a little more
efficient when they're close to a factor of 2 out of whack.

I consider this done now, although I'll set up some more correctness
tests to run overnight.

22 years agoDon't use hex constants representing negative numbers.
Guido van Rossum [Mon, 12 Aug 2002 22:01:24 +0000 (22:01 +0000)]
Don't use hex constants representing negative numbers.

22 years agoSuppress warnings about test_grammar.py that can't be suppressed inside
Guido van Rossum [Mon, 12 Aug 2002 21:55:51 +0000 (21:55 +0000)]
Suppress warnings about test_grammar.py that can't be suppressed inside
that file itself (because it's the parser that reports them).

22 years agoUse PyErr_WarnExplicit() to warn about hex/oct constants, so the
Guido van Rossum [Mon, 12 Aug 2002 21:54:46 +0000 (21:54 +0000)]
Use PyErr_WarnExplicit() to warn about hex/oct constants, so the
correct filename and line number are reported.

22 years agoUpdated for the current state of affairs.
Jack Jansen [Mon, 12 Aug 2002 20:46:18 +0000 (20:46 +0000)]
Updated for the current state of affairs.

22 years agoNew names.
Guido van Rossum [Mon, 12 Aug 2002 20:20:39 +0000 (20:20 +0000)]
New names.

22 years agoMake sure that *any* object whose id() is used as a memo key is kept
Guido van Rossum [Mon, 12 Aug 2002 20:20:08 +0000 (20:20 +0000)]
Make sure that *any* object whose id() is used as a memo key is kept
alive in the memo.  This fixes SF bug 592567.

22 years agok_mul(): Moved an assert down. In a debug build, interrupting a
Tim Peters [Mon, 12 Aug 2002 19:43:49 +0000 (19:43 +0000)]
k_mul():  Moved an assert down.  In a debug build, interrupting a
multiply via Ctrl+C could cause a NULL-pointer dereference due to
the assert.

22 years agok_mul(): Heh -- I checked in two fixes for the last problem. Only keep
Tim Peters [Mon, 12 Aug 2002 19:38:01 +0000 (19:38 +0000)]
k_mul():  Heh -- I checked in two fixes for the last problem.  Only keep
the good one <wink>.  Also checked in a test-aid by mistake.

22 years agok_mul(): White-box testing turned up that (ah+al)*(bh+bl) can, in rare
Tim Peters [Mon, 12 Aug 2002 19:30:26 +0000 (19:30 +0000)]
k_mul():  White-box testing turned up that (ah+al)*(bh+bl) can, in rare
cases, overflow the allocated result object by 1 bit.  In such cases,
it would have been brought back into range if we subtracted al*bl and
ah*bh from it first, but I don't want to do that because it hurts cache
behavior.  Instead we just ignore the excess bit when it appears -- in
effect, this is forcing unsigned mod BASE**(asize + bsize) arithmetic
in a case where that doesn't happen all by itself.

22 years agoFix MSVC warnings.
Guido van Rossum [Mon, 12 Aug 2002 19:25:08 +0000 (19:25 +0000)]
Fix MSVC warnings.

22 years agoRefactor how __dict__ and __weakref__ interact with __slots__.
Guido van Rossum [Mon, 12 Aug 2002 19:05:44 +0000 (19:05 +0000)]
Refactor how __dict__ and __weakref__ interact with __slots__.

1. You can now have __dict__ and/or __weakref__ in your __slots__
   (before only __weakref__ was supported).  This is treated
   differently than before: it merely sets a flag that the object
   should support the corresponding magic.

2. Dynamic types now always have descriptors __dict__ and __weakref__
   thrust upon them.  If the type in fact does not support one or the
   other, that descriptor's __get__ method will raise AttributeError.

3. (This is the reason for all this; it fixes SF bug 575229, reported
   by Cesar Douady.)  Given this code:
      class A(object): __slots__ = []
      class B(object): pass
      class C(A, B): __slots__ = []
   the class object for C was broken; its size was less than that of
   B, and some descriptors on B could cause a segfault.  C now
   correctly inherits __weakrefs__ and __dict__ from B, even though A
   is the "primary" base (C.__base__ is A).

4. Some code cleanup, and a few comments added.

22 years agox_mul(): Made life easier for C optimizers in the "grade school"
Tim Peters [Mon, 12 Aug 2002 18:25:43 +0000 (18:25 +0000)]
x_mul():  Made life easier for C optimizers in the "grade school"
algorithm.  MSVC 6 wasn't impressed <wink>.

Something odd:  the x_mul algorithm appears to get substantially worse
than quadratic time as the inputs grow larger:

bits in each input   x_mul time   k_mul time
------------------   ----------   ----------
             15360         0.01         0.00
             30720         0.04         0.01
             61440         0.16         0.04
            122880         0.64         0.14
            245760         2.56         0.40
            491520        10.76         1.23
            983040        71.28         3.69
           1966080       459.31        11.07

That is, x_mul is perfectly quadratic-time until a little burp at
2.56->10.76, and after that goes to hell in a hurry.  Under Karatsuba,
doubling the input size "should take" 3 times longer instead of 4, and
that remains the case throughout this range.  I conclude that my "be nice
to the cache" reworkings of k_mul() are paying.

22 years agok_mul() and long_mul(): I'm confident that the Karatsuba algorithm is
Tim Peters [Mon, 12 Aug 2002 17:36:03 +0000 (17:36 +0000)]
k_mul() and long_mul():  I'm confident that the Karatsuba algorithm is
correct now, so added some final comments, did some cleanup, and enabled
it for all long-int multiplies.  The KARAT envar no longer matters,
although I left some #if 0'ed code in there for my own use (temporary).
k_mul() is still much slower than x_mul() if the inputs have very
differenent sizes, and that still needs to be addressed.

22 years agoPortable way of producing unsigned 32-bit hex output to print the
Guido van Rossum [Mon, 12 Aug 2002 15:26:05 +0000 (15:26 +0000)]
Portable way of producing unsigned 32-bit hex output to print the
CRCs.

22 years agoShut up warnings about hex()/oct() that can't be avoided.
Guido van Rossum [Mon, 12 Aug 2002 15:16:20 +0000 (15:16 +0000)]
Shut up warnings about hex()/oct() that can't be avoided.

22 years agoAvoid warnings about <<. external_attr is now an unsigned long.
Guido van Rossum [Mon, 12 Aug 2002 15:15:51 +0000 (15:15 +0000)]
Avoid warnings about <<.  external_attr is now an unsigned long.

22 years agok_mul: Rearranged computation for better cache use. Ignored overflow
Tim Peters [Mon, 12 Aug 2002 15:08:20 +0000 (15:08 +0000)]
k_mul:  Rearranged computation for better cache use.  Ignored overflow
(it's possible, but should be harmless -- this requires more thought,
and allocating enough space in advance to prevent it requires exactly
as much thought, to know exactly how much that is -- the end result
certainly fits in the allocated space -- hmm, but that's really all
the thought it needs!  borrows/carries out of the high digits really
are harmless).

22 years agoCorrect PyAPI_FUNC to PyAPI_DATA - sorry Jack.
Mark Hammond [Mon, 12 Aug 2002 13:06:35 +0000 (13:06 +0000)]
Correct PyAPI_FUNC to PyAPI_DATA - sorry Jack.

22 years agoAdd name mangling for new PyUnicode_FromOrdinal() and fix declaration
Marc-André Lemburg [Mon, 12 Aug 2002 08:19:10 +0000 (08:19 +0000)]
Add name mangling for new PyUnicode_FromOrdinal() and fix declaration
to use new extern macro.

22 years agoExcise DL_EXPORT from Include.
Mark Hammond [Mon, 12 Aug 2002 07:21:58 +0000 (07:21 +0000)]
Excise DL_EXPORT from Include.

Thanks to Skip Montanaro and Kalle Svensson for the patches.

22 years agox_mul(): This failed to normalize its result.
Tim Peters [Mon, 12 Aug 2002 06:17:58 +0000 (06:17 +0000)]
x_mul():  This failed to normalize its result.

k_mul():  This didn't allocate enough result space when one input had
more than twice as many bits as the other.  This was partly hidden by
that x_mul() didn't normalize its result.

The Karatsuba recurrence is pretty much hosed if the inputs aren't
roughly the same size.  If one has at least twice as many bits as the
other, we get a degenerate case where the "high half" of the smaller
input is 0.  Added a special case for that, for speed, but despite that
it helped, this can still be much slower than the "grade school" method.
It seems to take a really wild imbalance to trigger that; e.g., a
2**22-bit input times a 1000-bit input on my box runs about twice as slow
under k_mul than under x_mul.  This still needs to be addressed.

I'm also not sure that allocating a->ob_size + b->ob_size digits is
enough, given that this is computing k = (ah+al)*(bh+bl) instead of
k = (ah-al)*(bl-bh); i.e., it's certainly enough for the final result,
but it's vaguely possible that adding in the "artificially" large k may
overflow that temporarily.  If so, an assert will trigger in the debug
build, but we'll probably compute the right result anyway(!).

22 years agoIntroduced helper functions v_iadd and v_isub, for in-place digit-vector
Tim Peters [Mon, 12 Aug 2002 05:09:36 +0000 (05:09 +0000)]
Introduced helper functions v_iadd and v_isub, for in-place digit-vector
addition and subtraction.  Reworked the tail end of k_mul() to use them.
This saves oodles of one-shot longobject allocations (this is a triply-
recursive routine, so saving one allocation in the body saves 3**n
allocations at depth n; we actually save 2 allocations in the body).

22 years agoNew news about __class__ assignment restrictions and speed-up of
Guido van Rossum [Mon, 12 Aug 2002 03:42:03 +0000 (03:42 +0000)]
New news about __class__ assignment restrictions and speed-up of
new-style object creation/deallocation.

Moved all news about type/class unification and new-stype classes to a
separate section at the top.

22 years agoRevert what looks like a typo from the last checkin
Neal Norwitz [Mon, 12 Aug 2002 03:33:32 +0000 (03:33 +0000)]
Revert what looks like a typo from the last checkin

22 years agok_mul(): Repaired another typo in another comment.
Tim Peters [Mon, 12 Aug 2002 02:54:10 +0000 (02:54 +0000)]
k_mul():  Repaired another typo in another comment.

22 years agok_mul(): Repaired typo in comment.
Tim Peters [Mon, 12 Aug 2002 02:43:58 +0000 (02:43 +0000)]
k_mul():  Repaired typo in comment.

22 years agoCautious introduction of a patch that started from
Tim Peters [Mon, 12 Aug 2002 02:31:19 +0000 (02:31 +0000)]
Cautious introduction of a patch that started from
SF 560379:  Karatsuba multiplication.
Lots of things were changed from that.  This needs a lot more testing,
for correctness and speed, the latter especially when bit lengths are
unbalanced.  For now, the Karatsuba code gets invoked if and only if
envar KARAT exists.

22 years agoFixed misspelling in comment.
Tim Peters [Sun, 11 Aug 2002 18:28:09 +0000 (18:28 +0000)]
Fixed misspelling in comment.

22 years agoint_lshift(): Simplified/sped overflow-checking.
Tim Peters [Sun, 11 Aug 2002 17:54:42 +0000 (17:54 +0000)]
int_lshift():  Simplified/sped overflow-checking.

22 years agoExtend stripid() to handle strings ending in more than one '>'.
Ka-Ping Yee [Sun, 11 Aug 2002 15:11:33 +0000 (15:11 +0000)]
Extend stripid() to handle strings ending in more than one '>'.
Add resolve() to handle looking up objects and names (fix SF bug 586931).
Add a nicer error message when given a filename that doesn't exist.

22 years agoReset errno to zero after calling PyErr_Warn(). It can potentially do
Guido van Rossum [Sun, 11 Aug 2002 14:06:15 +0000 (14:06 +0000)]
Reset errno to zero after calling PyErr_Warn().  It can potentially do
a lot of work, including I/O (e.g. to import warnings.py), which might
affect errno.

22 years agoUse a better check for overflow from a<<b.
Guido van Rossum [Sun, 11 Aug 2002 14:04:13 +0000 (14:04 +0000)]
Use a better check for overflow from a<<b.

22 years agoAdd C API PyUnicode_FromOrdinal() which exposes unichr() at C level.
Marc-André Lemburg [Sun, 11 Aug 2002 12:23:04 +0000 (12:23 +0000)]
Add C API PyUnicode_FromOrdinal() which exposes unichr() at C level.

u'%c' will now raise a ValueError in case the argument is an
integer outside the valid range of Unicode code point ordinals.

Closes SF bug #593581.

22 years agoImplement stage B0 of PEP 237: add warnings for operations that
Guido van Rossum [Sun, 11 Aug 2002 04:24:12 +0000 (04:24 +0000)]
Implement stage B0 of PEP 237: add warnings for operations that
currently return inconsistent results for ints and longs; in
particular: hex/oct/%u/%o/%x/%X of negative short ints, and x<<n that
either loses bits or changes sign.  (No warnings for repr() of a long,
though that will also change to lose the trailing 'L' eventually.)

This introduces some warnings in the test suite; I'll take care of
those later.

22 years agotest_saveall(): Another small simplification; plus s/l/L/g.
Tim Peters [Sun, 11 Aug 2002 04:15:09 +0000 (04:15 +0000)]
test_saveall():  Another small simplification; plus s/l/L/g.
test_del(), test_del_newclass():  No need to use apply() in these.

22 years agoAnd one more simplification to test_saveall().
Tim Peters [Sat, 10 Aug 2002 21:32:16 +0000 (21:32 +0000)]
And one more simplification to test_saveall().

22 years agotest_saveall(): Simplified a little, given that we only expect one item
Tim Peters [Sat, 10 Aug 2002 21:29:56 +0000 (21:29 +0000)]
test_saveall():  Simplified a little, given that we only expect one item
in gc.garbage (so no need to loop looking for it -- it's there or it's
not).

22 years agoIf any trash happened to be sitting around waiting to get collected at
Tim Peters [Sat, 10 Aug 2002 21:20:54 +0000 (21:20 +0000)]
If any trash happened to be sitting around waiting to get collected at
the time it's called, test_saveall() made it look a leak, triggering
bogus warnings from regrtest's -l (findleaks) mode.

22 years agoConvert characters from the locale's encoding on output.
Martin v. Löwis [Sat, 10 Aug 2002 12:22:12 +0000 (12:22 +0000)]
Convert characters from the locale's encoding on output.
Reject characters outside the locale's encoding on input.

22 years agoFixed new typos, added a little info about ~sort versus "hint"s.
Tim Peters [Sat, 10 Aug 2002 07:04:01 +0000 (07:04 +0000)]
Fixed new typos, added a little info about ~sort versus "hint"s.

22 years agoClarify that the interruptable popen fixes aren't used under Win9x.
Mark Hammond [Sat, 10 Aug 2002 06:26:31 +0000 (06:26 +0000)]
Clarify that the interruptable popen fixes aren't used under Win9x.

22 years agoDisallow class assignment completely unless both old and new are heap
Guido van Rossum [Sat, 10 Aug 2002 05:42:07 +0000 (05:42 +0000)]
Disallow class assignment completely unless both old and new are heap
types.  This prevents nonsense like 2.__class__ = bool or
True.__class__ = int.

22 years ago1. Combined the base and length arrays into a single array of structs.
Tim Peters [Sat, 10 Aug 2002 05:21:15 +0000 (05:21 +0000)]
1. Combined the base and length arrays into a single array of structs.
   This is friendlier for caches.

2. Cut MIN_GALLOP to 7, but added a per-sort min_gallop vrbl that adapts
   the "get into galloping mode" threshold higher when galloping isn't
   paying, and lower when it is.  There's no known case where this hurts.
   It's (of course) neutral for /sort, \sort and =sort.  It also happens
   to be neutral for !sort.  It cuts a tiny # of compares in 3sort and +sort.
   For *sort, it reduces the # of compares to better than what this used to
   do when MIN_GALLOP was hardcoded to 10 (it did about 0.1% more *sort
   compares before, but given how close we are to the limit, this is "a
   lot"!).  %sort used to do about 1.5% more compares, and ~sort about
   3.6% more.  Here are exact counts:

 i    *sort    3sort    +sort    %sort    ~sort    !sort
15   449235    33019    33016    51328   188720    65534  before
     448885    33016    33007    50426   182083    65534  after
      0.08%    0.01%    0.03%    1.79%    3.65%    0.00%  %ch from after

16   963714    65824    65809   103409   377634   131070
     962991    65821    65808   101667   364341   131070
      0.08%    0.00%    0.00%    1.71%    3.65%    0.00%

17  2059092   131413   131362   209130   755476   262142
    2057533   131410   131361   206193   728871   262142
      0.08%    0.00%    0.00%    1.42%    3.65%    0.00%

18  4380687   262440   262460   421998  1511174   524286
    4377402   262437   262459   416347  1457945   524286
      0.08%    0.00%    0.00%    1.36%    3.65%    0.00%

19  9285709   524581   524634   848590  3022584  1048574
    9278734   524580   524633   837947  2916107  1048574
      0.08%    0.00%    0.00%    1.27%    3.65%    0.00%

20 19621118  1048960  1048942  1715806  6045418  2097150
   19606028  1048958  1048941  1694896  5832445  2097150
      0.08%    0.00%    0.00%    1.23%    3.65%    0.00%

3. Added some key asserts I overlooked before.

4. Updated the doc file.

22 years agoThe samplesort-vs-mergesort #-of-comparisons comparisons were captured
Tim Peters [Sat, 10 Aug 2002 03:04:33 +0000 (03:04 +0000)]
The samplesort-vs-mergesort #-of-comparisons comparisons were captured
before %sort was introduced.  Redid them (the numbers change, but the
conclusions don't).  Also did the samplesort counts with the released
2.2.1, as they're slightly different under the last CVS 2.3 samplesort
(some higher, some lower -- CVS had been changed to stop doing the
special-case business on recursive samplesort calls).

22 years agoFix a typo in the mktemp -> mkstemp patch.
Guido van Rossum [Sat, 10 Aug 2002 00:17:59 +0000 (00:17 +0000)]
Fix a typo in the mktemp -> mkstemp patch.

22 years agoAccomodate the packaging changes when we unpack into the dev/doc/ area
Fred Drake [Fri, 9 Aug 2002 22:56:46 +0000 (22:56 +0000)]
Accomodate the packaging changes when we unpack into the dev/doc/ area
on python.org.

22 years agoLots of changes to the packaging of the documentation, all to keep
Fred Drake [Fri, 9 Aug 2002 20:20:50 +0000 (20:20 +0000)]
Lots of changes to the packaging of the documentation, all to keep
directories clean where the packages are unpacked.  Each package now
contains a single directory, Python-Docs-<version>/, which contains the
files for that version of the documentation.

Closes SF feature request #567576.

22 years agoA tool to transform gprof(1) output into HTML, so you can click on a
Guido van Rossum [Fri, 9 Aug 2002 20:07:34 +0000 (20:07 +0000)]
A tool to transform gprof(1) output into HTML, so you can click on a
function name and go to the corresponding entry.

22 years agoWhitespace normalization.
Guido van Rossum [Fri, 9 Aug 2002 19:18:25 +0000 (19:18 +0000)]
Whitespace normalization.

22 years agoAdd tests for weakref support for generator-iterators.
Fred Drake [Fri, 9 Aug 2002 18:37:10 +0000 (18:37 +0000)]
Add tests for weakref support for generator-iterators.
Part of fixing SF bug #591704.

22 years agoAdd weakref support generator-iterators.
Fred Drake [Fri, 9 Aug 2002 18:35:52 +0000 (18:35 +0000)]
Add weakref support generator-iterators.
Part of fixing SF bug #591704.

22 years agoAdd support for the iterator protocol to weakref proxy objects.
Fred Drake [Fri, 9 Aug 2002 18:34:16 +0000 (18:34 +0000)]
Add support for the iterator protocol to weakref proxy objects.
Part of fixing SF bug #591704.

22 years agoThere's no distinction among 'user', 'group' and 'world' permissions
Tim Peters [Fri, 9 Aug 2002 18:13:51 +0000 (18:13 +0000)]
There's no distinction among 'user', 'group' and 'world' permissions
on Win32, so tests that assume there are such distinctions can't
pass.  Fiddled them to work.

22 years agoWhitespace normalization.
Tim Peters [Fri, 9 Aug 2002 18:01:01 +0000 (18:01 +0000)]
Whitespace normalization.

22 years agoFor new-style classes, we can now test for tp_del instead of asking
Guido van Rossum [Fri, 9 Aug 2002 17:39:14 +0000 (17:39 +0000)]
For new-style classes, we can now test for tp_del instead of asking
for a __del__ attribute, to see if there's a finalizer.

22 years agoTest finalizers and GC from inside __del__ for new classes.
Guido van Rossum [Fri, 9 Aug 2002 17:38:16 +0000 (17:38 +0000)]
Test finalizers and GC from inside __del__ for new classes.

22 years agoCredit to Oren for the file-iterator patch.
Guido van Rossum [Fri, 9 Aug 2002 17:17:07 +0000 (17:17 +0000)]
Credit to Oren for the file-iterator patch.

22 years agoNews about the tempfile rewrite.
Guido van Rossum [Fri, 9 Aug 2002 17:16:30 +0000 (17:16 +0000)]
News about the tempfile rewrite.

22 years agoMassive changes from SF 589982 (tempfile.py rewrite, by Zack
Guido van Rossum [Fri, 9 Aug 2002 16:38:32 +0000 (16:38 +0000)]
Massive changes from SF 589982 (tempfile.py rewrite, by Zack
Weinberg).  This changes all uses of deprecated tempfile functions to
the recommended ones.

22 years agoDoc portion of SF 589982 (tempfile.py rewrite, by Zack Weinberg).
Guido van Rossum [Fri, 9 Aug 2002 16:16:30 +0000 (16:16 +0000)]
Doc portion of SF 589982 (tempfile.py rewrite, by Zack Weinberg).

Fred, please review!

22 years agoCheck-in of the most essential parts of SF 589982 (tempfile.py
Guido van Rossum [Fri, 9 Aug 2002 16:14:33 +0000 (16:14 +0000)]
Check-in of the most essential parts of SF 589982 (tempfile.py
rewrite, by Zack Weinberg).  This replaces most code in tempfile.py
(please review!!!) and adds extensive unit tests for it.

This will cause some warnings in the test suite; I'll check those in
soon, and also the docs.

22 years agoTest for Neil's fix to correctly invoke __rmul__.
Guido van Rossum [Fri, 9 Aug 2002 16:11:37 +0000 (16:11 +0000)]
Test for Neil's fix to correctly invoke __rmul__.

22 years agoNews about Neil's fix to correctly invoke __rmul__.
Guido van Rossum [Fri, 9 Aug 2002 15:57:34 +0000 (15:57 +0000)]
News about Neil's fix to correctly invoke __rmul__.

22 years agoUnicode replace() method with empty pattern argument should fail, like
Guido van Rossum [Fri, 9 Aug 2002 15:36:48 +0000 (15:36 +0000)]
Unicode replace() method with empty pattern argument should fail, like
it does for 8-bit strings.

22 years agoOnly call sq_repeat if the object does not have a nb_multiply slot. One
Neil Schemenauer [Fri, 9 Aug 2002 15:20:48 +0000 (15:20 +0000)]
Only call sq_repeat if the object does not have a nb_multiply slot.  One
example of where this changes behavior is when a new-style instance
defines '__mul__' and '__rmul__' and is multiplied by an int.  Before the
change the '__rmul__' method is never called, even if the int is the
left operand.

22 years agoNew entries to track the DOM API growth. These match names exposed in
Fred Drake [Fri, 9 Aug 2002 14:57:55 +0000 (14:57 +0000)]
New entries to track the DOM API growth.  These match names exposed in
PyXML 0.8.

22 years agoWhen installing the "python" link in bindir also test for a pre-existing
Jack Jansen [Fri, 9 Aug 2002 14:42:57 +0000 (14:42 +0000)]
When installing the "python" link in bindir also test for a pre-existing
symlink and remove it.

22 years ago- Precompile py files in Mac subtree after installing
Jack Jansen [Fri, 9 Aug 2002 14:15:46 +0000 (14:15 +0000)]
- Precompile py files in Mac subtree after installing
- Pre-cache .rsrc files in Mac subtree after installing
- Fixed nameclash in Make variables

22 years ago- Check not only that cache file exists, but also that it is newer than
Jack Jansen [Fri, 9 Aug 2002 13:44:03 +0000 (13:44 +0000)]
- Check not only that cache file exists, but also that it is newer than
  the applesingle file.
- Added optional verbose option for cachersrc tool.

22 years agoTool to pre-created cached .rsrc.df.rsrc files in the Lib directories,
Jack Jansen [Fri, 9 Aug 2002 13:42:55 +0000 (13:42 +0000)]
Tool to pre-created cached .rsrc.df.rsrc files in the Lib directories,
similar to compileall.py.

22 years agoDocument that -u puts stdin, stdout, and stderr in binary mode.
Sjoerd Mullender [Fri, 9 Aug 2002 13:37:31 +0000 (13:37 +0000)]
Document that -u puts stdin, stdout, and stderr in binary mode.

22 years agoOn Cygwin, put stdin, stderr, and stdout in binary mode when the -u
Sjoerd Mullender [Fri, 9 Aug 2002 13:35:18 +0000 (13:35 +0000)]
On Cygwin, put stdin, stderr, and stdout in binary mode when the -u
flag is given (to mimic native Windows).

22 years agoObsolete now that there's a python implementation of strptime in the
Jack Jansen [Fri, 9 Aug 2002 10:22:11 +0000 (10:22 +0000)]
Obsolete now that there's a python implementation of strptime in the
standard lib.

22 years agoPatch by Russel Owen: if we have command line arguments zap pyc files
Jack Jansen [Fri, 9 Aug 2002 10:17:28 +0000 (10:17 +0000)]
Patch by Russel Owen: if we have command line arguments zap pyc files
in the directories given.

22 years agoFix to ensure consistent 'repr' and 'str' results between Python
Steve Purcell [Fri, 9 Aug 2002 09:46:23 +0000 (09:46 +0000)]
Fix to ensure consistent 'repr' and 'str' results between Python
versions, since 'repr(new_style_class) != repr(classic_class)'.
Suggested by Jeremy Hylton.

22 years agoDepracated some non-carbon modules.
Jack Jansen [Fri, 9 Aug 2002 09:03:31 +0000 (09:03 +0000)]
Depracated some non-carbon modules.

22 years agoThis file should have gone long ago.
Jack Jansen [Fri, 9 Aug 2002 09:02:01 +0000 (09:02 +0000)]
This file should have gone long ago.

22 years agoRepaired a braino in the description of bad minrun values.
Tim Peters [Fri, 9 Aug 2002 05:06:44 +0000 (05:06 +0000)]
Repaired a braino in the description of bad minrun values.

22 years agoSF bug #592645 fix memory leak in socket.getaddrinfo
Neal Norwitz [Fri, 9 Aug 2002 03:37:42 +0000 (03:37 +0000)]
SF bug #592645 fix memory leak in socket.getaddrinfo

22 years agoUpdate the text on the Expat module and library.
Fred Drake [Fri, 9 Aug 2002 02:39:13 +0000 (02:39 +0000)]
Update the text on the Expat module and library.

22 years agoMajor speedup for new-style class creation. Turns out there was some
Guido van Rossum [Fri, 9 Aug 2002 02:14:34 +0000 (02:14 +0000)]
Major speedup for new-style class creation.  Turns out there was some
trampolining going on with the tp_new descriptor, where the inherited
PyType_GenericNew was overwritten with the much slower slot_tp_new
which would end up calling tp_new_wrapper which would eventually call
PyType_GenericNew.  Add a special case for this to update_one_slot().

XXX Hope there isn't a loophole in this.  I'll buy the first person to
point out a bug in the reasoning a beer.

Backport candidate (but I won't do it).

22 years agoMoved inplace add and multiply methods from UserString to MutableString.
Raymond Hettinger [Fri, 9 Aug 2002 01:37:06 +0000 (01:37 +0000)]
Moved inplace add and multiply methods from UserString to MutableString.
Closes SF Bug #592573 where inplace add mutated a UserString.
Added unittests to verify the bug is cleared.

22 years agoMoved special case for tuples from iterobject.c to
Raymond Hettinger [Fri, 9 Aug 2002 01:30:17 +0000 (01:30 +0000)]
Moved special case for tuples from iterobject.c to
tupleobject.c. Makes the code in iterobject.c cleaner
and speeds-up the general case by not checking for
tuples everytime.   SF Patch #592065.

22 years agoRevised the test suite for 'contains' to use the test() function argument
Raymond Hettinger [Fri, 9 Aug 2002 00:43:38 +0000 (00:43 +0000)]
Revised the test suite for 'contains' to use the test() function argument
rather than vereq().  While it was effectively testing regular strings, it
ignored the test() function argument when called by test_userstring.py.

22 years agoBy popular demand the frameworkinstall target now installs everything:
Jack Jansen [Fri, 9 Aug 2002 00:18:21 +0000 (00:18 +0000)]
By popular demand the frameworkinstall target now installs everything:
the framework, the MacOSX apps and the unix tools.
Most of the hard work is done by Mac/OSX/Makefile.

Also, it should now be possible to install in a different directory,
such as /tmp/dist/Library/Frameworks, for building binary installers.
The fink crowd wanted this.

22 years agoSignificant speedup in new-style object creation: in slot_tp_new(),
Guido van Rossum [Thu, 8 Aug 2002 21:57:53 +0000 (21:57 +0000)]
Significant speedup in new-style object creation: in slot_tp_new(),
intern the string "__new__" so we can call PyObject_GetAttr() rather
than PyObject_GetAttrString().  (Though it's a mystery why slot_tp_new
is being called when a class doesn't define __new__.  I'll look into
that tomorrow.)

2.2 backport candidate (but I won't do it).