Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Move abc._Abstract into object by adding a new flag Py_TPFLAGS_IS_ABSTRACT, | Jeffrey Yasskin | 2008-02-28 | 1 | -0/+103 |
| | | | | | | | | which forbids constructing types that have it set. The effect is to speed ./python.exe -m timeit -s 'import abc' -s 'class Foo(object): __metaclass__ = abc.ABCMeta' 'Foo()' up from 2.5us to 0.201us. This fixes issue 1762. | ||||
* | Corrected assert to check for correct type in py3k. | Eric Smith | 2008-02-24 | 1 | -1/+1 |
| | |||||
* | Use PY_FORMAT_SIZE_T instead of z for string formatting. Thanks Neal. | Christian Heimes | 2008-02-24 | 2 | -4/+8 |
| | |||||
* | Issue 1742669. Now %d accepts very big float numbers. | Facundo Batista | 2008-02-24 | 2 | -29/+88 |
| | | | | Thanks Gabriel Genellina. | ||||
* | #2067: file.__exit__() now calls subclasses' close() method. | Georg Brandl | 2008-02-23 | 1 | -2/+2 |
| | |||||
* | Now that PyOS_ascii_formatd supports the 'n' format, simplify the float ↵ | Eric Smith | 2008-02-20 | 1 | -40/+15 |
| | | | | formatting code to just call it. | ||||
* | Added code to correct combining str and unicode in ''.format(). Added test ↵ | Eric Smith | 2008-02-18 | 1 | -0/+16 |
| | | | | case. | ||||
* | Backport of PEP 3101, Advanced String Formatting, from py3k. | Eric Smith | 2008-02-17 | 11 | -23/+2606 |
| | | | | | | | | | | | | | | | Highlights: - Adding PyObject_Format. - Adding string.Format class. - Adding __format__ for str, unicode, int, long, float, datetime. - Adding builtin format. - Adding ''.format and u''.format. - str/unicode fixups for formatters. The files in Objects/stringlib that implement PEP 3101 (stringdefs.h, unicodedefs.h, formatter.h, string_format.h) are identical in trunk and py3k. Any changes from here on should be made to trunk, and changes will propogate to py3k). | ||||
* | 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. |