summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* bpo-26219: per opcode cache for LOAD_GLOBAL (GH-12884)Inada Naoki2019-06-032-12/+78
| | | | | | This patch implements per opcode cache mechanism, and use it in only LOAD_GLOBAL opcode. Based on Yury's opcache3.patch in bpo-26219.
* bpo-36027: Really fix "incompatible pointer type" compiler warning (GH-13761)Petr Viktorin2019-06-031-1/+1
| | | Apologies for the earlier hasty attempt.
* bpo-36974: add some assertions for PEP 590 (GH-13682)Jeroen Demeyer2019-06-021-0/+14
|
* bpo-37012: Clean up special cases in PyType_FromSpecWithBases slot ↵Petr Viktorin2019-06-021-9/+11
| | | | | | | | | assignments (GH-13496) The main slot assignment loop is now if-else if ladder, making the control flow clearer. Based on suggestion by Victor Stinner in: https://github.com/python/cpython/pull/10304/#issuecomment-491123026
* bpo-36027 bpo-36974: Fix "incompatible pointer type" compiler warnings ↵Petr Viktorin2019-06-021-1/+1
| | | | (GH-13758)
* bpo-36974: Make tp_call=PyVectorcall_Call work for inherited types (GH-13699)Petr Viktorin2019-06-022-11/+25
| | | | | | | | | | | | | | | | | | When inheriting a heap subclass from a vectorcall class that sets `.tp_call=PyVectorcall_Call` (as recommended in PEP 590), the subclass does not inherit `_Py_TPFLAGS_HAVE_VECTORCALL`, and thus `PyVectorcall_Call` does not work for it. This attempts to solve the issue by: * always inheriting `tp_vectorcall_offset` unless `tp_call` is overridden in the subclass * inheriting _Py_TPFLAGS_HAVE_VECTORCALL for static types, unless `tp_call` is overridden * making `PyVectorcall_Call` ignore `_Py_TPFLAGS_HAVE_VECTORCALL` This means it'll be ever more important to only call `PyVectorcall_Call` on classes that support vectorcall. In `PyVectorcall_Call`'s intended role as `tp_call` filler, that's not a problem.
* Call PyObject_GC_UnTrack in structseq dealloc (GH-13751)Pablo Galindo2019-06-021-0/+1
|
* bpo-37126: Allow structseq objects to be tracked by the GC (GH-13729)Pablo Galindo2019-06-021-2/+18
|
* bpo-36027: Extend three-argument pow to negative second argument (GH-13266)Mark Dickinson2019-06-021-12/+118
|
* bpo-20092. Use __index__ in constructors of int, float and complex. (GH-13108)Serhiy Storchaka2019-06-013-3/+31
|
* bpo-36842: Pass positional only parameters to code_new audit hook (GH-13707)Pablo Galindo2019-06-011-3/+3
|
* Improve exception message for str.format (GH-12675)Francisco Couzo2019-06-011-2/+7
|
* bpo-37122: Make co->co_argcount represent the total number of positonal ↵Pablo Galindo2019-06-013-11/+10
| | | | arguments in the code object (GH-13726)
* Improve docstring of list.sort (GH-8516)Tim Hoffmann2019-06-012-4/+20
|
* bpo-37029: keep usable_arenas in sorted order without searching (#13612)Tim Peters2019-06-011-32/+77
| | | | | This adds a vector of "search fingers" so that usable_arenas can be kept in sorted order (by number of free pools) via constant-time operations instead of linear search. This should reduce worst-case time for reclaiming a great many objects from O(A**2) to O(A), where A is the number of arenas. See bpo-37029.
* bpo-37108: Support super with methods that use positional-only arguments ↵Pablo Galindo2019-05-311-1/+1
| | | | (GH-13695)
* bpo-36379: __ipow__ must be a ternaryfunc, not a binaryfunc (GH-13546)Zackery Spytz2019-05-311-1/+1
| | | | | | | If a type's __ipow__ method was implemented in C, attempting to use the *modulo* parameter would cause crashes. https://bugs.python.org/issue36379
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-3135-156/+155
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-36974: rename _FastCallKeywords -> _Vectorcall (GH-13653)Jeroen Demeyer2019-05-304-11/+11
|
* bpo-36974: remove _PyObject_HasFastCall (GH-13460)Jeroen Demeyer2019-05-301-16/+0
|
* bpo-36974: inherit the vectorcall protocol (GH-13498)Jeroen Demeyer2019-05-301-0/+11
|
* bpo-32388: Remove cross-version binary compatibility requirement in tp_flags ↵Antoine Pitrou2019-05-293-17/+8
| | | | | | | | (GH-4944) It is now allowed to add new fields at the end of the PyTypeObject struct without having to allocate a dedicated compatibility flag in tp_flags. This will reduce the risk of running out of bits in the 32-bit tp_flags value.
* bpo-22385: Support output separators in hex methods. (#13578)Gregory P. Smith2019-05-296-26/+303
| | | | | | | | | | | | | | | | | | * bpo-22385: Support output separators in hex methods. Also in binascii.hexlify aka b2a_hex. The underlying implementation behind all hex generation in CPython uses the same pystrhex.c implementation. This adds support to bytes, bytearray, and memoryview objects. The binascii module functions exist rather than being slated for deprecation because they return bytes rather than requiring an intermediate step through a str object. This change was inspired by MicroPython which supports sep in its binascii implementation (and does not yet support the .hex methods). https://bugs.python.org/issue22385
* bpo-36974: implement PEP 590 (GH-13185)Jeroen Demeyer2019-05-295-111/+169
| | | | | Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be> Co-authored-by: Mark Shannon <mark@hotpy.org>
* remove unnecessary tp_dealloc (GH-13647)Inada Naoki2019-05-294-30/+4
|
* bpo-26423: Fix possible overflow in wrap_lenfunc() (GH-13606)Zackery Spytz2019-05-281-1/+1
| | | | Fix possible overflow in wrap_lenfunc() when sizeof(long) < sizeof(Py_ssize_t) (e.g., 64-bit Windows).
* bpo-36922: implement PEP-590 Py_TPFLAGS_METHOD_DESCRIPTOR (GH-13338)Jeroen Demeyer2019-05-284-6/+17
| | | Co-authored-by: Mark Shannon <mark@hotpy.org>
* bpo-36763: Implement the PEP 587 (GH-13592)Victor Stinner2019-05-278-56/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a whole new documentation page: "Python Initialization Configuration" * PyWideStringList_Append() return type is now PyStatus, instead of int * PyInterpreterState_New() now calls PyConfig_Clear() if PyConfig_InitPythonConfig() fails. * Rename files: * Python/coreconfig.c => Python/initconfig.c * Include/cpython/coreconfig.h => Include/cpython/initconfig.h * Include/internal/: pycore_coreconfig.h => pycore_initconfig.h * Rename structures * _PyCoreConfig => PyConfig * _PyPreConfig => PyPreConfig * _PyInitError => PyStatus * _PyWstrList => PyWideStringList * Rename PyConfig fields: * use_module_search_paths => module_search_paths_set * module_search_path_env => pythonpath_env * Rename PyStatus field: _func => func * PyInterpreterState: rename core_config field to config * Rename macros and functions: * _PyCoreConfig_SetArgv() => PyConfig_SetBytesArgv() * _PyCoreConfig_SetWideArgv() => PyConfig_SetArgv() * _PyCoreConfig_DecodeLocale() => PyConfig_SetBytesString() * _PyInitError_Failed() => PyStatus_Exception() * _Py_INIT_ERROR_TYPE_xxx enums => _PyStatus_TYPE_xxx * _Py_UnixMain() => Py_BytesMain() * _Py_ExitInitError() => Py_ExitStatusException() * _Py_PreInitializeFromArgs() => Py_PreInitializeFromBytesArgs() * _Py_PreInitializeFromWideArgs() => Py_PreInitializeFromArgs() * _Py_PreInitialize() => Py_PreInitialize() * _Py_RunMain() => Py_RunMain() * _Py_InitializeFromConfig() => Py_InitializeFromConfig() * _Py_INIT_XXX() => _PyStatus_XXX() * _Py_INIT_FAILED() => _PyStatus_EXCEPTION() * Rename 'err' PyStatus variables to 'status' * Convert RUN_CODE() macro to config_run_code() static inline function * Remove functions: * _Py_InitializeFromArgs() * _Py_InitializeFromWideArgs() * _PyInterpreterState_GetCoreConfig()
* bpo-36785: PEP 574 implementation (GH-7076)Antoine Pitrou2019-05-262-0/+220
|
* bpo-28866: No type cache for types with specialized mro, invalidation is ↵Julien Palard2019-05-261-8/+30
| | | | | | | | | | | | | | | | | | hard. (#13157) * No type cache for types with specialized mro, invalidation is hard. * FIX: Don't disable method cache custom types that do not implement mro(). * fixing implem. * Avoid storing error flags, also decref. * news entry * Clear as soon as we're getting an error. * FIX: Reference leak.
* bpo-37017: PyObject_CallMethodObjArgs uses LOAD_METHOD optimization (GH-13516)Michael J. Sullivan2019-05-261-16/+29
| | | | | | | | | Update PyObject_CallMethodObjArgs and _PyObject_CallMethodIdObjArgs to use _PyObject_GetMethod to avoid creating a bound method object in many cases. On a microbenchmark of PyObject_CallMethodObjArgs calling a method on an interpreted Python class, this optimization resulted in a 1.7x speedup.
* bpo-37032: Add CodeType.replace() method (GH-13542)Victor Stinner2019-05-242-4/+331
|
* bpo-20285: Improve help docs for object (GH-4759)Cheryl Sabella2019-05-241-1/+6
|
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-236-1/+142
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-35091: Objects/listobject.c: Replace overflow checks in gallop fu… ↵Alexey Izbyshev2019-05-231-8/+4
| | | | | | | | | | | | | | | | (GH-10202) …nctions with asserts The actual overflow can never happen because of the following: * The size of a list can't be greater than PY_SSIZE_T_MAX / sizeof(PyObject*). * The size of a pointer on all supported plaftorms is at least 4 bytes. * ofs is positive and less than the list size at the beginning of each iteration. https://bugs.python.org/issue35091
* bpo-36907: fix refcount bug in _PyStack_UnpackDict() (GH-13381)Jeroen Demeyer2019-05-221-5/+12
|
* closes bpo-36951: Correct some types in the type_members struct in ↵Zackery Spytz2019-05-201-3/+3
| | | | typeobject.c. (GH-13403)
* bpo-36957: Add _PyLong_Rshift() and _PyLong_Lshift(). (GH-13416)Serhiy Storchaka2019-05-192-30/+77
|
* Fix couple of dead code paths (GH-7418)David Carlier2019-05-172-3/+0
|
* bpo-36763: Add _PyInitError functions (GH-13395)Victor Stinner2019-05-172-0/+2
| | | | | | | | | | | | | | | * Add _PyInitError functions: * _PyInitError_Ok() * _PyInitError_Error() * _PyInitError_NoMemory() * _PyInitError_Exit() * _PyInitError_IsError() * _PyInitError_IsExit() * _PyInitError_Failed() * frozenmain.c and _testembed.c now use functions rather than macros. * Move _Py_INIT_xxx() macros to the internal API. * Move _PyWstrList_INIT macro to the internal API.
* bpo-36763: Add PyMemAllocatorName (GH-13387)Victor Stinner2019-05-171-14/+59
| | | | | | | | | | | | | | * Add PyMemAllocatorName enum * _PyPreConfig.allocator type becomes PyMemAllocatorName, instead of char* * Remove _PyPreConfig_Clear() * Add _PyMem_GetAllocatorName() * Rename _PyMem_GetAllocatorsName() to _PyMem_GetCurrentAllocatorName() * Remove _PyPreConfig_SetAllocator(): just call _PyMem_SetupAllocators() directly, we don't have do reallocate the configuration with the new allocator anymore! * _PyPreConfig_Write() parameter becomes const, as it should be in the first place!
* Fix typo in _PyMethodDef_RawFastCallKeywords error message (GH-13343)Jeroen Demeyer2019-05-171-1/+1
|
* bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)Zackery Spytz2019-05-174-4/+8
| | | | | | | The final addition (cur += step) may overflow, so use size_t for "cur". "cur" is always positive (even for negative steps), so it is safe to use size_t here. Co-Authored-By: Martin Panter <vadmium+py@gmail.com>
* bpo-36900: Replace global conf vars with config (GH-13299)Victor Stinner2019-05-143-7/+15
| | | | | | Replace global configuration variables with core_config read from the current interpreter. Cleanup dynload_hpux.c.
* bpo-27987: pymalloc: align by 16bytes on 64bit platform (GH-12850)Inada Naoki2019-05-141-0/+6
|
* bpo-35983: skip trashcan for subclasses (GH-11841)Jeroen Demeyer2019-05-107-95/+14
| | | | | Add new trashcan macros to deal with a double deallocation that could occur when the `tp_dealloc` of a subclass calls the `tp_dealloc` of a base class and that base class uses the trashcan mechanism. Patch by Jeroen Demeyer.
* bpo-36869: fix warning of unused variables (GH-13182)Emmanuel Arias2019-05-101-1/+2
|
* Fix a possible crash due to PyType_FromSpecWithBases() (GH-10304)Zackery Spytz2019-05-091-0/+1
| | | | If the PyObject_MALLOC() call failed in PyType_FromSpecWithBases(), PyObject_Free() would be called on a static string in type_dealloc().
* closes bpo-36861: Update Unicode database to 12.1.0. (GH-13214)Benjamin Peterson2019-05-091-1/+1
| | | Adds ㋿.
* bpo-36793: Remove unneeded __str__ definitions. (GH-13081)Serhiy Storchaka2019-05-064-4/+4
| | | | Classes that define __str__ the same as __repr__ can just inherit it from object.