summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Generators had their throw() method allowing string exceptions. That's aBrett Cannon2007-09-111-4/+1
| | | | | | | no-no. Fixes issue #1147. Need to fix 2.5 to raise a proper warning if a string exception is passed in.
* Patch # 1026 by Benjamin Aranguren (with Alex Martelli):Guido van Rossum2007-09-101-0/+40
| | | | | | | | Backport abc.py and isinstance/issubclass overloading to 2.6. I had to backport test_typechecks.py myself, and make one small change to abc.py to avoid duplicate work when x.__class__ and type(x) are the same.
* Fix a possible segfault from recursing too deep to get the repr of a list.Brett Cannon2007-09-101-0/+3
| | | | Closes issue #1096.
* Fix a crasher where Python code managed to infinitely recurse in C code withoutBrett Cannon2007-09-073-10/+34
| | | | | | | ever going back out to Python code in PyObject_Call(). Required introducing a static RuntimeError instance so that normalizing an exception there is no reliance on a recursive call that would put the exception system over the recursion check itself.
* Set startinpos before calling the error handler.Walter Dörwald2007-08-301-0/+1
|
* Rewrap line.Walter Dörwald2007-08-301-1/+2
|
* Improve extended slicing support in builtin types and classes. Specifically:Thomas Wouters2007-08-286-15/+261
| | | | | | | | | | | | | | | | | | | | - Specialcase extended slices that amount to a shallow copy the same way as is done for simple slices, in the tuple, string and unicode case. - Specialcase step-1 extended slices to optimize the common case for all involved types. - For lists, allow extended slice assignment of differing lengths as long as the step is 1. (Previously, 'l[:2:1] = []' failed even though 'l[:2] = []' and 'l[:2:None] = []' do not.) - Implement extended slicing for buffer, array, structseq, mmap and UserString.UserString. - Implement slice-object support (but not non-step-1 slice assignment) for UserString.MutableString. - Add tests for all new functionality.
* Revert accidental checkins from last commit.Georg Brandl2007-08-211-32/+6
|
* Demand version 2.5.1 since 2.5 has a bug with codecs.open context managers.Georg Brandl2007-08-211-6/+32
|
* Move another variable declaration up.Walter Dörwald2007-08-171-2/+2
|
* Move variable declaration up.Walter Dörwald2007-08-171-6/+6
|
* Backport r57105 and r57145 from the py3k branch: UTF-32 codecs.Walter Dörwald2007-08-171-0/+266
|
* Bug #1763149: use proper slice syntax in docstring.Georg Brandl2007-07-292-4/+4
| | | | (backport)
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-2131-611/+557
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Patch #1673759: add a missing overflow check when formatting floatsGeorg Brandl2007-07-122-2/+4
| | | | with %G.