summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Issue #26200: Restored more safe usages of Py_SETREF.Serhiy Storchaka2016-04-111-2/+2
|\
* \ Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREFSerhiy Storchaka2016-04-106-11/+11
|\ \ | |/ | | | | in places where Py_DECREF was used.
| * Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREFSerhiy Storchaka2016-04-105-10/+10
| | | | | | | | in places where Py_DECREF was used.
* | Issue #17339: Improved TypeError message in bytes constructor.Serhiy Storchaka2016-04-101-16/+15
| |
* | Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-0614-55/+55
|\ \ | |/
| * Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-069-36/+36
| |
* | Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-308-16/+22
|\ \ | |/ | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
| * Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-308-16/+22
| | | | | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
* | Moved misplaced functions to the section for C API functions.Raymond Hettinger2016-03-271-12/+12
| |
* | Responsibility for argument checking belongs in set.__init__() rather than ↵Raymond Hettinger2016-03-261-3/+0
| | | | | | | | | | | | | | set.__new__(). See dict.__new__() and list.__new__() for comparison. Neither of those examine or touch args or kwds. That work is done in the __init__() methods.
* | Speed-up construction of empty sets by approx 12-14%.Raymond Hettinger2016-03-251-2/+3
| |
* | longobject.c: fix compilation warning on Windows 64-bitVictor Stinner2016-03-231-1/+1
| | | | | | | | We know that Py_SIZE(b) is -1 or 1 an so fits into the sdigit type.
* | _PyMem_DebugFree(): fix compiler warning on WindowsVictor Stinner2016-03-231-1/+1
| | | | | | | | Don't return a void value.
* | Optimize bytes.replace(b'', b'.')Victor Stinner2016-03-212-18/+38
| | | | | | | | | | Issue #26574: Optimize bytes.replace(b'', b'.') and bytearray.replace(b'', b'.'): up to 80% faster. Patch written by Josh Snider.
* | Fail if PyMem_Malloc() is called without holding the GILVictor Stinner2016-03-161-7/+7
| | | | | | | | | | Issue #26563: Debug hooks on Python memory allocators now raise a fatal error if functions of the PyMem_Malloc() family are called without holding the GIL.
* | Oops, revert unwanted change used to create an exampleVictor Stinner2016-03-151-1/+0
| | | | | | | | Issue #26564.
* | On memory error, dump the memory block tracebackVictor Stinner2016-03-152-0/+10
| | | | | | | | | | | | Issue #26564: _PyObject_DebugDumpAddress() now dumps the traceback where a memory block was allocated on memory block. Use the tracemalloc module to get the traceback.
* | Check the GIL in PyObject_Malloc()Victor Stinner2016-03-141-22/+70
| | | | | | | | | | Issue #26558: The debug hook of PyObject_Malloc() now checks that the GIL is held when the function is called.
* | Add PYTHONMALLOC env varVictor Stinner2016-03-141-59/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | Issue #26516: * Add PYTHONMALLOC environment variable to set the Python memory allocators and/or install debug hooks. * PyMem_SetupDebugHooks() can now also be used on Python compiled in release mode. * The PYTHONMALLOCSTATS environment variable can now also be used on Python compiled in release mode. It now has no effect if set to an empty string. * In debug mode, debug hooks are now also installed on Python memory allocators when Python is configured without pymalloc.
* | merge 3.5 (closes #26478)Benjamin Peterson2016-03-041-5/+4
|\ \ | |/
| * merge 3.4 (closes #26478)Benjamin Peterson2016-03-041-5/+4
| |\
| | * properly use the ObjArgs variant of CallMethod in dictview binary operations ↵Benjamin Peterson2016-03-041-5/+4
| | | | | | | | | | | | (closes #26478)
* | | Merge 3.5 (issue #25888)Yury Selivanov2016-03-021-6/+6
|\ \ \ | |/ /
| * | coroutines: Error when awaiting on coroutine that's being awaitedYury Selivanov2016-03-021-6/+6
| | | | | | | | | | | | Issue #25888
* | | Merge 3.5Victor Stinner2016-03-011-9/+12
|\ \ \ | |/ /
| * | Issue #26464: Fix unicode_fast_translate() againVictor Stinner2016-03-011-9/+12
| | | | | | | | | | | | Initialize i variable if the string is non-ASCII.
* | | Merge 3.5Victor Stinner2016-03-011-3/+4
|\ \ \ | |/ /
| * | Fix str.translate()Victor Stinner2016-03-011-3/+4
| | | | | | | | | | | | | | | | | | Issue #26464: Fix str.translate() when string is ASCII and first replacements removes character, but next replacement uses a non-ASCII character or a string longer than 1 character. Regression introduced in Python 3.5.0.
* | | Merge 3.5 (issue #25887)Yury Selivanov2016-02-131-12/+21
|\ \ \ | |/ /
| * | Issue #25887: Raise a RuntimeError when a coroutine is awaited more than once.Yury Selivanov2016-02-131-12/+21
| | |
* | | Issues #26289 and #26315: Optimize floor/modulo div for single-digit longsYury Selivanov2016-02-111-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Microbenchmarks show 2-2.5x improvement. Built-in 'divmod' function is now also ~10% faster. -m timeit -s "x=22331" "x//2;x//-3;x//4;x//5;x//-6;x//7;x//8;x//-99;x//100;" with patch: 0.321 without patch: 0.633 -m timeit -s "x=22331" "x%2;x%3;x%-4;x%5;x%6;x%-7;x%8;x%99;x%-100;" with patch: 0.224 without patch: 0.66 Big thanks to Serhiy Storchaka, Mark Dickinson and Victor Stinner for thorow code reviews and algorithms improvements.
* | | Issue #26136: Upgrade the generator_stop warning to DeprecationWarningMartin Panter2016-02-101-1/+1
| | | | | | | | | | | | Patch by Anish Shah.
* | | Issue #25949: __dict__ for an OrderedDict instance is now created only whenSerhiy Storchaka2016-02-081-16/+7
| | | | | | | | | | | | needed.
* | | Issue #26288: Fix commentYury Selivanov2016-02-061-3/+3
| | |
* | | Issue #26288: Optimize PyLong_AsDouble.Yury Selivanov2016-02-061-0/+7
| | |
* | | Add early-out for the common case where kwds is NULL (gives 1.1% speedup).Raymond Hettinger2016-02-041-2/+3
| | |
* | | Issue #23601: Use small object allocator for dict key objectsRaymond Hettinger2016-01-311-3/+3
| | |
* | | Merge 3.5Victor Stinner2016-01-271-0/+2
|\ \ \ | |/ /
| * | Fix resize_compact()Victor Stinner2016-01-271-0/+2
| | | | | | | | | | | | | | | Issue #26217: resize_compact() must set wstr_length to 0 after freeing the wstr string. Otherwise, an assertion fails in _PyUnicode_CheckConsistency().
| * | code_richcompare() now uses the constants typesVictor Stinner2016-01-221-1/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #25843: When compiling code, don't merge constants if they are equal but have a different types. For example, "f1, f2 = lambda: 1, lambda: 1.0" is now correctly compiled to two different functions: f1() returns 1 (int) and f2() returns 1.0 (int), even if 1 and 1.0 are equal. Add a new _PyCode_ConstantKey() private function.
* | | Tests versus zero are more compact than tests versus -1.Raymond Hettinger2016-01-251-6/+6
| | |
* | | code_richcompare() now uses the constants typesVictor Stinner2016-01-221-1/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #25843: When compiling code, don't merge constants if they are equal but have a different types. For example, "f1, f2 = lambda: 1, lambda: 1.0" is now correctly compiled to two different functions: f1() returns 1 (int) and f2() returns 1.0 (int), even if 1 and 1.0 are equal. Add a new _PyCode_ConstantKey() private function.
* | | Issue #26107: Fix typo in Objects/lnotab_notes.txtVictor Stinner2016-01-211-6/+6
| | | | | | | | | | | | Double parenthesis
* | | co_lnotab supports negative line number deltaVictor Stinner2016-01-203-21/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #26107: The format of the co_lnotab attribute of code objects changes to support negative line number delta. Changes: * assemble_lnotab(): if line number delta is less than -128 or greater than 127, emit multiple (offset_delta, lineno_delta) in co_lnotab * update functions decoding co_lnotab to use signed 8-bit integers - dis.findlinestarts() - PyCode_Addr2Line() - _PyCode_CheckLineNumber() - frame_setlineno() * update lnotab_notes.txt * increase importlib MAGIC_NUMBER to 3361 * document the change in What's New in Python 3.6 * cleanup also PyCode_Optimize() to use better variable names
* | | Merge 3.5Victor Stinner2016-01-201-4/+2
|\ \ \ | |/ / | | | | | | Issue #26154: Add a new private _PyThreadState_UncheckedGet() function.
| * | Add _PyThreadState_UncheckedGet()Victor Stinner2016-01-201-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #26154: Add a new private _PyThreadState_UncheckedGet() function which gets the current thread state, but don't call Py_FatalError() if it is NULL. Python 3.5.1 removed the _PyThreadState_Current symbol from the Python C API to no more expose complex and private atomic types. Atomic types depends on the compiler or can even depend on compiler options. The new function _PyThreadState_UncheckedGet() allows to get the variable value without having to care of the exact implementation of atomic types. Changes: * Replace direct usage of the _PyThreadState_Current variable with a call to _PyThreadState_UncheckedGet(). * In pystate.c, replace direct usage of the _PyThreadState_Current variable with the PyThreadState_GET() macro for readability. * Document also PyThreadState_Get() in pystate.h
* | | Issue #25935: Garbage collector now breaks reference loops with OrderedDict.Serhiy Storchaka2016-01-191-13/+14
|\ \ \ | |/ /
| * | Issue #25935: Garbage collector now breaks reference loops with OrderedDict.Serhiy Storchaka2016-01-191-13/+14
| | |
* | | merge 3.5 (#25731)Benjamin Peterson2016-01-191-1/+1
|\ \ \ | |/ /
| * | set tp_new from the class in the hierarchy that actually owns the descriptor ↵Benjamin Peterson2016-01-191-1/+1
| | | | | | | | | | | | | | | | | | (closes #25731) Debugging by Eryk Sun.