summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* merge -r59315:59316 from py3k: Fix issue #1553: An errornous __length_hint__ ↵Christian Heimes2007-12-052-4/+6
| | | | can make list() raise a SystemError
* Shut up a compiler warning.Guido van Rossum2007-12-031-0/+1
|
* Patch #1537 from Chad AustinChristian Heimes2007-12-031-2/+2
| | | | | Change GeneratorExit's base class from Exception to BaseException (This time I'm applying the patch to the correct sandbox.)
* Implement PEP 366Nick Coghlan2007-12-031-0/+2
|
* Feature #1534Christian Heimes2007-12-011-0/+47
| | | | | Added PyFloat_GetMax(), PyFloat_GetMin() and PyFloat_GetInfo() to the float API. Added a dictionary sys.float_info with information about the internal floating point type to the sys module.
* Spaces vs. Tabs.Georg Brandl2007-11-291-4/+4
|
* Fix bug #1517, a segfault in lookdict().Guido van Rossum2007-11-291-0/+4
|
* Patch # 1507 by Mark Dickinson. Make complex(x, -0) retain the sign ofGuido van Rossum2007-11-271-9/+15
| | | | | the imaginary part (as long as it's not complex). Backport candidate?
* Issue #1445: Fix a SystemError when accessing the ``cell_contents``Amaury Forgeot d'Arc2007-11-241-1/+6
| | | | attribute of an empty cell object. Now a ValueError is raised.
* Backport of the PCbuild9 directory from the py3k branch.Christian Heimes2007-11-222-4/+4
| | | | | I've finished the last task for the PCbuild9 directory today. I don't think there is much left to do. Now you can all play around with the shiny new VS 2008 and try the PGO builds. I was able to get a speed improvement of about 10% on py3k. Have fun! :)
* Backport of _abccoll.py by Benjamin Arangueren, issue 1383.Guido van Rossum2007-11-225-44/+46
| | | | With some changes of my own thrown in (e.g. backport of r58107).
* The incremental decoder for utf-7 must preserve its state between calls.Amaury Forgeot d'Arc2007-11-201-2/+19
| | | | | | | Solves issue1460. Might not be a backport candidate: a new API function was added, and some code may rely on details in utf-7.py.
* Made _ParseTupleFinds only defined to unicodeobject.cFacundo Batista2007-11-162-0/+4
|
* Fix for stupid error (I need to remember to do a full 'make clean + make'Facundo Batista2007-11-161-1/+1
| | | | cycle before the tests...). Sorry.
* Now in find, rfind, index, and rindex, you can use None as defaults,Facundo Batista2007-11-163-32/+74
| | | | | | | | | | | | as usual with slicing (both with str and unicode strings). This fixes issue 1259. For str only the stringobject.c file was modified. But for unicode, I needed to repeat in the four functions a lot of code, so created a new function that does part of the job for them (and placed it in find.h, following a suggestion of Barry). Also added tests for this behaviour.
* Re-word sentenceAndrew M. Kuchling2007-11-121-1/+1
|
* Added new decorator syntax to property.__doc__Christian Heimes2007-11-121-4/+14
| | | | Guido prefers _x over __x.
* Issue 1416. Add getter, setter, deleter methods to properties that can beGuido van Rossum2007-11-101-1/+55
| | | | used as decorators to create fully-populated properties.
* Optimize common case for dict.fromkeys().Raymond Hettinger2007-11-091-10/+15
|
* Reposition the decref (spotted by eagle-eye norwitz).Raymond Hettinger2007-11-081-1/+2
|
* Add set.isdisjoint()Raymond Hettinger2007-11-081-0/+70
|
* Optimize dict.fromkeys() with dict inputs. Useful for resetting bag/muliset ↵Raymond Hettinger2007-11-071-0/+19
| | | | counts for example.
* Add missing "return NULL" in overflow check in PyObject_Repr().Guido van Rossum2007-11-061-0/+1
|
* Backport fixes for the code that decodes octal escapes (and for PyStringGuido van Rossum2007-10-292-7/+12
| | | | | | | also hex escapes) -- this was reaching beyond the end of the input string buffer, even though it is not supposed to be \0-terminated. This has no visible effect but is clearly the correct thing to do. (In 3.0 it had a visible effect after removing ob_sstate from PyString.)
* Fix the overflow checking of list_repeat.Armin Rigo2007-10-171-4/+7
| | | | | | Introduce overflow checking into list_inplace_repeat. Backport candidate, possibly.
* Remove file-level typedefs that were inconsistently used throughout the file.Brett Cannon2007-10-101-105/+103
| | | | | | Just move over to the public API names. Closes issue1238.
* Coverity #151: Remove deadcode.Neal Norwitz2007-10-041-13/+0
| | | | All this code already exists above starting at line 653.
* enumerate() is no longer bounded to using sequences shorter than LONG_MAX. ↵Raymond Hettinger2007-10-031-6/+49
| | | | The possibility of overflow was sending some newsgroup posters into a tizzy.
* Fix error introduced by r58288; if a tuple is length 0 return its repr andBrett Cannon2007-09-301-4/+4
| | | | don't worry about any self-referring tuples.
* tuple.__repr__ did not consider a reference loop as it is not possible fromBrett Cannon2007-09-302-0/+18
| | | | | | | | | | Python code; but it is possible from C. object.__str__ had the issue of not expecting a type to doing something within it's tp_str implementation that could trigger an infinite recursion, but it could in C code.. Both found thanks to BaseException and how it handles its repr. Closes issue #1686386. Thanks to Thomas Herve for taking an initial stab at coming up with a solution.
* Patch # 188 by Philip Jenvey.Guido van Rossum2007-09-221-0/+1
| | | | | Make tell() mark CRLF as a newline. With unit test.
* Issue #1772851. Alters long.__hash__ from being *almost* completelyFacundo Batista2007-09-191-0/+8
| | | | | | | predictable to being completely predictable. The value of hash(n) is unchanged for any n that's small enough to be representable as an int, and also unchanged for the vast majority of long integers n of reasonable size.
* Properly indent two lines. (Spotted because it caused merge conflicts in theThomas Wouters2007-09-181-2/+2
| | | | py3k branch ;)
* Add a bunch of GIL release/acquire points in tp_print implementations and forBrett Cannon2007-09-1711-7/+66
| | | | | | PyObject_Print(). Closes issue #1164.