summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36642: make unicodedata const (GH-12855)Inada Naoki2019-04-161-2/+2
|
* bpo-36611: Disable serialno field of debug memory allocators (#12796)Victor Stinner2019-04-121-19/+54
| | | | | | | | | | | Omit serialno field from debug hooks on Python memory allocators to reduce the memory footprint by 5%. Enable tracemalloc to get the traceback where a memory block has been allocated when a fatal memory error is logged to decide where to put a breakpoint. Compile Python with PYMEM_DEBUG_SERIALNO defined to get back the field.
* bpo-36389: Add _PyObject_CheckConsistency() function (GH-12803)Victor Stinner2019-04-124-114/+139
| | | | | | Add a new _PyObject_CheckConsistency() function which can be used to help debugging. The function is available in release mode. Add a 'check_content' parameter to _PyDict_CheckConsistency().
* bpo-36549: str.capitalize now titlecases the first character instead of ↵Kingsley M2019-04-121-1/+1
| | | | uppercasing it (GH-12804)
* bpo-20180: Use argument clinic for dict.pop() and dict.popitem() (GH-12792)Inada Naoki2019-04-122-35/+99
|
* bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782)Victor Stinner2019-04-112-8/+10
| | | | | Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD, 0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte patterns than Windows CRT debug malloc() and free().
* bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770)Victor Stinner2019-04-112-25/+8
| | | | | | | | | Replace _PyMem_IsFreed() function with _PyMem_IsPtrFreed() inline function. The function is now way more efficient, it became a simple comparison on integers, rather than a short loop. It detects also uninitialized bytes and "forbidden bytes" filled by debug hooks on memory allocators. Add unit tests on _PyObject_IsFreed().
* bpo-29202: improve dict iteration (GH-11900)Cheryl Sabella2019-04-051-9/+6
| | | Use fewer iterations instead of iterating over the whole entry table.
* bpo-36473: add maximum iteration check for dict .values() and .items() ↵Thomas Perl2019-04-021-0/+12
| | | | (GH-12619)
* fix confusing argument name in unicodeobject.c (GH-12653)Max Bernstein2019-04-021-2/+2
|
* bpo-36026: make descr error message consistent (GH-11930)Inada Naoki2019-04-011-14/+12
| | | | set.add(0) and set.add.__get__(0) now raise TypeError with same error message.
* bpo-24214: Fixed the UTF-8 incremental decoder. (GH-12603)Serhiy Storchaka2019-03-301-0/+3
| | | | The bug occurred when the encoded surrogate character is passed to the incremental decoder in two chunks.
* bpo-36452: dictiter: track maximum iteration count (GH-12596)Thomas Perl2019-03-281-0/+6
|
* bpo-35810: Incref heap-allocated types in PyObject_Init (GH-11661)Eddie Elizondo2019-03-273-6/+10
| | | | | * Incref heap-allocated types in PyObject_Init * Add documentation and porting notes to What's New
* bpo-36433: fix confusing error messages in classmethoddescr_call (GH-12556)Inada Naoki2019-03-261-6/+4
| | | https://bugs.python.org/issue36433
* bpo-36218: Fix handling of heterogeneous values in list.sort (GH-12209)Rémi Lapeyre2019-03-251-11/+22
|
* bpo-36412: fix a possible crash in dictobject.c's new_dict() (GH-12519)Zackery Spytz2019-03-241-1/+3
|
* bpo-36398: Fix a possible crash in structseq_repr(). (GH-12492)Zackery Spytz2019-03-221-1/+1
| | | | | If the first PyUnicode_DecodeUTF8() call fails in structseq_repr(), _PyUnicodeWriter_Dealloc() will be called on an uninitialized _PyUnicodeWriter.
* bpo-36312: Fix decoders for some code pages. (GH-12369)Serhiy Storchaka2019-03-201-5/+16
|
* bpo-36365: Rewrite structseq_repr() using _PyUnicodeWriter (GH-12440)Victor Stinner2019-03-191-58/+68
| | | | | No longer limit repr(structseq) to 512 bytes. Use _PyUnicodeWriter for better performance and to write directly Unicode rather than encoding repr() value to UTF-8 and then decoding from UTF-8.
* bpo-36356: Release Unicode interned strings on Valgrind (#12431)Victor Stinner2019-03-191-15/+42
| | | | | | | | | | | When Python is compiled with Valgrind support, release Unicode interned strings at exit in _PyUnicode_Fini(). * Rename _Py_ReleaseInternedUnicodeStrings() to unicode_release_interned() and make it private. * unicode_release_interned() is now called from _PyUnicode_Fini(): it must be called with a running Python thread state for TRASHCAN, it cannot be called from pymain_free(). * Don't display statistics on interned strings at exit anymore
* bpo-36301: Error if decoding pybuilddir.txt fails (GH-12422)Victor Stinner2019-03-191-2/+11
| | | | | | | | Python initialization now fails if decoding pybuilddir.txt configuration file fails at startup. _PyPathConfig_Calculate() now reports memory allocation failure and decoding error on decoding pybuilddir.txt content from UTF-8/surrogateescape.
* bpo-36292: Mark unreachable code as such in long bitwise ops (GH-12333)stratakis2019-03-181-4/+2
|
* bpo-30040: optimize inserting into empty dict (GH-12307)Inada Naoki2019-03-181-2/+49
|
* bpo-36297: remove "unicode_internal" codec (GH-12342)Inada Naoki2019-03-181-102/+0
|
* bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as ↵Eric Snow2019-03-152-0/+310
| | | | necessary). (gh-12359)
* bpo-36127: Argument Clinic: inline parsing code for keyword parameters. ↵Serhiy Storchaka2019-03-1413-106/+723
| | | | (GH-12058)
* bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264)Serhiy Storchaka2019-03-133-4/+4
|
* bpo-30040: new empty dict uses key-sharing dict (GH-1080)Inada Naoki2019-03-121-4/+5
| | | | Sizeof new empty dict becomes 72 bytes from 240 bytes (amd64). It is same size to empty dict created by dict.clear().
* bpo-36251: Fix format strings used in match_repr() and stdprinter_repr(). ↵sth2019-03-101-1/+1
| | | | (GH-12252)
* closes bpo-33376: Update to Unicode 12.0.0. (GH-12256)Benjamin Peterson2019-03-101-912/+1067
|
* bpo-36142: Add _PyPreConfig_SetAllocator() (GH-12187)Victor Stinner2019-03-061-14/+0
| | | | | | | | | | | * _PyPreConfig_Write() now reallocates the pre-configuration with the new memory allocator. * It is no longer needed to force the "default raw memory allocator" to clear pre-configuration and core configuration. Simplify the code. * _PyPreConfig_Write() now does nothing if called after Py_Initialize(): no longer check if the allocator is the same. * Remove _PyMem_GetDebugAllocatorsName(): dev mode sets again allocator to "debug".
* bpo-36142: Add _PyMem_GetDebugAllocatorsName() (GH-12185)Victor Stinner2019-03-051-0/+14
| | | | | The development mode now uses the effective name of the debug memory allocator ("pymalloc_debug" or "malloc_debug"). So the name doesn't change after setting the memory allocator.
* bpo-33012: Fix compilation warnings in memoryobject.c and ↵Stéphane Wirtel2019-03-051-1/+1
| | | | | | _collectionsmodule.c (GH-12179) Cast function pointers to (void(*)(void)) before casting to (PyCFunction) to make "warning: cast between incompatible function types" false alarm quiet.
* closes bpo-36188: Clean up 'unbound' method left-overs. (GH-12169)Martijn Pieters2019-03-051-18/+3
| | | | | | | | | | Methods are always bound, and `__self__` can no longer be `NULL` (`method_new()` and `PyMethod_New()` both explicitly check for this). Moreover, once a bound method is bound, it *stays* bound and won't be re-bound to something else, so the section in the datamodel that talks about accessing an methods in a different descriptor-binding context doesn't apply any more in Python 3.
* Revert: bpo-33608: Factor out a private, per-interpreter ↵Victor Stinner2019-03-042-310/+0
| | | | | | | | | | | | | | | | | | | _Py_AddPendingCall(). (GH-11617) (GH-12159) * Revert "bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as necessary). (#12003)" This reverts commit bcfa450f210074e16feb761ae5b3e966a2532fcf. * Revert "bpo-33608: Simplify ceval's DISPATCH by hoisting eval_breaker ahead of time. (gh-12062)" This reverts commit bda918bf65a88560ec453aaba0758a9c0d49b449. * Revert "bpo-33608: Use _Py_AddPendingCall() in _PyCrossInterpreterData_Release(). (gh-12024)" This reverts commit b05b711a2cef6c6c381e01069dedac372e0b9fb2. * Revert "bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11617)" This reverts commit ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465.
* bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as ↵Eric Snow2019-03-012-0/+310
| | | | necessary). (#12003)
* closes bpo-36115: Fix some reference leaks in typeobject.c. (GH-12045)Benjamin Peterson2019-02-261-0/+2
| | | | | | | | | a24107b04c1277e3c1105f98aff5bfa3a98b33a0 introduced a few refleaks. https://bugs.python.org/issue36115
* bpo-36030: Remove _PyStack_AsTuple() and _PyStack_AsTupleSlice() (GH-12032)Sergey Fedoseev2019-02-251-25/+4
|
* bpo-36030: Add _PyTuple_FromArray() function (GH-11954)Sergey Fedoseev2019-02-254-67/+24
|
* bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)Serhiy Storchaka2019-02-258-97/+236
|
* bpo-36048: Use __index__() instead of __int__() for implicit conversion if ↵Serhiy Storchaka2019-02-252-14/+82
| | | | | | available. (GH-11952) Deprecate using the __int__() method in implicit conversions of Python numbers to C integers.
* bpo-36063: Minor performance tweak in long_divmod(). (GH-11915)Sergey Fedoseev2019-02-211-2/+2
|
* bpo-33989: Ensure that ms.key_compare is always initialized in ↵Zackery Spytz2019-02-211-0/+3
| | | | list_sort_impl(). (GH-8710)
* bpo-36062: Minor speed-up for list slicing and copying. (GH-11967)Sergey Fedoseev2019-02-211-8/+12
|
* bpo-36012: Avoid linear slot search for non-dunder methods (GH-11907)Stefan Behnel2019-02-201-13/+38
|
* bpo-31506: Clarify error messages for object.__new__ and object.__init__ ↵Sanyam Khurana2019-02-191-3/+6
| | | | | | | | | (GH-11641) `object.__new__` and `object.__init__` do take one argument each, they just don't take extra user supplied arguments. Patch by Sanyam Khurana.
* bpo-35992: Use PySequence_GetItem only if sq_item is not NULL (GH-11857)Ivan Levkivskyi2019-02-171-2/+5
| | | | Not using `__class_getitem__()` fallback if there is a non-subcriptable metaclass was caused by a certain asymmetry between how `PySequenceMethods` and `PyMappingMethods` are used in `PyObject_GetItem`. This PR removes this asymmetry. No tests failed, so I assume it was not intentional.
* bpo-35961: Fix a crash in slice_richcompare() (GH-11830)Victor Stinner2019-02-131-24/+14
| | | | | | | | Fix a crash in slice_richcompare(): use strong references rather than stolen references for the two temporary internal tuples. The crash (or assertion error) occurred if a garbage collection occurred during slice_richcompare(), especially while calling PyObject_RichCompare(t1, t2, op).
* bpo-35911: add cell constructor (GH-11771)Pierre Glaser2019-02-071-1/+41
| | | | Add a cell constructor, expose the cell type in the types module.