summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now supportWalter Dörwald2004-09-071-0/+21
| | | | | | | | | | | 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.
* SF patch #1020188: Use Py_CLEAR where necessary to avoid crashesRaymond Hettinger2004-09-011-1/+1
| | | | (Contributed by Dima Dorfman)
* SF patch #1007189, multi-line imports, for instance:Anthony Baxter2004-08-311-49/+53
| | | | | "from blah import (foo, bar baz, bongo)"
* onward and upwardAnthony Baxter2004-08-311-2/+2
|
* SF patch 936813: fast modular exponentiationTim Peters2004-08-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* SF patch 936813: fast modular exponentiationTim Peters2004-08-291-1/+1
| | | | | | | | | | | | | | | | | | This checkin is adapted from part 1 (of 3) of Trevor Perrin's patch set. x_mul() - sped a little by optimizing the C - sped a lot (~2X) if it's doing a square; note that long_pow() squares often k_mul() - more cache-friendly now if it's doing a square KARATSUBA_CUTOFF - boosted; gradeschool mult is quicker now, and it may have been too low for many platforms anyway KARATSUBA_SQUARE_CUTOFF - new - since x_mul is a lot faster at squaring now, the point at which Karatsuba pays for squaring is much higher than for general mult
* Stop producing or using OverflowWarning. PEP 237 thought this wouldTim Peters2004-08-251-0/+1
| | | | | | | happen in 2.3, but nobody noticed it still was getting generated (the warning was disabled by default). OverflowWarning and PyExc_OverflowWarning should be removed for 2.5, and left notes all over saying so.
* Patch #900727: Add Py_InitializeEx to allow embedding without signals.Martin v. Löwis2004-08-191-0/+1
|
* Patch #1006003: Cygwin standard module build problemsJason Tishler2004-08-092-3/+4
| | | | Add missing PyAPI_FUNC/PyAPI_DATA macros.
* SF #989185: Drop unicode.iswide() and unicode.width() and addHye-Shik Chang2004-08-041-18/+0
| | | | | | | | | | | | unicodedata.east_asian_width(). You can still implement your own simple width() function using it like this: def width(u): w = 0 for c in unicodedata.normalize('NFC', u): cwidth = unicodedata.east_asian_width(c) if cwidth in ('W', 'F'): w += 2 else: w += 1 return w
* Add a workaround for a problem that UTF-8 strings can be corruptedHye-Shik Chang2004-08-041-0/+33
| | | | | | | or broken by basic ctype functions in 4.4BSD descendants. This will be fixed in their future development branches but they'll keep the POSIX-incompatibility for their backward-compatiblities in near future.
* on to a2!Anthony Baxter2004-08-031-2/+2
|
* PEP-0318, @decorator-style. In Guido's words:Anthony Baxter2004-08-023-72/+77
| | | | | "@ seems the syntax that everybody can hate equally" Implementation by Mark Russell, from SF #979728.
* Fix typo in commentNeal Norwitz2004-08-011-1/+1
|
* * drop the unreasonable list invariant that ob_item should never come backArmin Rigo2004-07-291-3/+1
| | | | | | | | | | | | | | | | | | | | | to NULL during the lifetime of the object. * listobject.c nevertheless did not conform to the other invariants, either; fixed. * listobject.c now uses list_clear() as the obvious internal way to clear a list, instead of abusing list_ass_slice() for that. It makes it easier to enforce the invariant about ob_item == NULL. * listsort() sets allocated to -1 during sort; any mutation will set it to a value >= 0, so it is a safe way to detect mutation. A negative value for allocated does not cause a problem elsewhere currently. test_sort.py has a new test for this fix. * listsort() leak: if items were added to the list during the sort, AND if these items had a __del__ that puts still more stuff into the list, then this more stuff (and the PyObject** array to hold them) were overridden at the end of listsort() and never released.
* Fix obscure breakage (relative to 2.3) in listsort: the test for listTim Peters2004-07-291-0/+3
| | | | | | | | | | | | mutation during list.sort() used to rely on that listobject.c always NULL'ed ob_item when ob_size fell to 0. That's no longer true, so the test for list mutation during a sort is no longer reliable. Changed the test to rely instead on that listobject.c now never NULLs-out ob_item after (if ever) ob_item gets a non-NULL value. This new assumption is also documented now, as a required invariant in listobject.h. The new assumption allowed some real simplification to some of the hairier code in listsort(), so is a Good Thing on that count.
* Document what the members of PyListObject are used for, and the crucialTim Peters2004-07-291-0/+9
| | | | invariants they must satisfy.
* Use intptr_t/uintptr_t on WindowsMartin v. Löwis2004-07-271-0/+5
|
* SF bug 994255: Py_RETURN_NONE causes too much warningsTim Peters2004-07-222-3/+3
| | | | | | | | | | Rewrote Py_RETURN_{NONE, TRUE, FALSE} to expand to comma expressions rather than "do {} while(0)" thingies. The OP complained because he likes using MS /W4 sometimes, and then all his uses of these things generate nuisance warnings about testing a constant expression (in the "while(0)" part). Comma expressions don't have this problem (although it's a lucky accident that comma expressions suffice for these macros!).
* Moved SunPro warning suppression into pyport.h and out of individualNicholas Bastin2004-07-151-0/+7
| | | | modules and objects.
* Moved PyMac_GetScript() to _localemodule, which is the only place whereJack Jansen2004-07-151-1/+0
| | | | it is used, and made it private. Should fix #978662.
* Formalize that the Py_VISIT macro requires that the tp_traverseTim Peters2004-07-151-1/+5
| | | | implementation it's used in must give its arguments specific names.
* Documented the new Py_VISIT macro to simplify implementation ofJim Fulton2004-07-141-0/+10
| | | | tp_traverse handlers. (Tim made me do it. ;)
* Implemented a new Py_CLEAR macro. This macro should be used whenJim Fulton2004-07-141-0/+9
| | | | | decrementing the refcount of variables that might be accessed as a result of calling Python
* Add PyArg_VaParseTupleAndKeywords(). Document this function andBrett Cannon2004-07-101-0/+2
| | | | | | PyArg_VaParse(). Closes patch #550732. Thanks Greg Chapman.
* post-release funAnthony Baxter2004-07-091-1/+1
|
* Allow string and unicode return types from .encode()/.decode()Marc-André Lemburg2004-07-081-0/+11
| | | | | methods on string and unicode objects. Added unicode.decode() which was missing for no apparent reason.
* bump the version number for 2.4a1Fred Drake2004-07-081-2/+2
|
* Make weak references subclassable:Fred Drake2004-07-021-1/+6
| | | | | | | | | | | | | | | | | | | | | | - weakref.ref and weakref.ReferenceType will become aliases for each other - weakref.ref will be a modern, new-style class with proper __new__ and __init__ methods - weakref.WeakValueDictionary will have a lighter memory footprint, using a new weakref.ref subclass to associate the key with the value, allowing us to have only a single object of overhead for each dictionary entry (currently, there are 3 objects of overhead per entry: a weakref to the value, a weakref to the dictionary, and a function object used as a weakref callback; the weakref to the dictionary could be avoided without this change) - a new macro, PyWeakref_CheckRefExact(), will be added - PyWeakref_CheckRef() will check for subclasses of weakref.ref This closes SF patch #983019.
* SF Bug #215126: Over restricted type checking on eval() functionRaymond Hettinger2004-07-021-1/+1
| | | | | | The builtin eval() function now accepts any mapping for the locals argument. Time sensitive steps guarded by PyDict_CheckExact() to keep from slowing down the normal case. My timings so no measurable impact.
* Add missing backslash for PyDateTimeAPI->Delta_FromDelta() macro.Brett Cannon2004-06-281-1/+1
|
* Patch #923098: Share interned strings in marshal.Martin v. Löwis2004-06-271-3/+5
|
* Patch #966493: Cleanup generator/eval_frame exposure.Martin v. Löwis2004-06-273-3/+6
|
* Install two code generation optimizations that depend on NOP.Raymond Hettinger2004-06-211-0/+1
| | | | Reduces the cost of "not" to almost zero.
* SF patch 876130: add C API to datetime module, from Anthony Tuininga.Tim Peters2004-06-201-0/+95
| | | | | | The LaTeX is untested (well, so is the new API, for that matter). Note that I also changed NULL to get spelled consistently in concrete.tex. If that was a wrong thing to do, Fred should yell at me.
* Bug 975996: Add _PyTime_DoubleToTimet to C APITim Peters2004-06-201-0/+23
| | | | | | | | | | | New include file timefuncs.h exports private API function _PyTime_DoubleToTimet() from timemodule.c. timemodule should export some other functions too (look for painful bits in datetimemodule.c). Added insane-argument checking to datetime's assorted fromtimestamp() and utcfromtimestamp() methods. Added insane-argument tests of these to test_datetime, and insane-argument tests for ctime(), localtime() and gmtime() to test_time.
* Patch #774665: Make Python LC_NUMERIC agnostic.Martin v. Löwis2004-06-082-0/+20
|
* Patch #510695: Add TSC profiling for the VM.Martin v. Löwis2004-06-081-0/+3
|
* - SF #962502: Add two more methods for unicode type; width() andHye-Shik Chang2004-06-021-0/+18
| | | | | | | iswide() for east asian width manipulation. (Inspired by David Goodger, Reviewed by Martin v. Loewis) - Move _PyUnicode_TypeRecord.flags to the end of the struct so that no padding is added for UCS-4 builds. (Suggested by Martin v. Loewis)
* Patch #957398: Add public API for Generator Object/Type.Martin v. Löwis2004-06-012-0/+34
|
* Add weakref support to array.array and file objects.Raymond Hettinger2004-05-311-0/+1
|
* Make sets and deques weak referencable.Raymond Hettinger2004-05-301-0/+1
|
* SF patch #872326: Generator expression implementationRaymond Hettinger2004-05-192-18/+25
| | | | | | | | | | | | | | (Code contributed by Jiwon Seo.) The documentation portion of the patch is being re-worked and will be checked-in soon. Likewise, PEP 289 will be updated to reflect Guido's rationale for the design decisions on binding behavior (as described in in his patch comments and in discussions on python-dev). The test file, test_genexps.py, is written in doctest format and is meant to exercise all aspects of the the patch. Further additions are welcome from everyone. Please stress test this new feature as much as possible before the alpha release.
* Two new public API functions, Py_IncRef and Py_DecRef. Useful forThomas Heller2004-04-221-0/+7
| | | | dynamic embedders of Python.
* Added a comment about the unreferenced PyThreadState.tick_counterTim Peters2004-03-291-11/+18
| | | | member.
* Enable the profiling of C functions (builtins and extensions)Nicholas Bastin2004-03-241-0/+3
|
* Patch #871657: Set EDOM for `nan' return values on FreeBSD and OpenBSD.Hye-Shik Chang2004-03-221-7/+20
| | | | This fixes a problem that math.sqrt(-1) doesn't raise math.error.
* Moved tracebackobject to traceback.h, Closes SF Bug #497067Nicholas Bastin2004-03-211-1/+9
|
* compile.h and eval.h weren't being included which kept a fair bit of theSkip Montanaro2004-03-131-0/+3
| | | | public API from being exposed by simply including Python.h (as recommended).
* SF patch #906501: Fix typos in pystate.h commentsRaymond Hettinger2004-03-131-2/+2
| | | | (Contributed by Greg Chapman.)