summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Added more comments to the new structseq repr code and implemented several ↵Christian Heimes2008-01-141-17/+36
| | | | of Neal's suggestions.
* Now that I've learnt about structseq objects I felt like converting ↵Christian Heimes2008-01-141-29/+78
| | | | | | sys.float_info to a structseq. It's readonly and help(sys.float_info) explains the attributes nicely.
* I missed the most important fileChristian Heimes2008-01-141-5/+58
|
* Re-apply patch #1700288 (first applied in r59931, rolled back in r59940)Amaury Forgeot d'Arc2008-01-142-6/+208
| | | | | | now that ctypes uses a more supported method to create types: Method cache optimization, by Armin Rigo, ported to 2.6 by Kevin Jacobs.
* Back out r59931 - test_ctypes fails with it.Georg Brandl2008-01-132-208/+6
|
* Patch #1700288: Method cache optimization, by Armin Rigo, ported toGeorg Brandl2008-01-122-6/+208
| | | | 2.6 by Kevin Jacobs.
* Make Python compile with --disable-unicode.Georg Brandl2008-01-071-0/+2
|
* Continue rolling back pep-3141 changes that changed behavior from 2.5. ThisJeffrey Yasskin2008-01-053-121/+3
| | | | | | | | | | | | round included: * Revert round to its 2.6 behavior (half away from 0). * Because round, floor, and ceil always return float again, it's no longer necessary to have them delegate to __xxx___, so I've ripped that out of their implementations and the Real ABC. This also helps in implementing types that work in both 2.6 and 3.0: you return int from the __xxx__ methods, and let it get enabled by the version upgrade. * Make pow(-1, .5) raise a ValueError again.
* Make math.{floor,ceil}({int,long}) return float again for backwardsJeffrey Yasskin2008-01-042-4/+4
| | | | compatibility after r59671 made them return integral types.
* Bug #1481296: Fixed long(float('nan'))!=0L.Christian Heimes2008-01-041-0/+3
|
* Modified PyImport_Import and PyImport_ImportModule to always use absolute ↵Christian Heimes2008-01-031-1/+1
| | | | | | imports by calling __import__ with an explicit level of 0 Added a new API function PyImport_ImportModuleNoBlock. It solves the problem with dead locks when mixing threads and imports
* Backport PEP 3141 from the py3k branch to the trunk. This includes r50877 (justJeffrey Yasskin2008-01-034-63/+271
| | | | | | | the complex_pow part), r56649, r56652, r56715, r57296, r57302, r57359, r57361, r57372, r57738, r57739, r58017, r58039, r58040, and r59390, and new documentation. The only significant difference is that round(x) returns a float to preserve backward-compatibility. See http://bugs.python.org/issue1689.
* Fix refleakNeal Norwitz2007-12-311-0/+1
|
* Fix refleak introduced in r59576.Georg Brandl2007-12-201-0/+1
|
* Patch #1549 by Thomas Herve.Guido van Rossum2007-12-191-15/+18
| | | | | | This changes the rules for when __hash__ is inherited slightly, by allowing it to be inherited when one or more of __lt__, __le__, __gt__, __ge__ are overridden, as long as __eq__ and __ne__ aren't.
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-1921-493/+493
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* Applied patch #1635: Float patch for inf and nan on Windows (and other ↵Christian Heimes2007-12-181-1/+49
| | | | | | platforms). The patch unifies float("inf") and repr(float("inf")) on all platforms.
* Give meaning to the oparg for BUILD_MAP: estimated size of the dictionary.Raymond Hettinger2007-12-181-0/+17
| | | | | | | | | | | Allows dictionaries to be pre-sized (upto 255 elements) saving time lost to re-sizes with their attendant mallocs and re-insertions. Has zero effect on small dictionaries (5 elements or fewer), a slight benefit for dicts upto 22 elements (because they had to resize once anyway), and more benefit for dicts upto 255 elements (saving multiple resizes during the build-up and reducing the number of collisions on the first insertions). Beyond 255 elements, there is no addional benefit.
* Optimize PyList_AsTuple(). Improve cache performance by doing theRaymond Hettinger2007-12-151-5/+5
| | | | | | pointer copy and object increment in one pass. For small lists, save the overhead of the call to memcpy() -- this comes up in calls like f(*listcomp).
* Fixed bug #1620: New @spam.getter property syntax modifies the property in ↵Christian Heimes2007-12-141-33/+70
| | | | | | place. I added also the feature that a @prop.getter decorator does not overwrite the doc string of the property if it was given as an argument to property().
* The new float repr causes too much trouble and pain. I'm disabling the ↵Christian Heimes2007-12-111-1/+12
| | | | | | | feature until we have sorted out the issues on all machines. 64bit machines seem to have issues and Guido has reported even worse. Guido: It's pretty bad actually -- repr(1e5) comes out as '1.0'... Ditto for repr(1eN) for most N... Both in 2.6 and in 3.0...
* Backport of r59456:59458 from py3k to trunkChristian Heimes2007-12-102-2/+707
| | | | | | Issue #1580: New free format floating point representation based on "Floating-Point Printer Sample Code", by Robert G. Burger. For example repr(11./5) now returns '2.2' instead of '2.2000000000000002'. Thanks to noam for the patch! I had to modify doubledigits.c slightly to support X64 and IA64 machines on Windows. I also added the new file to the three project files.
* When splitting, avoid making a copy of the string if the split doesn't findSkip Montanaro2007-12-081-11/+42
| | | | anything (issue 1538).
* Note that open() is the preferred way to open files (issue 1510).Skip Montanaro2007-12-081-1/+2
|
* Fix Issue 1045.Raymond Hettinger2007-12-062-41/+39
| | | | | Factor-out common calling code by simplifying the length_hint API. Speed-up the function by caching the PyObject_String for the attribute lookup.