summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Prevent a crash with nested scopes, again caused by calling Py_DECREF when ↵Amaury Forgeot d'Arc2008-02-161-1/+3
| | | | | | the pointer is still present in the containing structure.
* Issue #2115: __slot__ attributes setting was 10x slower.Amaury Forgeot d'Arc2008-02-151-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 Smith2008-02-151-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 Heimes2008-02-151-7/+40
| | | | problem as floats but I forgot to test and fix them.
* Use a static and interned string for __subclasscheck__ and __instancecheck__ ↵Christian Heimes2008-02-141-2/+16
| | | | as suggested by Thomas Heller in #2115
* Implemented Martin's suggestion to clear the free lists during the garbage ↵Christian Heimes2008-02-145-25/+73
| | | | collection of the highest generation.
* dict.copy() rises from the ashes. Revert r60687.Raymond Hettinger2008-02-122-19/+1
|
* Added PyNumber_ToBase and supporting routines _PyInt_Format andEric Smith2008-02-103-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 Hettinger2008-02-092-1/+19
| | | | away in Py3.x
* Remove unnecessary modulo division.Raymond Hettinger2008-02-081-1/+1
| | | | The preceding test guarantees that 0 <= i < len.
* Use prefix decrementChristian Heimes2008-02-082-4/+3
|
* Deallocate content of the dict free list on interpreter shutdownChristian Heimes2008-02-081-0/+12
|
* Added some statistics code to dict and list object code. I wanted to test ↵Christian Heimes2008-02-072-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 Hettinger2008-02-071-2/+2
|
* Issue 2025: Add tuple.count() and tuple.index() to follow the ABC in ↵Raymond Hettinger2008-02-071-0/+54
| | | | collections.Sequence.
* Unified naming convention for free lists and their limits. All free listsChristian Heimes2008-02-068-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 Heimes2008-02-062-8/+35
|
* Patch #1953Christian Heimes2008-02-042-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 Yasskin2008-02-042-1/+117
|
* Ensure that PySet_Add() operates on a newly created frozenset, like ↵Amaury Forgeot d'Arc2008-02-031-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 Hettinger2008-02-021-13/+3
|
* Add protection from weirdness while scaling the mantissa to an integer.Raymond Hettinger2008-02-011-5/+10
|
* Fix int/long typecase. Add check for non-binary floating point.Raymond Hettinger2008-02-011-2/+9
|
* labs() takes a long for an input.Raymond Hettinger2008-02-011-1/+1
|
* Integer ratio should return ints instead of longs whereever possible.Raymond Hettinger2008-02-011-2/+8
|
* Issue #1996: float.as_integer_ratio() should return fraction in lowest terms.Raymond Hettinger2008-02-011-85/+18
|
* The previous change was causing a segfault after multiple calls to ↵Christian Heimes2008-01-301-9/+5
| | | | Py_Initialize() and Py_Finalize().
* Fixed some references leaks in sys.Christian Heimes2008-01-301-1/+0
|
* Patch #1970 by Antoine Pitrou: Speedup unicode whitespace and linebreak ↵Christian Heimes2008-01-301-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 macroRaymond Hettinger2008-01-281-4/+4
|
* Make PySet_Add() work with frozensets.Raymond Hettinger2008-01-281-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 Heimes2008-01-283-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 Heimes2008-01-271-0/+18
| | | | leak test runs.
* Moved Rational._binary_float_to_ratio() to float.as_integer_ratio() becauseJeffrey Yasskin2008-01-271-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 cleanupNeal Norwitz2008-01-271-5/+5
|
* #1473257: add generator.gi_code attribute that refers toGeorg Brandl2008-01-261-0/+5
| | | | the original code object backing the generator. Patch by Collin Winter.
* Revert PySet_Add() changes.Raymond Hettinger2008-01-261-0/+5
|
* Update test code for change to PySet_Add().Raymond Hettinger2008-01-261-1/+0
|
* Make PySet_Add() work with frozensets. Works like PyTuple_SetItem() to ↵Raymond Hettinger2008-01-261-4/+0
| | | | build-up values in a brand new frozenset.
* Use the right (portable) definition of the max of a Py_ssize_t.Thomas Wouters2008-01-251-1/+1
|
* Rewrite the list_inline_repeat overflow check slightly differently.Guido van Rossum2008-01-251-6/+7
|
* Changes 54857 and 54840 broke code and were reverted in Py2.5 just beforeRaymond Hettinger2008-01-252-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 Heimes2008-01-252-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 Norwitz2008-01-251-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 Rossum2008-01-241-0/+5
|
* Indentation normalization.Georg Brandl2008-01-191-8/+8
|
* Fix an edge case whereby the __del__() method of a classic class couldGuido van Rossum2008-01-181-0/+10
| | | | create a new weakref to the object.
* Silence Coverity false alerts with CIDs #172, #183, #184Christian Heimes2008-01-181-0/+1
|
* Temporarily revert 59967 until GC can be added.Raymond Hettinger2008-01-151-1/+1
|
* Issue 1820: structseq objects did not work with the % formatting operator ↵Raymond Hettinger2008-01-151-1/+1
| | | | | | or isinstance(t, tuple). Orignal patch (without tests) by Leif Walsh.