summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
...
* | Add line explaining the "%sort" test.Tim Peters2013-08-221-0/+1
|\ \ | |/
| * Add line explaining the "%sort" test.Tim Peters2013-08-221-0/+1
| | | | | | | | (grafted from 1ea833ecaf5a9d43a886e9e73b4e2551d0d5b548)
* | Issue 18797: Remove unneeded refcount adjustments for dummy objects.Raymond Hettinger2013-08-221-16/+6
| | | | | | | | It suffices to keep just one reference when the object is created.
* | Hoist the global dummy lookup out of the inner loop for set_merge().Raymond Hettinger2013-08-211-1/+3
| |
* | Remove a redundant hash table probe (this was artifact from an earlier draft ↵Raymond Hettinger2013-08-211-11/+0
| | | | | | | | of the patch).
* | Issue 18772: Restore set dummy object back to unicode and restore the ↵Raymond Hettinger2013-08-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | identity checks in lookkey(). The Gdb prettyprint plugin depended on the dummy object being displayable. Other solutions besides a unicode object are possible. For now, get it back up and running. The identity checks in lookkey() need to be there to prevent the dummy object from leaking through Py_RichCompareBool() into user code in the rare circumstance where the dummy's hash value exactly matches the hash value of the actual key being looked up.
* | Issue18771: Reduce the cost of hash collisions for set objects.Raymond Hettinger2013-08-191-20/+86
| |
* | Remove the else-clause because the conditions are no longer mutually exclusive.Raymond Hettinger2013-08-171-1/+1
| |
* | Use a known unique object for the dummy entry.Raymond Hettinger2013-08-171-25/+20
| | | | | | | | | | This lets us run PyObject_RichCompareBool() without first needing to check whether the entry is a dummy.
* | Issue #18701: Remove support of old CPython versions (<3.0) from C code.Serhiy Storchaka2013-08-161-5/+0
| |
* | Hoist the global "dummy" lookup outside of the reinsertion loop.Raymond Hettinger2013-08-151-1/+3
| |
* | mergeRaymond Hettinger2013-08-141-9/+0
|\ \ | |/
| * Issue 18719: Remove a false optimizationRaymond Hettinger2013-08-141-9/+0
| | | | | | | | | | | | | | | | | | | | Remove an unused early-out test from the critical path for dict and set lookups. When the strings already have matching lengths, kinds, and hashes, there is no additional information gained by checking the first characters (the probability of a mismatch is already known to be less than 1 in 2**64).
| * Silence compiler warning for an unused declarationRaymond Hettinger2013-08-041-1/+0
| |
* | Issue #18722: Remove uses of the "register" keyword in C code.Antoine Pitrou2013-08-1320-196/+196
| |
* | Replace outdated optimization with clearer code that compiles better.Raymond Hettinger2013-08-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Letting the compiler decide how to optimize the multiply by five gives it the freedom to make better choices for the best technique for a given target machine. For example, GCC on x86_64 produces a little bit better code: Old-way (3 steps with a data dependency between each step): shrq $5, %r13 leaq 1(%rbx,%r13), %rax leaq (%rax,%rbx,4), %rbx New-way (3 steps with no dependency between the first two steps which can be run in parallel): leaq (%rbx,%rbx,4), %rax # i*5 shrq $5, %r13 # perturb >>= PERTURB_SHIFT leaq 1(%r13,%rax), %rbx # 1 + perturb + i*5
* | Issue #17934: Add a clear() method to frame objects, to help clean up ↵Antoine Pitrou2013-08-052-5/+31
| | | | | | | | expensive details (local variables) and break reference cycles.
* | mergeRaymond Hettinger2013-08-041-1/+1
|\ \ | |/
| * Silence compiler warning about an uninitialized variableRaymond Hettinger2013-08-041-1/+1
| |
* | Issue #16741: Fix an error reporting in int().Serhiy Storchaka2013-08-032-52/+64
|\ \ | |/
| * Issue #16741: Fix an error reporting in int().Serhiy Storchaka2013-08-032-51/+67
| |
* | Minor consistency fixes for some longobject.c exception messages:Mark Dickinson2013-08-031-4/+4
| | | | | | | | | | | | - replace 'long int' / 'long' by 'int' - fix capitalization of "Python" in PyLong_AsUnsignedLong - "is too large" -> "too large", for consistency with other messages.
* | Issue #18214: Improve finalization of Python modules to avoid setting their ↵Antoine Pitrou2013-07-311-8/+21
| | | | | | | | globals to None, in most cases.
* | Issue #18112: PEP 442 implementation (safe object finalization).Antoine Pitrou2013-07-303-123/+147
| |
* | Issue #18520: Fix _PyDict_GetItemId(), suppress _PyUnicode_FromId() errorVictor Stinner2013-07-221-1/+3
| | | | | | | | | | As PyDict_GetItem(), _PyDict_GetItemId() suppresses all errors that may occur, for historical reasons.
* | Issue #18520: Fix PyFunction_NewWithQualName() error handlingVictor Stinner2013-07-221-10/+9
| |
* | Reindent PyFunction_NewWithQualName()Victor Stinner2013-07-221-49/+49
| |
* | Issue #18520: Add a new PyStructSequence_InitType2() function, same thanVictor Stinner2013-07-223-15/+37
| | | | | | | | | | | | | | | | PyStructSequence_InitType() except that it has a return value (0 on success, -1 on error). * PyStructSequence_InitType2() now raises MemoryError on memory allocation failure * Fix also some calls to PyDict_SetItemString(): handle error
* | Propagate error when PyByteArray_Resize() fails in bytearray_translate()Christian Heimes2013-07-211-1/+4
|\ \ | |/ | | | | CID 715334
| * Propagate error when PyByteArray_Resize() fails in bytearray_translate()Christian Heimes2013-07-211-1/+4
| | | | | | | | CID 715334
* | Check return value of PyType_Ready(&EncodingMapType)Christian Heimes2013-07-201-1/+2
|\ \ | |/ | | | | CID 486654
| * Check return value of PyType_Ready(&EncodingMapType)Christian Heimes2013-07-201-1/+2
| | | | | | | | CID 486654
* | Issue #18327: Fix argument order in call to compatible_for_assignment(oldto, ↵Christian Heimes2013-07-201-1/+1
| | | | | | | | | | | | newto, attr). The fix only affects the error message of __class__ assignment. CID 983564
* | Issue #18408: Fix list_ass_slice(), handle list_resize() failureVictor Stinner2013-07-191-3/+8
| | | | | | | | | | I tested the patch manually by injecting a fault using gdb: list items are correctly restored on failure.
* | Issue #18408: PyObject_Str(), PyObject_Repr() and type_call() now fail with anVictor Stinner2013-07-172-0/+23
| | | | | | | | | | | | | | assertion error if they are called with an exception set (PyErr_Occurred()). As PyEval_EvalFrameEx(), they may clear the current exception and so the caller looses its exception.
* | Issue #18408: Fix dict_repr(), don't call PyObject_Repr() with an exception setVictor Stinner2013-07-171-0/+3
| | | | | | | | | | PyObject_Repr() can removes the current exception. For example, module_repr() calls PyErr_Clear() if calling loader.module_repr(mod) failed.
* | longobject.c: add an assertion to ensure that MEDIUM_VALUE() is only called onVictor Stinner2013-07-171-1/+2
| | | | | | | | small integers (0 or 1 digit)
* | Issue #18408: Rewrite NEGATE() macro in longobject.c to handle ↵Victor Stinner2013-07-171-24/+51
| | | | | | | | PyLong_FromLong() failure
* | Issue #18408: Fix PyType_Ready(), handle _PyDict_SetItemId() failureVictor Stinner2013-07-171-3/+7
| |
* | Issue #18408: Fix Py_ReprEnter(), handle PyList_Append() failureVictor Stinner2013-07-171-1/+2
| |
* | Issue #18408: Fix listpop(), handle list_ass_slice() failureVictor Stinner2013-07-171-6/+4
| |
* | Issue #18408: Fix structseq_reduce(), handle PyDict_SetItemString() failureVictor Stinner2013-07-171-11/+13
| |
* | Close #18469: Replace PyDict_GetItemString() with _PyDict_GetItemId() in ↵Victor Stinner2013-07-161-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | structseq.c _PyDict_GetItemId() is more efficient: it only builds the Unicode string once. Identifiers (dictionary keys) are now created at Python initialization, and if the creation failed, Python does exit with a fatal error. Before, PyDict_GetItemString() failure was not handled: structseq_new() could call PyObject_GC_NewVar() with a negative size, and structseq_dealloc() could also crash.
* | Cleanup type_call() to ease debugVictor Stinner2013-07-161-4/+6
| | | | | | | | | | | | It was easy to miss the call to type->tp_init because it was done in a long conditional expression. Split the long expression in multiple lines to make the debug step by step easier.
* | Issue #18408: Py_ReprLeave() now saves/restores the current exception,Victor Stinner2013-07-161-2/+11
| | | | | | | | and ignores exceptions raised during the call
* | Issue #18408: dict_new() now fails on new_keys_object() errorVictor Stinner2013-07-161-10/+9
| | | | | | | | Pass the MemoryError exception to the caller, instead of using empty keys.
* | Cleanup dictobject.cVictor Stinner2013-07-161-17/+19
| |
* | Issue #18408: Fix PyDict_GetItemString(), suppress PyUnicode_FromString() errorVictor Stinner2013-07-161-1/+3
| | | | | | | | | | As PyDict_GetItem(), PyDict_GetItemString() suppresses all errors that may occur for historical reasons.
* | Issue #18408: Fix list.extend(), handle list_resize() failureVictor Stinner2013-07-161-2/+4
| |
* | Issue #18408: add more assertions on PyErr_Occurred() in ceval.c to detect bugsVictor Stinner2013-07-151-2/+1
| | | | | | | | earlier