]> granicus.if.org Git - python/log
python
20 years agoRevert creation of launcher.exe
Martin v. Löwis [Wed, 8 Sep 2004 15:57:36 +0000 (15:57 +0000)]
Revert creation of launcher.exe

20 years agoRemove usage of locale.getlocale in favor or setlocale(LC_NUMERIC, None) .
Brett Cannon [Wed, 8 Sep 2004 02:02:41 +0000 (02:02 +0000)]
Remove usage of locale.getlocale in favor or setlocale(LC_NUMERIC, None) .
Also added a comment about why the code is bother to see what setlocale thinks
the set locale is.

Closes bug #1023798.

20 years agoSF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
Walter Dörwald [Tue, 7 Sep 2004 20:24:22 +0000 (20:24 +0000)]
SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
decoding incomplete input (when the input stream is temporarily exhausted).
codecs.StreamReader now implements buffering, which enables proper
readline support for the UTF-16 decoders. codecs.StreamReader.read()
has a new argument chars which specifies the number of characters to
return. codecs.StreamReader.readline() and codecs.StreamReader.readlines()
have a new argument keepends. Trailing "\n"s will be stripped from the lines
if keepends is false. Added C APIs PyUnicode_DecodeUTF8Stateful and
PyUnicode_DecodeUTF16Stateful.

20 years agoApply patch from http://python.org/sf/728330 to fix socket module compilation on...
Trent Mick [Tue, 7 Sep 2004 17:48:26 +0000 (17:48 +0000)]
Apply patch from http://python.org/sf/728330 to fix socket module compilation on Solaris 2.6, HP-UX 11, AIX 5.1 and (possibly) some IRIX versions.

20 years agoAdd support for launcher.exe
Martin v. Löwis [Tue, 7 Sep 2004 15:40:12 +0000 (15:40 +0000)]
Add support for launcher.exe

20 years agoImplement conditional extensions through launcher.exe.
Martin v. Löwis [Tue, 7 Sep 2004 15:39:29 +0000 (15:39 +0000)]
Implement conditional extensions through launcher.exe.

20 years agoSupport Python 2.2.
Martin v. Löwis [Tue, 7 Sep 2004 15:37:26 +0000 (15:37 +0000)]
Support Python 2.2.

20 years agoRemove debugging print (not triggered by test suite) and add XXX comment about how...
Jeremy Hylton [Tue, 7 Sep 2004 15:36:48 +0000 (15:36 +0000)]
Remove debugging print (not triggered by test suite) and add XXX comment about how the code should raise a SyntaxError.

20 years agoAdd launcher program
Martin v. Löwis [Tue, 7 Sep 2004 15:36:46 +0000 (15:36 +0000)]
Add launcher program

20 years agocompiler.transformer: correct lineno attribute when possible
Jeremy Hylton [Tue, 7 Sep 2004 15:28:01 +0000 (15:28 +0000)]
compiler.transformer: correct lineno attribute when possible
SF patch #1015989

The basic idea of this patch is to compute lineno attributes for all AST nodes.  The actual
implementation lead to a lot of restructing and code cleanup.

The generated AST nodes now have an optional lineno argument to constructor.  Remove the
top-level asList(), since it didn't seem to serve any purpose.  Add an __iter__ to ast nodes.
Use isinstance() instead of explicit type tests.

Change transformer to use the new lineno attribute, which replaces three lines of code with one.
Use universal newlines so that we can get rid of special-case code for line endings.  Use
lookup_node() in a few more frequently called, but simple com_xxx methods().  Change string
exception to class exception.

20 years agoPorted test__locale to unittest.
Brett Cannon [Mon, 6 Sep 2004 23:30:27 +0000 (23:30 +0000)]
Ported test__locale to unittest.

20 years agoRemove redunandant assertions from last checkin.
Raymond Hettinger [Mon, 6 Sep 2004 23:02:37 +0000 (23:02 +0000)]
Remove redunandant assertions from last checkin.

20 years agoSF #1022953: binascii.a2b_hqx("") raises SystemError
Raymond Hettinger [Mon, 6 Sep 2004 22:58:37 +0000 (22:58 +0000)]
SF #1022953:  binascii.a2b_hqx("") raises SystemError

Several functions adopted the strategy of altering a full lengthed
string copy and resizing afterwards.  That would fail if the initial
string was short enough (0 or 1) to be interned.  Interning precluded
the subsequent resizing operation.

The solution was to make sure the initial string was at least two
characters long.

Added tests to verify that all binascii functions do not crater when
given an empty string argument.

20 years agoFix erroneous docstring comment.
Raymond Hettinger [Mon, 6 Sep 2004 07:04:09 +0000 (07:04 +0000)]
Fix erroneous docstring comment.

20 years agoAdd test_difflib_expect.html.
Martin v. Löwis [Mon, 6 Sep 2004 06:31:12 +0000 (06:31 +0000)]
Add test_difflib_expect.html.
Fix open Verbs.
Properly add "Edit with IDLE" to TclTk feature.

20 years agoMarkup nits.
Raymond Hettinger [Mon, 6 Sep 2004 01:01:08 +0000 (01:01 +0000)]
Markup nits.

20 years agoAdd missing close parenthesis.
Raymond Hettinger [Mon, 6 Sep 2004 00:42:14 +0000 (00:42 +0000)]
Add missing close parenthesis.

20 years agoSF bug #901654: split method documentation can be improved
Raymond Hettinger [Mon, 6 Sep 2004 00:12:04 +0000 (00:12 +0000)]
SF bug #901654:  split method documentation can be improved

* Discuss the algorithmic distinctions between s.split() and s.split(sep).
* Document the split behavior for empty strings.
* Note the behavior when maxsplit is zero.
* Include short examples.

20 years agoRework some wording.
Brett Cannon [Sun, 5 Sep 2004 19:42:15 +0000 (19:42 +0000)]
Rework some wording.

20 years agoFulfill Martin's request to use try/except rather than a "look before
Raymond Hettinger [Sun, 5 Sep 2004 00:00:42 +0000 (00:00 +0000)]
Fulfill Martin's request to use try/except rather than a "look before
you leap" approach.  Makes the early call to os.urandom() unnecessary.

20 years agoTeach a test about the different kinds of functions.
Raymond Hettinger [Sat, 4 Sep 2004 23:53:20 +0000 (23:53 +0000)]
Teach a test about the different kinds of functions.

20 years agoSF bug #1020540: a wrong link from "frame object" in lib index
Raymond Hettinger [Sat, 4 Sep 2004 21:14:34 +0000 (21:14 +0000)]
SF bug #1020540:  a wrong link from "frame object" in lib index

20 years agoSF bug #1022010: Import random fails
Raymond Hettinger [Sat, 4 Sep 2004 20:13:29 +0000 (20:13 +0000)]
SF bug #1022010:   Import random fails

* Complete the previous patch by making sure that the MachineRandom
  tests are only run when the underlying resource is available.

20 years agoChange the strategy for coping with time intensive tests from
Raymond Hettinger [Sat, 4 Sep 2004 20:09:13 +0000 (20:09 +0000)]
Change the strategy for coping with time intensive tests from
"all or none" to "all or some".

This provides much greater test coverage without eating much time.
It also makes it more likely that routine regression testing will
unearth bugs.

20 years agoAdded IGNORE_EXCEPTION_DETAIL comparison option. The need is explained
Tim Peters [Sat, 4 Sep 2004 17:21:02 +0000 (17:21 +0000)]
Added IGNORE_EXCEPTION_DETAIL comparison option.  The need is explained
in the new docs.

DocTestRunner.__run:  Separate the determination of the example outcome
from reporting that outcome, to squash brittle code duplication and
excessive nesting.

20 years agoAdded a couple names to __all__.
Tim Peters [Sat, 4 Sep 2004 15:04:06 +0000 (15:04 +0000)]
Added a couple names to __all__.

20 years agoSF bug 1017405: the keys() values() and items() DB methods were
Gregory P. Smith [Sat, 4 Sep 2004 01:36:59 +0000 (01:36 +0000)]
SF bug 1017405:  the keys() values() and items() DB methods were
ignoring their transaction (txn) argument.

20 years agoMinor aesthetic change in sre_parse.py, as suggested by Mike Coleman.
Gustavo Niemeyer [Fri, 3 Sep 2004 20:15:56 +0000 (20:15 +0000)]
Minor aesthetic change in sre_parse.py, as suggested by Mike Coleman.

20 years agoSF bug #1022010: Import random fails
Raymond Hettinger [Fri, 3 Sep 2004 19:09:22 +0000 (19:09 +0000)]
SF bug #1022010:  Import random fails

* trap NotImplementedError raised by os.urandom calls when not available
  on a particular system.

20 years agoFixing bug #817234, which made SRE get into an infinite loop on
Gustavo Niemeyer [Fri, 3 Sep 2004 18:11:59 +0000 (18:11 +0000)]
Fixing bug #817234, which made SRE get into an infinite loop on
empty final matches with finditer(). New test cases included
for this bug and for #581080.

20 years agoApplying modified version of patch #1018386, which fixes
Gustavo Niemeyer [Fri, 3 Sep 2004 17:06:10 +0000 (17:06 +0000)]
Applying modified version of patch #1018386, which fixes
some escaping bugs in SRE.

20 years agoAdd main program for icon file.
Martin v. Löwis [Fri, 3 Sep 2004 13:32:57 +0000 (13:32 +0000)]
Add main program for icon file.

20 years agoMake the api of the _dispatch() method more concrete. I have no idea if
Skip Montanaro [Fri, 3 Sep 2004 00:04:05 +0000 (00:04 +0000)]
Make the api of the _dispatch() method more concrete.  I have no idea if
this is the right way to document such things (Fred, help me out here :-),
but I got misled by the existing documentation and assumed the parameter
list was a *args sort of thing.

20 years agoThis commit was manufactured by cvs2svn to create tag 'r24a3'. v2.4a3
cvs2svn [Thu, 2 Sep 2004 16:38:20 +0000 (16:38 +0000)]
This commit was manufactured by cvs2svn to create tag 'r24a3'.

20 years agoupdate version
Anthony Baxter [Thu, 2 Sep 2004 16:38:20 +0000 (16:38 +0000)]
update version

20 years agorelease date
Anthony Baxter [Thu, 2 Sep 2004 16:37:15 +0000 (16:37 +0000)]
release date

20 years agoUpdate buildno for 2.4a3
Martin v. Löwis [Wed, 1 Sep 2004 18:29:25 +0000 (18:29 +0000)]
Update buildno for 2.4a3

20 years agoConditionalize Tcl feature
Martin v. Löwis [Wed, 1 Sep 2004 14:51:06 +0000 (14:51 +0000)]
Conditionalize Tcl feature

20 years ago[Bug #1011606] Only check file descriptors for exceptional conditions if the fd is...
Andrew M. Kuchling [Wed, 1 Sep 2004 14:04:51 +0000 (14:04 +0000)]
[Bug #1011606] Only check file descriptors for exceptional conditions if the fd is readable or writable

20 years agoWhitespace normalization.
Tim Peters [Wed, 1 Sep 2004 13:10:32 +0000 (13:10 +0000)]
Whitespace normalization.

20 years agoSF patch #1020188: Use Py_CLEAR where necessary to avoid crashes
Raymond Hettinger [Wed, 1 Sep 2004 07:02:44 +0000 (07:02 +0000)]
SF patch #1020188:  Use Py_CLEAR where necessary to avoid crashes
(Contributed by Dima Dorfman)

20 years ago- add missing \end{seealso}
Fred Drake [Wed, 1 Sep 2004 04:05:08 +0000 (04:05 +0000)]
- add missing \end{seealso}
- wrap long line

20 years agoRemove rotor from the build.
Raymond Hettinger [Tue, 31 Aug 2004 19:33:47 +0000 (19:33 +0000)]
Remove rotor from the build.

20 years agoRemove rotor and xreadlines from VC 6 build.
Raymond Hettinger [Tue, 31 Aug 2004 18:54:35 +0000 (18:54 +0000)]
Remove rotor and xreadlines from VC 6 build.

20 years agoAdd instructions for building Tix
Martin v. Löwis [Tue, 31 Aug 2004 16:22:09 +0000 (16:22 +0000)]
Add instructions for building Tix

20 years agoFix installdir for Tix
Martin v. Löwis [Tue, 31 Aug 2004 16:19:01 +0000 (16:19 +0000)]
Fix installdir for Tix

20 years agoRemove rotor and xreadlines from VC 7.1 build.
Tim Peters [Tue, 31 Aug 2004 14:29:12 +0000 (14:29 +0000)]
Remove rotor and xreadlines from VC 7.1 build.

20 years agoAdd item
Andrew M. Kuchling [Tue, 31 Aug 2004 13:57:02 +0000 (13:57 +0000)]
Add item

20 years agoRemove rotor, xreadlines modules
Andrew M. Kuchling [Tue, 31 Aug 2004 13:52:27 +0000 (13:52 +0000)]
Remove rotor, xreadlines modules

20 years agoAdd news item.
Andrew M. Kuchling [Tue, 31 Aug 2004 13:50:43 +0000 (13:50 +0000)]
Add news item.

20 years agoRemove mpz, rotor, xreadlines modules
Andrew M. Kuchling [Tue, 31 Aug 2004 13:50:12 +0000 (13:50 +0000)]
Remove mpz, rotor, xreadlines modules

20 years agoRemove rotor reference
Andrew M. Kuchling [Tue, 31 Aug 2004 13:49:36 +0000 (13:49 +0000)]
Remove rotor reference

20 years agoMissed some occurrences of test_mpz
Andrew M. Kuchling [Tue, 31 Aug 2004 13:45:22 +0000 (13:45 +0000)]
Missed some occurrences of test_mpz

20 years agoRemove mpz, rotor
Andrew M. Kuchling [Tue, 31 Aug 2004 13:43:19 +0000 (13:43 +0000)]
Remove mpz, rotor

20 years agoRemove mpzpi demo
Andrew M. Kuchling [Tue, 31 Aug 2004 13:42:11 +0000 (13:42 +0000)]
Remove mpzpi demo

20 years agoRemove test output for rotor, xreadline
Andrew M. Kuchling [Tue, 31 Aug 2004 13:41:04 +0000 (13:41 +0000)]
Remove test output for rotor, xreadline

20 years agoRemove mpz, rotor, xreadlines modules
Andrew M. Kuchling [Tue, 31 Aug 2004 13:37:25 +0000 (13:37 +0000)]
Remove mpz, rotor, xreadlines modules

20 years agoRemove rotor, xreadlines modules
Andrew M. Kuchling [Tue, 31 Aug 2004 13:31:42 +0000 (13:31 +0000)]
Remove rotor, xreadlines modules

20 years agoRemove test for mpz
Andrew M. Kuchling [Tue, 31 Aug 2004 13:29:28 +0000 (13:29 +0000)]
Remove test for mpz

20 years agoRemove tests for mpz, rotor, xreadlines
Andrew M. Kuchling [Tue, 31 Aug 2004 13:29:03 +0000 (13:29 +0000)]
Remove tests for mpz, rotor, xreadlines

20 years agoRemove rotor license
Andrew M. Kuchling [Tue, 31 Aug 2004 13:24:08 +0000 (13:24 +0000)]
Remove rotor license

20 years agoRemove docs for xreadlines, mpz, rotor
Andrew M. Kuchling [Tue, 31 Aug 2004 13:22:43 +0000 (13:22 +0000)]
Remove docs for xreadlines, mpz, rotor

20 years agoRemove xreadlines reference
Andrew M. Kuchling [Tue, 31 Aug 2004 13:21:07 +0000 (13:21 +0000)]
Remove xreadlines reference

20 years agoRemove TERMIOS module
Andrew M. Kuchling [Tue, 31 Aug 2004 13:06:16 +0000 (13:06 +0000)]
Remove TERMIOS module

20 years agoRemove TERMIOS docs
Andrew M. Kuchling [Tue, 31 Aug 2004 13:05:59 +0000 (13:05 +0000)]
Remove TERMIOS docs

20 years agoUse correct constant; remove reference to TERMIOS.py
Andrew M. Kuchling [Tue, 31 Aug 2004 13:05:36 +0000 (13:05 +0000)]
Use correct constant; remove reference to TERMIOS.py

20 years agoChange from Raymond: use pos/neg instead of +/- 1; minor edits
Andrew M. Kuchling [Tue, 31 Aug 2004 12:21:44 +0000 (12:21 +0000)]
Change from Raymond: use pos/neg instead of +/- 1; minor edits

20 years agoDescribe non-recursive re
Andrew M. Kuchling [Tue, 31 Aug 2004 12:07:43 +0000 (12:07 +0000)]
Describe non-recursive re

20 years agoAdd bug/patch counts
Andrew M. Kuchling [Tue, 31 Aug 2004 11:54:22 +0000 (11:54 +0000)]
Add bug/patch counts

20 years agoUse multi-line import
Andrew M. Kuchling [Tue, 31 Aug 2004 11:38:12 +0000 (11:38 +0000)]
Use multi-line import

20 years agoUpdate versions and dates; add PEP 328
Andrew M. Kuchling [Tue, 31 Aug 2004 11:26:23 +0000 (11:26 +0000)]
Update versions and dates; add PEP 328

20 years agoUpdated doc for getLogger()
Vinay Sajip [Tue, 31 Aug 2004 10:21:51 +0000 (10:21 +0000)]
Updated doc for getLogger()

20 years agoSF patch #1007189, multi-line imports, for instance:
Anthony Baxter [Tue, 31 Aug 2004 10:07:13 +0000 (10:07 +0000)]
SF patch #1007189, multi-line imports, for instance:
"from blah import (foo, bar
baz, bongo)"

20 years agoonward and upward
Anthony Baxter [Tue, 31 Aug 2004 09:53:05 +0000 (09:53 +0000)]
onward and upward

20 years agoAdd patch for Tix 8.1.4.
Martin v. Löwis [Tue, 31 Aug 2004 06:43:28 +0000 (06:43 +0000)]
Add patch for Tix 8.1.4.

20 years agoHardwareRandom: Go back to multiplying by 2**-BPF instead of using
Tim Peters [Tue, 31 Aug 2004 02:19:55 +0000 (02:19 +0000)]
HardwareRandom:  Go back to multiplying by 2**-BPF instead of using
ldexp.  Both methods are exact, and return the same results.  Turns out
multiplication is a few (but just a few) percent faster on my box.
They're both significantly faster than using struct with a Q format
to convert bytes to a 64-bit long (struct.unpack() appears to lose due
to the tuple creation/teardown overhead), and calling _hexlify is
significantly faster than doing bytes.encode('hex').  So we appear to
have hit a local minimum (wrt speed) here.

20 years agoTake advantage of the math library's ldexp for assembling a float by
Raymond Hettinger [Tue, 31 Aug 2004 01:05:15 +0000 (01:05 +0000)]
Take advantage of the math library's ldexp for assembling a float by
components without division and without roundoff error for properly
sized mantissas (i.e. on systems with 53 or more mantissa bits per
float).  Eliminates the previous implementation's rounding bias as
aptly demonstrated by Tim Peters.

20 years agoChanged Karatsuba cutoff to match current reality.
Tim Peters [Mon, 30 Aug 2004 23:18:23 +0000 (23:18 +0000)]
Changed Karatsuba cutoff to match current reality.

20 years agoMore cmd.exe exploitation.
Tim Peters [Mon, 30 Aug 2004 22:13:22 +0000 (22:13 +0000)]
More cmd.exe exploitation.

20 years agoSince it's impossible to build Python using VC7.1 on a command.com
Tim Peters [Mon, 30 Aug 2004 21:27:55 +0000 (21:27 +0000)]
Since it's impossible to build Python using VC7.1 on a command.com
system, exploit cmd.exe's setlocal function in this directory.

20 years agoUpdated test-runner .bat for new location of Tcl/Tk.
Tim Peters [Mon, 30 Aug 2004 21:14:51 +0000 (21:14 +0000)]
Updated test-runner .bat for new location of Tcl/Tk.

Replaced outcomes from native Tcl/Tk tests.  Maybe the diffs are legit,
maybe not.  I noticed that the Tcl results I'm replacing here claimed
both that there were no failures, and that one file had tests with
failures, so I wasn't inclined to trust them <wink>.

20 years agowin32_urandom(): There's no need to copy the generated byte string, so
Tim Peters [Mon, 30 Aug 2004 17:36:46 +0000 (17:36 +0000)]
win32_urandom():  There's no need to copy the generated byte string, so
don't.

20 years agowin32_urandom(): pass the function name to PyArg_ParseTuple, for better
Tim Peters [Mon, 30 Aug 2004 17:10:53 +0000 (17:10 +0000)]
win32_urandom():  pass the function name to PyArg_ParseTuple, for better
error msgs.

20 years agowin32_urandom(): Raise ValueError if the argument is negative.
Tim Peters [Mon, 30 Aug 2004 17:08:02 +0000 (17:08 +0000)]
win32_urandom():  Raise ValueError if the argument is negative.

20 years agowin32_urandom(): Rewrite to Python C standards (hard tabs, function name
Tim Peters [Mon, 30 Aug 2004 17:02:04 +0000 (17:02 +0000)]
win32_urandom():  Rewrite to Python C standards (hard tabs, function name
in first column, no parens around return value).

20 years agoThe distinction between comparison flags and reporting flags isn't unique
Tim Peters [Mon, 30 Aug 2004 16:19:24 +0000 (16:19 +0000)]
The distinction between comparison flags and reporting flags isn't unique
to unittest, so make it official:  new module constants COMPARISON_FLAGS
and REPORTING_FLAGS, which are bitmasks or'ing together the relevant
individual option flags.

set_unittest_reportflags():  Reworked to use REPORTING_FLAGS, and
simplified overly complicated flag logic.

class FakeModule:  Removed this; neither documented nor used.

20 years agoFix build error: \filename{/dev/urandom} -> \file{/dev/urandom}.
Johannes Gijsbers [Mon, 30 Aug 2004 15:03:23 +0000 (15:03 +0000)]
Fix build error: \filename{/dev/urandom} -> \file{/dev/urandom}.

20 years agoBug #1014775: update NEWS.help for changes in docutils.
Johannes Gijsbers [Mon, 30 Aug 2004 14:33:25 +0000 (14:33 +0000)]
Bug #1014775: update NEWS.help for changes in docutils.

20 years agoBug #1014770: apply some rest-foo and fix some docutils errors.
Johannes Gijsbers [Mon, 30 Aug 2004 14:27:11 +0000 (14:27 +0000)]
Bug #1014770: apply some rest-foo and fix some docutils errors.

20 years agoPatch #934356: if a module defines __all__, believe that rather than using
Johannes Gijsbers [Mon, 30 Aug 2004 14:13:04 +0000 (14:13 +0000)]
Patch #934356: if a module defines __all__, believe that rather than using
heuristics for filtering out imported names.

20 years agoWhitespace normalization.
Johannes Gijsbers [Mon, 30 Aug 2004 13:39:50 +0000 (13:39 +0000)]
Whitespace normalization.

20 years agoPatch #1003640: replace checkline() function parsing with new breakpoint logic:
Johannes Gijsbers [Mon, 30 Aug 2004 13:29:44 +0000 (13:29 +0000)]
Patch #1003640: replace checkline() function parsing with new breakpoint logic:

1) When a breakpoint is set via a function name:
- the breakpoint gets the lineno of the def statement
- a new funcname attribute is attached to the breakpoint

2) bdb.effective() calls new function checkfuncname() to handle:
- def statement is executed: don't break.
- a first executable line of a function with a breakpoint on the lineno of the
def statement is reached: break.

This fixes bugs 976878, 926369 and 875404. Thanks Ilya Sandler.

20 years agoAdd items
Andrew M. Kuchling [Mon, 30 Aug 2004 11:58:04 +0000 (11:58 +0000)]
Add items

20 years agoPatch #941486: add os.path.lexists(). Also fix bug #940578 by using lexists in glob...
Johannes Gijsbers [Mon, 30 Aug 2004 10:19:56 +0000 (10:19 +0000)]
Patch #941486: add os.path.lexists(). Also fix bug #940578 by using lexists in glob.glob.

20 years agoPickup Tk from tcltk directory.
Martin v. Löwis [Mon, 30 Aug 2004 09:22:30 +0000 (09:22 +0000)]
Pickup Tk from tcltk directory.

20 years agoBump Tk version to 8.4.7. Build into tcltk directory.
Martin v. Löwis [Mon, 30 Aug 2004 09:22:04 +0000 (09:22 +0000)]
Bump Tk version to 8.4.7. Build into tcltk directory.

20 years agoTeach the random module about os.urandom().
Raymond Hettinger [Mon, 30 Aug 2004 06:14:31 +0000 (06:14 +0000)]
Teach the random module about os.urandom().

* Use it for seeding when it is available.
* Provide an alternate generator based on it.

20 years agolong_pow(): Fix more instances of leaks in error cases.
Tim Peters [Mon, 30 Aug 2004 02:58:59 +0000 (02:58 +0000)]
long_pow():  Fix more instances of leaks in error cases.

Bugfix candidate -- although long_pow() is so different now I doubt a
patch would apply to 2.3.

20 years agoSF patch 936813: fast modular exponentiation
Tim Peters [Mon, 30 Aug 2004 02:44:38 +0000 (02:44 +0000)]
SF patch 936813: fast modular exponentiation

This checkin is adapted from part 2 (of 3) of Trevor Perrin's patch set.

BACKWARD INCOMPATIBILITY:  SHIFT must now be divisible by 5.  AFAIK,
nobody will care.  long_pow() could be complicated to worm around that,
if necessary.

long_pow():
  - BUGFIX:  This leaked the base and power when the power was negative
    (and so the computation delegated to float pow).
  - Instead of doing right-to-left exponentiation, do left-to-right.  This
    is more efficient for small bases, which is the common case.
  - In addition, if the exponent is large (more than FIVEARY_CUTOFF
    digits), precompute [a**i % c for i in range(32)], and go left to
    right 5 bits at a time.
l_divmod():
  - The signature changed so that callers who don't want the quotient,
    or don't want the remainder, can pass NULL in the slot they don't
    want.  This saves them from having to declare a vrbl for unwanted
    stuff, and remembering to decref it.
long_mod(), long_div(), long_classic_div():
  - Adjust to new l_divmod() signature, and simplified as a result.

20 years agoWhitespace normalization. test_difflib passes again.
Tim Peters [Sun, 29 Aug 2004 22:38:38 +0000 (22:38 +0000)]
Whitespace normalization.  test_difflib passes again.