summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* 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.)
* Make PySequence_Fast_ITEMS public. (Thanks Skip.)Raymond Hettinger2004-03-121-1/+1
|
* Use a new macro, PySequence_Fast_ITEMS to factor out code common toRaymond Hettinger2004-03-121-0/+6
| | | | | three recent optimizations. Aside from reducing code volume, it increases readability.
* Eliminate a big block of duplicate code in PySequence_List() byRaymond Hettinger2004-03-111-0/+1
| | | | exposing _PyList_Extend().
* SF patch #910929: Optimize list comprehensionsRaymond Hettinger2004-03-071-0/+1
| | | | | Add a new opcode, LIST_APPEND, and apply it to the code generation for list comprehensions. Reduces the per-loop overhead by about a third.
* * Optimized list appends and pops by making fewer calls the underlying systemRaymond Hettinger2004-02-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | realloc(). This is achieved by tracking the overallocation size in a new field and using that information to skip calls to realloc() whenever possible. * Simplified and tightened the amount of overallocation. For larger lists, this overallocates by 1/8th (compared to the previous scheme which ranged between 1/4th to 1/32nd over-allocation). For smaller lists (n<6), the maximum overallocation is one byte (formerly it could be upto eight bytes). This saves memory in applications with large numbers of small lists. * Eliminated the NRESIZE macro in favor of a new, static list_resize function that encapsulates the resizing logic. Coverting this back to macro would give a small (under 1%) speed-up. This was too small to warrant the loss of readability, maintainability, and de-coupling. * Some functions using NRESIZE had grown unnecessarily complex in their efforts to bend to the macro's calling pattern. With the new list_resize function in place, those other functions could be simplified. That is being saved for a separate patch. * The ob_item==NULL check could be eliminated from the new list_resize function. This would entail finding each piece of code that sets ob_item to NULL and adding a new line to invalidate the overallocation tracking field. Rather than impose a new requirement on other pieces of list code, it was preferred to leave the NULL check in place and retain the benefits of decoupling, maintainability and information hiding (only PyList_New() and list_sort() need to know about the new field). This approach also reduces the odds of breaking an extension module. (Collaborative effort by Raymond Hettinger, Hye-Shik Chang, Tim Peters, and Armin Rigo.)
* This is my patch #876198 plus a NEWS entry and a header frob.Michael W. Hudson2004-02-121-5/+0
| | | | | Remove the ability to use (from C) arbitrary objects supporting the read buffer interface as the co_code member of code objects.
* remove support for missing ANSI C header files (limits.h, stddef.h, etc).Skip Montanaro2004-02-103-10/+0
|
* Revert improvement to list.append() checked in before it was ready.Raymond Hettinger2004-02-081-1/+0
|
* Let reversed() work with itself.Raymond Hettinger2004-02-081-0/+1
|
* Remove support for --without-universal-newlines (see PEP 11).Skip Montanaro2004-02-071-9/+1
|
* Remove support for SunOS 4.Skip Montanaro2004-01-171-7/+0
| | | | Remove BAD_EXEC_PROTOYPE (leftover from IRIX 4 demolition).
* Fix name problem in previous checkin: Dict not ListJeremy Hylton2003-12-261-1/+1
|
* At 2.2, the Py<type>_Check() family of API functions (macros) changedAndrew MacIntyre2003-12-261-0/+1
| | | | | | | | | | | | semantics to include subtypes. Most concrete object APIs then had a Py<type>_CheckExact() macro added to test for an object's type not including subtypes. The PyDict_CheckExact() macro wasn't created at that time, so I've added it for API completeness/symmetry - even though nobody has complained about its absence in the time since 2.2 was released. Not a backport candidate.
* reverting 2.29: the patch was Ok, but the commit msg wrongAndrew MacIntyre2003-12-261-1/+0
|
* The semantics of PyList_Check() and PyDict_Check() changed at 2.2, alongAndrew MacIntyre2003-12-261-0/+1
| | | | | | | | | with most other concrete object checks, but the docs weren't brought into line. PyList_CheckExact() was added at 2.2 but never documented. backport candidate.
* Changed the UCHAR_MAX error msg a bit: we don't really assume anythingTim Peters2003-12-221-1/+1
| | | | | about "characters", we assume something about C's char type (which is an integral type).
* There are places in Python which assume bytes have 8-bits. Formalize that aSkip Montanaro2003-12-221-0/+8
| | | | | | bit by checking the value of UCHAR_MAX in Include/Python.h. There was a check in Objects/stringobject.c. Remove that. (Note that we don't define UCHAR_MAX if it's not defined as the old test did.)
* Add rsplit method for str and unicode builtin types.Hye-Shik Chang2003-12-151-0/+20
| | | | | SF feature request #801847. Original patch is written by Sean Reifschneider.
* * Added a new method flag, METH_COEXIST.Raymond Hettinger2003-12-131-0/+7
| | | | | * Used the flag to optimize set.__contains__(), dict.__contains__(), dict.__getitem__(), and list.__getitem__().
* Expose dict_contains() and PyDict_Contains() with is about 10% fasterRaymond Hettinger2003-11-251-0/+1
| | | | | | | than PySequence_Contains() and more clearly applicable to dicts. Apply the new function in setobject.c where __contains__ checking is ubiquitous.
* * Checkin remaining documentationRaymond Hettinger2003-11-241-1/+1
| | | | | | | * Add more tests * Refactor and neaten the code a bit. * Rename union_update() to update(). * Improve the algorithms (making them a closer to sets.py).