cpython/Include
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
..
abstract.h Make PySequence_Fast_ITEMS public. (Thanks Skip.) 2004-03-12 16:38:17 +00:00
bitset.h
boolobject.h SF bug 994255: Py_RETURN_NONE causes too much warnings 2004-07-22 01:46:43 +00:00
bufferobject.h
cellobject.h
ceval.h Patch #966493: Cleanup generator/eval_frame exposure. 2004-06-27 15:43:12 +00:00
classobject.h
cobject.h Make CObjects mutable. Fixes #477441. 2003-10-19 18:30:01 +00:00
codecs.h
compile.h This is my patch #876198 plus a NEWS entry and a header frob. 2004-02-12 15:28:27 +00:00
complexobject.h
cStringIO.h
datetime.h Add missing backslash for PyDateTimeAPI->Delta_FromDelta() macro. 2004-06-28 00:48:30 +00:00
descrobject.h
dictobject.h Fix name problem in previous checkin: Dict not List 2003-12-26 17:17:49 +00:00
enumobject.h Implement and apply PEP 322, reverse iteration 2003-11-06 14:06:48 +00:00
errcode.h
eval.h
fileobject.h Add weakref support to array.array and file objects. 2004-05-31 00:35:52 +00:00
floatobject.h
frameobject.h SF Bug #215126: Over restricted type checking on eval() function 2004-07-02 06:41:07 +00:00
funcobject.h
genobject.h Patch #966493: Cleanup generator/eval_frame exposure. 2004-06-27 15:43:12 +00:00
graminit.h PEP-0318, @decorator-style. In Guido's words: 2004-08-02 06:10:11 +00:00
grammar.h
import.h
intobject.h
intrcheck.h
iterobject.h
listobject.h Fix typo in comment 2004-08-01 22:45:27 +00:00
longintrepr.h SF patch 936813: fast modular exponentiation 2004-08-30 02:44:38 +00:00
longobject.h
marshal.h Patch #923098: Share interned strings in marshal. 2004-06-27 16:51:46 +00:00
metagrammar.h
methodobject.h * Added a new method flag, METH_COEXIST. 2003-12-13 11:26:12 +00:00
modsupport.h Add PyArg_VaParseTupleAndKeywords(). Document this function and 2004-07-10 22:20:32 +00:00
moduleobject.h
node.h PEP-0318, @decorator-style. In Guido's words: 2004-08-02 06:10:11 +00:00
object.h SF bug 994255: Py_RETURN_NONE causes too much warnings 2004-07-22 01:46:43 +00:00
objimpl.h Formalize that the Py_VISIT macro requires that the tp_traverse 2004-07-15 04:05:59 +00:00
opcode.h Install two code generation optimizations that depend on NOP. 2004-06-21 16:31:15 +00:00
osdefs.h Getting rid of all the code inside #ifdef macintosh too. 2003-11-20 01:44:59 +00:00
parsetok.h
patchlevel.h on to a2! 2004-08-03 15:57:39 +00:00
pgen.h
pgenheaders.h
py_curses.h FreeBSD 5.x uses different wchar_t/win_t guards than earlier versions 2003-06-29 15:46:21 +00:00
pydebug.h
pyerrors.h Stop producing or using OverflowWarning. PEP 237 thought this would 2004-08-25 02:14:08 +00:00
pyfpe.h
pygetopt.h
pymactoolbox.h Moved PyMac_GetScript() to _localemodule, which is the only place where 2004-07-15 13:31:39 +00:00
pymem.h
pyport.h Add a workaround for a problem that UTF-8 strings can be corrupted 2004-08-04 06:33:51 +00:00
pystate.h Patch #510695: Add TSC profiling for the VM. 2004-06-08 08:17:44 +00:00
pystrtod.h Patch #1006003: Cygwin standard module build problems 2004-08-09 15:02:30 +00:00
Python.h Use intptr_t/uintptr_t on Windows 2004-07-27 15:57:24 +00:00
pythonrun.h Patch #900727: Add Py_InitializeEx to allow embedding without signals. 2004-08-19 11:31:58 +00:00
pythread.h
rangeobject.h
setobject.h Make sets and deques weak referencable. 2004-05-30 07:26:47 +00:00
sliceobject.h
stringobject.h Use appropriate macros not the deprecated DL_IMPORT/DL_EXPORT macros 2003-07-01 20:15:21 +00:00
structmember.h remove support for missing ANSI C header files (limits.h, stddef.h, etc). 2004-02-10 16:50:21 +00:00
structseq.h
symtable.h SF patch #872326: Generator expression implementation 2004-05-19 08:20:33 +00:00
sysmodule.h
timefuncs.h Bug 975996: Add _PyTime_DoubleToTimet to C API 2004-06-20 02:50:16 +00:00
token.h PEP-0318, @decorator-style. In Guido's words: 2004-08-02 06:10:11 +00:00
traceback.h Moved tracebackobject to traceback.h, Closes SF Bug #497067 2004-03-21 18:37:23 +00:00
tupleobject.h Extended tuple's C API to include a new function, PyTuple_Pack() that is 2003-10-12 18:24:34 +00:00
ucnhash.h
unicodeobject.h SF #989185: Drop unicode.iswide() and unicode.width() and add 2004-08-04 07:38:35 +00:00
weakrefobject.h Make weak references subclassable: 2004-07-02 18:57:45 +00:00