summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-39489: Remove COUNT_ALLOCS special build (GH-18259)Victor Stinner2020-02-035-234/+0
| | | | | | | | | | | Remove: * COUNT_ALLOCS macro * sys.getcounts() function * SHOW_ALLOC_COUNT code in listobject.c * SHOW_TRACK_COUNT code in tupleobject.c * PyConfig.show_alloc_count field * -X showalloccount command line option * @test.support.requires_type_collecting decorator
* bpo-36051: Fix compiler warning. (GH-18325)Inada Naoki2020-02-031-1/+1
|
* Fix 5-space indentation and trailing whitespace (GH-18311)Mark Dickinson2020-02-021-11/+11
|
* bpo-39487: Merge duplicated _Py_IDENTIFIER identifiers in C code (GH-18254)Hai Shi2020-01-308-22/+17
| | | Moving repetitive `_Py_IDENTIFIER` instances to a global location helps identify them more easily in regards to sub-interpreter support.
* bpo-39434: Improve float __floordiv__ performance and error message (GH-18147)Dong-hee Na2020-01-301-31/+39
|
* bpo-38631: Add _Py_NO_RETURN to functions calling Py_FatalError() (GH-18278)Victor Stinner2020-01-302-4/+4
| | | | | | | | | Add _Py_NO_RETURN to functions calling Py_FatalError(): * _PyObject_AssertFailed() * dummy_dealloc() * faulthandler_fatal_error_thread() * none_dealloc() * notimplemented_dealloc()
* bpo-38631: Avoid Py_FatalError() in unicodeobject.c (GH-18281)Victor Stinner2020-01-301-23/+28
| | | | | Replace Py_FatalError() calls with _PyErr_WriteUnraisableMsg(), _PyObject_ASSERT_FAILED_MSG() or Py_UNREACHABLE() in unicode_dealloc() and unicode_release_interned().
* bpo-38631: Replace tp_new_wrapper() fatal error with SystemError (GH-18262)Victor Stinner2020-01-301-2/+6
| | | | tp_new_wrapper() now raises a SystemError if called with non-type self, rather than calling Py_FatalError() which cannot be catched.
* bpo-38631: Avoid Py_FatalError() in init_slotdefs() (GH-18263)Victor Stinner2020-01-302-16/+25
| | | | | | Rename init_slotdefs() to _PyTypes_InitSlotDefs() and add a return value of type PyStatus. The function is now called exactly once from _PyTypes_Init(). Replace calls to init_slotdefs() with an assertion checking that slotdefs is initialized.
* bpo-38631: Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() (GH-18258)Victor Stinner2020-01-302-32/+32
| | | | | | | | | | | | | | Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() in object.c and typeobject.c to also dump the involved Python object on a fatal error. It should ease debug when such fatal error occurs. If the double linked list is inconsistent, _Py_ForgetReference() no longer dumps previous and next objects in the fatal error, it now only dumps the current object. It ensures that the error message is displayed even if dumping the object does crash Python. Enhance _Py_ForgetReference() error messages; _PyObject_ASSERT_FAILED_MSG() logs the "_Py_ForgetReference" function name.
* Remove deadcode in _Py_inc_count() (GH-18257)Victor Stinner2020-01-291-2/+0
| | | | (tp->tp_next != NULL) check became redundant with commit 45294a9562e5c360ee8ef8498d8792e05a6eb25e (merged in 2006).
* bpo-36051: Drop GIL during large bytes.join() (GH-17757)Bruce Merry2020-01-291-17/+40
| | | | | Improve multi-threaded performance by dropping the GIL in the fast path of bytes.join. To avoid increasing overhead for small joins, it is only done if the output size exceeds a threshold.
* bpo-38631: Avoid Py_FatalError() in PyCode_New() (GH-18215)Victor Stinner2020-01-271-26/+46
| | | | | | | intern_strings() now raises a SystemError, rather than calling Py_FatalError(). intern_string_constants() now reports exceptions to the caller, rather than ignoring silently exceptions.
* bpo-38631: Avoid Py_FatalError() in _memory_release() (GH-18214)Victor Stinner2020-01-271-1/+2
| | | | | If the export count is negative, _memory_release() now raises a SystemError and returns -1, rather than calling Py_FatalError() which aborts the process.
* bpo-38631: Avoid Py_FatalError() in PyModule_Create2() (GH-18212)Victor Stinner2020-01-271-2/+5
| | | | | | | If PyModule_Create2() is called when the Python import machinery is not initialized, it now raises a SystemError and returns NULL, instead of calling Py_FatalError() which aborts the process. The caller must be prepared to handle NULL anyway.
* bpo-39453: Add testcase for bpo-39453 (GH-18202)Dong-hee Na2020-01-271-1/+1
| | | | | | | | | https://bugs.python.org/issue39453 Automerge-Triggered-By: @pablogsal Automerge-Triggered-By: @pablogsal
* bpo-39453: Make list.__contains__ hold strong references to avoid crashes ↵Dong-hee Na2020-01-271-1/+6
| | | | (GH-18181)
* bpo-39425: Fix list.count performance regression (GH-18119)Dong-hee Na2020-01-221-0/+4
| | | | | | | https://bugs.python.org/issue39425 Automerge-Triggered-By: @pablogsal
* closes bpo-39415: Remove unused codes from longobject.c complexobject.c ↵Dong-hee Na2020-01-223-68/+0
| | | | floatobject.c. (GH-18105)
* bpo-33387: Fix compiler warning in frame_block_unwind() (GH-18099)Victor Stinner2020-01-211-1/+1
| | | | | | Replace int with intptr_t to fix the warning: objects\frameobject.c(341): warning C4244: 'initializing': conversion from '__int64' to 'int', possible loss of data
* bpo-39386: Prevent double awaiting of async iterator (GH-18081)Andrew Svetlov2020-01-201-4/+12
|
* bpo-39372: Clean header files of declared interfaces with no implementations ↵Pablo Galindo2020-01-185-13/+0
| | | | | | | | (GH-18037) The public API symbols being removed are: _PyBytes_InsertThousandsGroupingLocale, _PyBytes_InsertThousandsGrouping, _Py_InitializeFromArgs, _Py_InitializeFromWideArgs, _PyFloat_Repr, _PyFloat_Digits, _PyFloat_DigitsInit, PyFrame_ExtendStack, _PyAIterWrapper_Type, PyNullImporter_Type, PyCmpWrapper_Type, PySortWrapper_Type, PyNoArgsFunction.
* bpo-31031: Unify duplicate bits_in_digit and bit_length (GH-2866)Niklas Fiekas2020-01-161-29/+9
| | | Add _Py_bit_length() to unify duplicate bits_in_digit() and bit_length().
* bpo-39200: Correct the error message for range() empty constructor (GH-17813)Pablo Galindo2020-01-051-29/+44
| | | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Document CodeType.replace (GH-17776)Anthony Sottile2020-01-012-4/+4
|
* bpo-38588: Optimize list comparison. (GH-17766)Inada Naoki2019-12-311-0/+3
| | | Mitigate performance regression of the list comparison caused by 2d5bf56.
* bpo-38588: Fix possible crashes in dict and list when calling ↵Dong-hee Na2019-12-312-0/+9
| | | | | | PyObject_RichCompareBool (GH-17734) Take strong references before calling PyObject_RichCompareBool to protect against the case where the object dies during the call.
* bpo-38610: Fix possible crashes in several list methods (GH-17022)Zackery Spytz2019-12-301-3/+12
| | | Hold strong references to list elements while calling PyObject_RichCompareBool().
* closes bpo-30364: Replace deprecated no_address_safety_analysis attribute. ↵Batuhan Taşkaya2019-12-271-7/+7
| | | | (GH-17702)
* bpo-38858: Small integer per interpreter (GH-17315)Victor Stinner2019-12-171-31/+28
| | | | | | | | | | | | Each Python subinterpreter now has its own "small integer singletons": numbers in [-5; 257] range. It is no longer possible to change the number of small integers at build time by overriding NSMALLNEGINTS and NSMALLPOSINTS macros: macros should now be modified manually in pycore_pystate.h header file. For now, continue to share _PyLong_Zero and _PyLong_One singletons between all subinterpreters.
* bpo-38629: implement __floor__ and __ceil__ for float type (GH-16985)Batuhan Taşkaya2019-12-152-1/+67
|
* bpo-27961: Replace PY_LLONG_MAX, PY_LLONG_MIN and PY_ULLONG_MAX with ↵Sergey Fedoseev2019-12-051-5/+5
| | | | | standard macros (GH-15385) Use standard constants LLONG_MIN, LLONG_MAX and ULLONG_MAX.
* Fix compiler warning in Objects/unicodeobject.c (GH-17440)Pablo Galindo2019-12-021-1/+1
|
* bpo-38922: Raise code.__new__ audit event when code object replace() is ↵Steve Dower2019-11-271-0/+7
| | | | called (GH-17394)
* bpo-27145: small_ints[x] could be returned in long_add and long_sub (GH-15716)HongWeipeng2019-11-261-7/+9
|
* bpo-38896: Remove PyUnicode_ClearFreeList() function (GH-17354)Victor Stinner2019-11-231-9/+0
| | | | Remove PyUnicode_ClearFreeList() function: the Unicode free list has been removed in Python 3.3.
* bpo-38858: Call _PyUnicode_Fini() in Py_EndInterpreter() (GH-17330)Victor Stinner2019-11-221-16/+19
| | | Py_EndInterpreter() now clears the filesystem codec.
* Produce cleaner bytecode for 'with' and 'async with' by generating separate ↵Mark Shannon2019-11-211-172/+378
| | | | | | code for normal and exceptional paths. (#6641) Remove BEGIN_FINALLY, END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Implement finally blocks by code duplication. Reimplement frame.lineno setter using line numbers rather than bytecode offsets.
* bpo-38858: Allocate small integers on the heap (GH-17301)Victor Stinner2019-11-211-36/+19
| | | | Allocate small Python integers (small_ints of longobject.c) on the heap, rather than using static objects.
* bpo-37340: Remove PyMethod_ClearFreeList() and PyCFunction_ClearFreeList() ↵Victor Stinner2019-11-202-29/+0
| | | | | | | | (GH-17284) Remove PyMethod_ClearFreeList() and PyCFunction_ClearFreeList() functions: the free lists of bound method objects have been removed. Remove also _PyMethod_Fini() and _PyCFunction_Fini() functions.
* bpo-36854: Move _PyRuntimeState.gc to PyInterpreterState (GH-17287)Victor Stinner2019-11-201-7/+13
| | | | | * Rename _PyGC_InitializeRuntime() to _PyGC_InitState() * finalize_interp_clear() now also calls _PyGC_Fini() in subinterpreters (clear the GC state).
* bpo-38835: Don't use PyFPE_START_PROTECT and PyFPE_END_PROTECT (GH-17231)Victor Stinner2019-11-202-32/+0
| | | | | The PyFPE_START_PROTECT() and PyFPE_END_PROTECT() macros are empty: they have been doing nothing for the last year (since commit 735ae8d139a673b30b321dc10acfd3d14f0d633b), so stop using them.
* bpo-35409: Ignore GeneratorExit in async_gen_athrow_throw (GH-14755)Vincent Michel2019-11-191-0/+11
| | | | | | | | | Ignore `GeneratorExit` exceptions when throwing an exception into the `aclose` coroutine of an asynchronous generator. https://bugs.python.org/issue35409
* bpo-38631: Avoid Py_FatalError() in float.__getformat__() (GH-17232)Victor Stinner2019-11-181-1/+2
| | | | Replace Py_FatalError() with a regular RuntimeError exception in float.__getformat__().
* bpo-38650: Constify PyStructSequence_UnnamedField. (GH-17005)Serhiy Storchaka2019-11-161-1/+1
| | | | Make it a constant and referring to a constant string.
* bpo-38644: Add _PyEval_EvalCode() (GH-17183)Victor Stinner2019-11-161-26/+29
| | | _PyFunction_Vectorcall() now pass tstate to function calls.
* bpo-38644: Add _PyObject_Call() (GH-17089)Victor Stinner2019-11-142-112/+146
| | | | | | | | | | * Add pycore_call.h internal header file. * Add _PyObject_Call(): PyObject_Call() with tstate * Add _PyObject_CallNoArgTstate(): _PyObject_CallNoArg() with tstate * Add _PyObject_FastCallDictTstate(): _PyObject_FastCallDict() with tstate * _PyObject_Call_Prepend() now takes tstate * Replace _PyObject_FastCall() calls with _PyObject_VectorcallTstate() calls
* bpo-38644: Add _PyEval_EvalFrame() with tstate (GH-17131)Victor Stinner2019-11-142-2/+4
| | | | Add _PyEval_EvalFrame() static inline function to get eval_frame from tstate->interp.
* bpo-38644: Add _PyObject_VectorcallTstate() (GH-17052)Victor Stinner2019-11-083-22/+35
| | | | | * Add _PyObject_VectorcallTstate() function: similar to _PyObject_Vectorcall(), but with tstate parameter * Add tstate parameter to _PyObject_MakeTpCall()
* bpo-38613: Optimize set operations of dict keys. (GH-16961)Inada Naoki2019-11-071-21/+33
|