cpython/Objects
Tim Peters 47e52ee0c5 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.
2004-08-30 02:44:38 +00:00
..
.cvsignore
abstract.c Check the type of values returned by __int__, __float__, __long__, 2004-07-19 16:29:17 +00:00
boolobject.c - bool() called without arguments now returns False rather than 2003-04-19 18:15:10 +00:00
bufferobject.c Correct code to advance ptr to be well-formed C. 2004-03-25 16:16:28 +00:00
cellobject.c
classobject.c Repair the same thinko in two places about handling of _Py_RefTotal in 2004-08-03 10:21:03 +00:00
cobject.c Make CObjects mutable. Fixes #477441. 2003-10-19 18:30:01 +00:00
complexobject.c Fix repr for negative imaginary part. Fixes #1013908. 2004-08-22 21:09:15 +00:00
descrobject.c Use PyDict_Contains() instead of PySequence_Contains(). 2003-12-13 11:58:56 +00:00
dictnotes.txt Fix typos and add some elaborations 2004-03-15 15:52:22 +00:00
dictobject.c Moved SunPro warning suppression into pyport.h and out of individual 2004-07-15 15:54:05 +00:00
enumobject.c Fix docstring typo. 2004-08-25 19:42:12 +00:00
fileobject.c dump HAVE_FOPENRF stuff - obsolete 2004-06-11 04:49:03 +00:00
floatobject.c Fix a couple of signed/unsigned comparison warnings 2004-07-08 01:55:58 +00:00
frameobject.c SF Bug #215126: Over restricted type checking on eval() function 2004-07-02 06:41:07 +00:00
funcobject.c This is my patch 2004-08-12 18:12:44 +00:00
genobject.c Patch #966493: Cleanup generator/eval_frame exposure. 2004-06-27 15:43:12 +00:00
intobject.c Stop producing or using OverflowWarning. PEP 237 thought this would 2004-08-25 02:14:08 +00:00
iterobject.c * Add unittests for iterators that report their length 2004-04-12 18:10:01 +00:00
listobject.c SF patch #1005778, Fix seg fault if list object is modified during list.index() 2004-08-13 03:18:29 +00:00
listsort.txt
longobject.c SF patch 936813: fast modular exponentiation 2004-08-30 02:44:38 +00:00
methodobject.c * Added a new method flag, METH_COEXIST. 2003-12-13 11:26:12 +00:00
moduleobject.c Remove code that tried to warn about shadowing builtin names after a 2003-07-16 22:04:11 +00:00
object.c SF bug #1004669: Type returned from .keys() is not checked 2004-08-07 04:55:30 +00:00
obmalloc.c whoops, I wanted that commented out by default, will add doc to Misc 2004-06-06 19:21:34 +00:00
rangeobject.c Bug 1003935: xrange overflows 2004-08-08 07:17:39 +00:00
setobject.c Moved SunPro warning suppression into pyport.h and out of individual 2004-07-15 15:54:05 +00:00
sliceobject.c SF bug #800796: Difference between hash() and __hash__() 2003-09-05 14:27:30 +00:00
stringobject.c SF Patch #1007087: Return new string for single subclass joins (Bug #1001011) 2004-08-23 23:23:54 +00:00
structseq.c Removed all uses of the out-of-favor __safe_for_unpickling__ magic 2003-02-01 02:16:37 +00:00
tupleobject.c Add a final permutation step to the tuple hash function. 2004-06-10 18:42:15 +00:00
typeobject.c Patch #980082: Missing INCREF in PyType_Ready. 2004-08-18 13:16:54 +00:00
unicodectype.c SF #989185: Drop unicode.iswide() and unicode.width() and add 2004-08-04 07:38:35 +00:00
unicodeobject.c PyUnicode_Join(): Bozo Alert. While this is chugging along, it may 2004-08-27 22:35:44 +00:00
unicodetype_db.h SF #989185: Drop unicode.iswide() and unicode.width() and add 2004-08-04 07:38:35 +00:00
weakrefobject.c Be more careful about maintaining the invariants; it was actually 2004-08-03 14:47:25 +00:00