summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
Commit message (Collapse)AuthorAgeFilesLines
* "not subscriptable" should be a bit more understandable than "unsubscriptable".Georg Brandl2009-04-181-1/+1
|
* Issue #2396: backport the memoryview object.Antoine Pitrou2009-04-021-2/+2
|
* Issue #5341: Fix a variety of spelling errors.Mark Dickinson2009-02-211-1/+1
|
* Remove redundant assignment in _PyObject_LengthHintMark Dickinson2009-02-081-1/+1
|
* Validate that __length_hint__ returns a usable result.Raymond Hettinger2009-02-031-1/+1
|
* Issue 1242657: list(obj) can swallow KeyboardInterrupt.Raymond Hettinger2009-02-021-14/+19
|
* Fixed compile error on windows.Hirokazu Yamamoto2009-01-251-1/+1
|
* fix building the core with --disable-unicodeBenjamin Peterson2009-01-251-0/+14
| | | | | I changed some bytearray methods to use strings instead of unicode like bytes_repr Also, bytearray.fromhex() can take strings as well as unicode
* #3720: Interpreter crashes when an evil iterator removes its own next function.Amaury Forgeot d'Arc2009-01-121-1/+0
| | | | | | Now the slot is filled with a function that always raises. Will not backport: extensions compiled with 2.6.x would not run on 2.6.0.
* Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as toAntoine Pitrou2008-08-261-80/+91
| | | | | | | | | | match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__ mechanism. In the process, fix a bug where isinstance() and issubclass(), when given a tuple of classes as second argument, were looking up __instancecheck__ / __subclasscheck__ on the tuple rather than on each type object. Reviewed by Benjamin Peterson and Raymond Hettinger.
* Fix memory leak: Always DECREF obj in PyBuffer_Release.Martin v. Löwis2008-08-141-5/+3
|
* Make obj an owned reference in Py_buffer; this checkinMartin v. Löwis2008-08-141-1/+4
| | | | was missing from the patch for #3139.
* Issue #3139: Make buffer-interface thread-safe wrt. PyArg_ParseTuple,Martin v. Löwis2008-08-121-20/+22
| | | | | | | by denying s# to parse objects that have a releasebuffer procedure, and introducing s*. More module might need to get converted to use s*.
* Correct grammar.Skip Montanaro2008-07-071-1/+1
|
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-22/+22
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Remove locking part of new buffer protocol.Travis E. Oliphant2008-06-061-6/+0
|
* Renamed PyString to PyBytesChristian Heimes2008-05-261-22/+22
|
* Prevent namespace pollution, add static for internal functionsNeal Norwitz2008-04-151-2/+2
|
* Remove unnecessary traceback save/restore pair.Raymond Hettinger2008-03-191-4/+2
|
* Fix compiler warning.Raymond Hettinger2008-03-191-1/+1
|
* Speed-up isinstance() for one easy case.Raymond Hettinger2008-03-181-0/+5
|
* Finish backporting new buffer API to Python 2.6. Left to do: memoryview ↵Travis E. Oliphant2008-03-181-0/+369
| | | | object and structmodule. But, these need to be finished in Python 3.0 first. No objects support the new buffer API in Python 2.6 as of yet, and except for the memoryview object, I don't think they will.
* Backport of PEP 3101, Advanced String Formatting, from py3k.Eric Smith2008-02-171-0/+132
| | | | | | | | | | | | | | | 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).
* 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.
* Use a static and interned string for __subclasscheck__ and __instancecheck__ ↵Christian Heimes2008-02-141-2/+16
| | | | as suggested by Thomas Heller in #2115
* Added PyNumber_ToBase and supporting routines _PyInt_Format andEric Smith2008-02-101-0/+19
| | | | | | | | | | | | | | | | | _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.
* Make int() and long() fall back to __trunc__(). See issue 2002.Jeffrey Yasskin2008-02-041-0/+94
|
* static PyObject* variables should use PyString_InternFromString() instead of ↵Christian Heimes2008-01-281-2/+2
| | | | PyObject_FromString() to store a python string in a function level static var.
* Fix Issue 1045.Raymond Hettinger2007-12-061-30/+38
| | | | | 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-051-2/+3
| | | | can make list() raise a SystemError
* Properly indent two lines. (Spotted because it caused merge conflicts in theThomas Wouters2007-09-181-2/+2
| | | | py3k branch ;)
* 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 crasher where Python code managed to infinitely recurse in C code withoutBrett Cannon2007-09-071-1/+5
| | | | | | | 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.
* Silence compiler warningRaymond Hettinger2007-02-071-1/+1
|
* Bug #1575169: operator.isSequenceType() now returns False for subclasses of ↵Raymond Hettinger2007-02-071-0/+2
| | | | dict.
* Forward-port of r52136,52138: a review of overflow-detecting code.Armin Rigo2006-10-041-8/+6
| | | | | | | | | | | | | | | | | | | | | | | * unified the way intobject, longobject and mystrtoul handle values around -sys.maxint-1. * in general, trying to entierely avoid overflows in any computation involving signed ints or longs is extremely involved. Fixed a few simple cases where a compiler might be too clever (but that's all guesswork). * more overflow checks against bad data in marshal.c. * 2.5 specific: fixed a number of places that were still confusing int and Py_ssize_t. Some of them could potentially have caused "real-world" breakage. * list.pop(x): fixing overflow issues on x was messy. I just reverted to PyArg_ParseTuple("n"), which does the right thing. (An obscure test was trying to give a Decimal to list.pop()... doesn't make sense any more IMHO) * trying to write a few tests...
* Subclasses of int/long are allowed to define an __index__.Neal Norwitz2006-08-151-4/+2
|
* Patch #1538606, Patch to fix __index__() clipping.Neal Norwitz2006-08-121-21/+84
| | | | | | | I modified this patch some by fixing style, some error checking, and adding XXX comments. This patch requires review and some changes are to be expected. I'm checking in now to get the greatest possible review and establish a baseline for moving forward. I don't want this to hold up release if possible.
* Remove "non-mapping" and "non-sequence" from TypeErrors raised byGeorg Brandl2006-08-081-2/+2
| | | | | | | PyMapping_Size and PySequence_Size. Because len() tries first sequence, then mapping size, it will always raise a "non-mapping object has no len" error which is confusing.
* Fix for an obscure bug introduced by revs 46806 and 46808, with a test.Armin Rigo2006-06-211-11/+1
| | | | | | | | | | | | | | The problem of checking too eagerly for recursive calls is the following: if a RuntimeError is caused by recursion, and if code needs to normalize it immediately (as in the 2nd test), then PyErr_NormalizeException() needs a call to the RuntimeError class to instantiate it, and this hits the recursion limit again... causing PyErr_NormalizeException() to never finish. Moved this particular recursion check to slot_tp_call(), which is not involved in instantiating built-in exceptions. Backport candidate.
* Patch #1507676: improve exception messages in abstract.c, object.c and ↵Georg Brandl2006-06-181-39/+43
| | | | typeobject.c.
* Fix bug introduced in rev. 46806 by not having variable declaration at the ↵Brett Cannon2006-06-091-2/+4
| | | | top of a block.
* An object with __call__ as an attribute, when called, will have that ↵Brett Cannon2006-06-091-0/+8
| | | | | | attribute checked for __call__ itself, and will continue to look until it finds an object without the attribute. This can lead to an infinite recursion. Closes bug #532646, again. Will be backported.
* Fix coding style guide bug.Brett Cannon2006-06-061-1/+2
|
* C++ compilation cleanup: Migrate declaration ofSkip Montanaro2006-04-181-7/+0
| | | | | _PyObject_Call(Function|Method)_SizeT into Include/abstract.h. This gets them under the umbrella of the extern "C" { ... } block in that file.
* Make Py_BuildValue, PyObject_CallFunction andMartin v. Löwis2006-04-141-28/+90
| | | | PyObject_CallMethod aware of PY_SSIZE_T_CLEAN.
* Minor bugs in the __index__ code (PEP 357), with tests.Armin Rigo2006-03-301-2/+3
|
* Stop duplicating code and handle slice indices consistently and correctlyNeal Norwitz2006-03-231-20/+2
| | | | wrt to ssize_t.
* Update function name to reflect params and stop casting to long to avoid ↵Neal Norwitz2006-03-201-5/+5
| | | | losing data
* Checking in the code for PEP 357.Guido van Rossum2006-03-071-44/+32
| | | | | | This was mostly written by Travis Oliphant. I've inspected it all; Neal Norwitz and MvL have also looked at it (in an earlier incarnation).