Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Prevent a crash with nested scopes, again caused by calling Py_DECREF when ↵ | Amaury Forgeot d'Arc | 2008-02-16 | 1 | -1/+3 |
| | | | | | | the pointer is still present in the containing structure. | ||||
* | Issue #2115: __slot__ attributes setting was 10x slower. | Amaury Forgeot d'Arc | 2008-02-15 | 1 | -1/+1 |
| | | | | | | | | Also correct a possible crash using ABCs. This change is exactly the same as an optimisation done 5 years ago, but on slot *access*: http://svn.python.org/view?view=rev&rev=28297 | ||||
* | In PyNumber_ToBase, changed from an assert to returning an error when ↵ | Eric Smith | 2008-02-15 | 1 | -1/+5 |
| | | | | PyObject_Index() returns something other than an int or long. It should never be possible to trigger this, as PyObject_Index checks to make sure it returns an int or long. | ||||
* | Fixed repr() and str() of complex numbers. Complex suffered from the same ↵ | Christian Heimes | 2008-02-15 | 1 | -7/+40 |
| | | | | problem as floats but I forgot to test and fix them. | ||||
* | Use a static and interned string for __subclasscheck__ and __instancecheck__ ↵ | Christian Heimes | 2008-02-14 | 1 | -2/+16 |
| | | | | as suggested by Thomas Heller in #2115 | ||||
* | Implemented Martin's suggestion to clear the free lists during the garbage ↵ | Christian Heimes | 2008-02-14 | 5 | -25/+73 |
| | | | | collection of the highest generation. | ||||
* | dict.copy() rises from the ashes. Revert r60687. | Raymond Hettinger | 2008-02-12 | 2 | -19/+1 |
| | |||||
* | Added PyNumber_ToBase and supporting routines _PyInt_Format and | Eric Smith | 2008-02-10 | 3 | -33/+113 |
| | | | | | | | | | | | | | | | | | _PyLong_Format. In longobject.c, changed long_format to _PyLong_Format. In intobject.c, changed uses of PyOS_snprintf to _PyInt_Format instead. _PyLong_Format is similar to py3k's routine of the same name, except it has 2 additional parameters: addL and newstyle. addL was existing in long_format, and controls adding the trailing "L". This is unneeded in py3k. newstyle is used to control whether octal prepends "0" (the pre-2.6 style), or "0o" (the 3.0 sytle). PyNumber_ToBase is needed for PEP 3127 (Integer Literal Support and Syntax) and PEP 3101 (Advanced String Formatting). This changeset does not need merging into py3k. | ||||
* | Add -3 warnings that set.copy(), dict.copy(), and defaultdict.copy() will go ↵ | Raymond Hettinger | 2008-02-09 | 2 | -1/+19 |
| | | | | away in Py3.x | ||||
* | Remove unnecessary modulo division. | Raymond Hettinger | 2008-02-08 | 1 | -1/+1 |
| | | | | The preceding test guarantees that 0 <= i < len. | ||||
* | Use prefix decrement | Christian Heimes | 2008-02-08 | 2 | -4/+3 |
| | |||||
* | Deallocate content of the dict free list on interpreter shutdown | Christian Heimes | 2008-02-08 | 1 | -0/+12 |
| | |||||
* | Added some statistics code to dict and list object code. I wanted to test ↵ | Christian Heimes | 2008-02-07 | 2 | -0/+54 |
| | | | | how a larger freelist affects the reusage of freed objects. Contrary to my gut feelings 80 objects is more than fine for small apps. I haven't profiled a large app yet. | ||||
* | Return ints instead of longs for tuple.count() and tuple.index(). | Raymond Hettinger | 2008-02-07 | 1 | -2/+2 |
| | |||||
* | Issue 2025: Add tuple.count() and tuple.index() to follow the ABC in ↵ | Raymond Hettinger | 2008-02-07 | 1 | -0/+54 |
| | | | | collections.Sequence. | ||||
* | Unified naming convention for free lists and their limits. All free lists | Christian Heimes | 2008-02-06 | 8 | -84/+95 |
| | | | | | | | | in Object/ are named ``free_list``, the counter ``numfree`` and the upper limit is a macro ``PyName_MAXFREELIST`` inside an #ifndef block. The chances should make it easier to adjust Python for platforms with less memory, e.g. mobile phones. | ||||
* | Limit free list of method and builtin function objects to 256 entries each. | Christian Heimes | 2008-02-06 | 2 | -8/+35 |
| | |||||
* | Patch #1953 | Christian Heimes | 2008-02-04 | 2 | -25/+57 |
| | | | | | I implemented the function sys._compact_freelists() and C API functions PyInt_/PyFloat_CompactFreeList() to compact the pre-allocated blocks of ints and floats. They allow the user to reduce the memory usage of a Python process that deals with lots of numbers. The patch also renames sys._cleartypecache to sys._clear_type_cache | ||||
* | Make int() and long() fall back to __trunc__(). See issue 2002. | Jeffrey Yasskin | 2008-02-04 | 2 | -1/+117 |
| | |||||
* | Ensure that PySet_Add() operates on a newly created frozenset, like ↵ | Amaury Forgeot d'Arc | 2008-02-03 | 1 | -1/+6 |
| | | | | | | | | PyTuple_SetItem does. Add PyFrozenSet_Check(), which was not needed before; The list of Py*Set_Check* macros seems to be complete now. Add missing NEWS entries about all this. | ||||
* | Simpler solution to handling non-IEEE 754 environments. | Raymond Hettinger | 2008-02-02 | 1 | -13/+3 |
| | |||||
* | Add protection from weirdness while scaling the mantissa to an integer. | Raymond Hettinger | 2008-02-01 | 1 | -5/+10 |
| | |||||
* | Fix int/long typecase. Add check for non-binary floating point. | Raymond Hettinger | 2008-02-01 | 1 | -2/+9 |
| | |||||
* | labs() takes a long for an input. | Raymond Hettinger | 2008-02-01 | 1 | -1/+1 |
| | |||||
* | Integer ratio should return ints instead of longs whereever possible. | Raymond Hettinger | 2008-02-01 | 1 | -2/+8 |
| | |||||
* | Issue #1996: float.as_integer_ratio() should return fraction in lowest terms. | Raymond Hettinger | 2008-02-01 | 1 | -85/+18 |
| | |||||
* | The previous change was causing a segfault after multiple calls to ↵ | Christian Heimes | 2008-01-30 | 1 | -9/+5 |
| | | | | Py_Initialize() and Py_Finalize(). | ||||
* | Fixed some references leaks in sys. | Christian Heimes | 2008-01-30 | 1 | -1/+0 |
| | |||||
* | Patch #1970 by Antoine Pitrou: Speedup unicode whitespace and linebreak ↵ | Christian Heimes | 2008-01-30 | 1 | -18/+81 |
| | | | | detection. The speedup is about 25% for split() (571 / 457 usec) and 35% (175 / 127 usec )for splitlines() | ||||
* | Factor-out common code with a new macro | Raymond Hettinger | 2008-01-28 | 1 | -4/+4 |
| | |||||
* | Make PySet_Add() work with frozensets. | Raymond Hettinger | 2008-01-28 | 1 | -15/+4 |
| | | | | | Works like PyTuple_SetItem() to build-up values in a brand new frozenset. Also, PyFrozenSet_New() is now guaranteed to produce a distinct new frozenset. | ||||
* | static PyObject* variables should use PyString_InternFromString() instead of ↵ | Christian Heimes | 2008-01-28 | 3 | -9/+10 |
| | | | | PyObject_FromString() to store a python string in a function level static var. | ||||
* | Added clear cache methods to clear the internal type lookup cache for ref ↵ | Christian Heimes | 2008-01-27 | 1 | -0/+18 |
| | | | | leak test runs. | ||||
* | Moved Rational._binary_float_to_ratio() to float.as_integer_ratio() because | Jeffrey Yasskin | 2008-01-27 | 1 | -0/+159 |
| | | | | | | | it's useful outside of rational numbers. This is my first C code that had to do anything significant. Please be more careful when looking over it. | ||||
* | Whitespace cleanup | Neal Norwitz | 2008-01-27 | 1 | -5/+5 |
| | |||||
* | #1473257: add generator.gi_code attribute that refers to | Georg Brandl | 2008-01-26 | 1 | -0/+5 |
| | | | | the original code object backing the generator. Patch by Collin Winter. | ||||
* | Revert PySet_Add() changes. | Raymond Hettinger | 2008-01-26 | 1 | -0/+5 |
| | |||||
* | Update test code for change to PySet_Add(). | Raymond Hettinger | 2008-01-26 | 1 | -1/+0 |
| | |||||
* | Make PySet_Add() work with frozensets. Works like PyTuple_SetItem() to ↵ | Raymond Hettinger | 2008-01-26 | 1 | -4/+0 |
| | | | | build-up values in a brand new frozenset. | ||||
* | Use the right (portable) definition of the max of a Py_ssize_t. | Thomas Wouters | 2008-01-25 | 1 | -1/+1 |
| | |||||
* | Rewrite the list_inline_repeat overflow check slightly differently. | Guido van Rossum | 2008-01-25 | 1 | -6/+7 |
| | |||||
* | Changes 54857 and 54840 broke code and were reverted in Py2.5 just before | Raymond Hettinger | 2008-01-25 | 2 | -8/+8 |
| | | | | it was released, but that reversion never made it to the Py2.6 head. | ||||
* | Backport of several functions from Python 3.0 to 2.6 including ↵ | Christian Heimes | 2008-01-25 | 2 | -165/+630 |
| | | | | | | | PyUnicode_FromString, PyUnicode_Format and PyLong_From/AsSsize_t. The functions are partly required for the backport of the bytearray type and _fileio module. They should also make it easier to port C to 3.0. First chapter of the Python 3.0 io framework back port: _fileio The next step depends on a working bytearray type which itself depends on a backport of the nwe buffer API. | ||||
* | Add prototypes to get the mathmodule.c to compile on OSF1 5.1 (Tru64) | Neal Norwitz | 2008-01-25 | 1 | -0/+5 |
| | | | | | and eliminate a compiler warning in floatobject.c. There might be a better way to go about this, but it should be good enough for now. | ||||
* | Fix test67.py from issue #1303614. | Guido van Rossum | 2008-01-24 | 1 | -0/+5 |
| | |||||
* | Indentation normalization. | Georg Brandl | 2008-01-19 | 1 | -8/+8 |
| | |||||
* | Fix an edge case whereby the __del__() method of a classic class could | Guido van Rossum | 2008-01-18 | 1 | -0/+10 |
| | | | | create a new weakref to the object. | ||||
* | Silence Coverity false alerts with CIDs #172, #183, #184 | Christian Heimes | 2008-01-18 | 1 | -0/+1 |
| | |||||
* | Temporarily revert 59967 until GC can be added. | Raymond Hettinger | 2008-01-15 | 1 | -1/+1 |
| | |||||
* | Issue 1820: structseq objects did not work with the % formatting operator ↵ | Raymond Hettinger | 2008-01-15 | 1 | -1/+1 |
| | | | | | | or isinstance(t, tuple). Orignal patch (without tests) by Leif Walsh. |