summaryrefslogtreecommitdiff
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove unneeded assignment in PyBytes_Concat() (GH-15274)Sergey Fedoseev2019-09-101-1/+0
| | | The `wb.len = -1` assignment is unneeded since its introduction in 161d695fb0455ce52530d4f43a9eac4c738f64bb as `PyObject_GetBuffer` always fills it in.
* bpo-37752: Delete redundant Py_CHARMASK in normalizestring() (GH-15095)Jordon Xu2019-09-101-2/+2
|
* bpo-37619: update_one_slot() should not ignore wrapper descriptors for wrong ↵Jeroen Demeyer2019-09-101-6/+13
| | | | type (GH-14836)
* Fix typo in dict object comment (#15814)dalgarno2019-09-101-1/+1
|
* Expand comment explaining update_one_slot (GH-14810)Jeroen Demeyer2019-09-101-9/+59
|
* Cut tricky `goto` that isn't needed, in _PyBytes_DecodeEscape. (GH-15825)Greg Price2019-09-101-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the sort of `goto` that requires the reader to stare hard at the code to unpick what it's doing. On doing so, the answer is... not very much! * It jumps from the bottom of the loop to almost the top; the effect is to bypass the loop condition `s < end` and also the `if`-condition `*s != '\\'`, acting as if both are true. * We've just decremented `s`, after incrementing it in the `switch` condition. So it has the same value as when `s == end` failed. Before that was another increment... and before that we had `s < end`. So `s < end` true, then increment, then `s == end` false... that means `s < end` is still true. * Also this means `s` points to the same character as it did for the `switch` condition. And there was a `case '\\'`, which we didn't hit -- so `*s != '\\'` is also true. * That means this has no effect on the behavior! The most it might do is an optimization -- we get to skip those two checks, because (as just proven above) we know they're true. * But gosh, this is the *invalid escape sequence* path. This does not seem like the kind of code path that calls for extreme optimization tricks. So, take the `goto` and the label out. Perhaps the compiler will notice the exact same facts we showed above, and generate identical code. Or perhaps it won't! That'll be OK. But then, crucially, if some future edit to this loop causes the reasoning above to *stop* holding true... the compiler will adjust this jump accordingly. One of us fallible humans might not.
* Correct overflow check in PyTuple_New() (GH-14838)Sergey Fedoseev2019-09-091-2/+2
|
* bpo-37840: Fix handling of negative indices in bytearray_getitem() (GH-15250)Sergey Fedoseev2019-09-091-2/+0
|
* bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639)HongWeipeng2019-09-081-2/+4
| | | | This is a complement to PR 13375.
* bpo-15088 : Remove PyGen_NeedsFinalizing() (GH-15702)Joannah Nanjekye2019-09-061-16/+0
| | | | | Remove PyGen_NeedsFinalizing(): it was not documented, tested or used anywhere within CPython after the implementation of PEP 442.
* replace inline function `is_small_int` with a macro version (GH-15710)animalize2019-09-051-13/+9
|
* bpo-36030: Fix a possible segfault in PyTuple_New() (GH-15670)Zackery Spytz2019-09-041-0/+3
|
* bpo-15999: Clean up of handling boolean arguments. (GH-15610)Serhiy Storchaka2019-09-011-2/+2
| | | | | | * Use the 'p' format unit instead of manually called PyObject_IsTrue(). * Pass boolean value instead 0/1 integers to functions that needs boolean. * Convert some arguments to boolean only once.
* bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630)Serhiy Storchaka2019-09-016-91/+96
| | | Only AttributeError should be silenced.
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-302-2/+2
|
* bpo-8425: Fast path for set inplace difference when the second set is large ↵Raymond Hettinger2019-08-291-1/+17
| | | | (GH-15590)
* bpo-37034: Display argument name on errors with keyword arguments with ↵Rémi Lapeyre2019-08-2910-56/+56
| | | | Argument Clinic. (GH-13593)
* Fix unused variable and signed/unsigned warnings (GH-15537)Raymond Hettinger2019-08-271-0/+6
|
* Make PyXXX_Fini() functions private (GH-15531)Victor Stinner2019-08-2712-12/+13
| | | | | For example, rename PyTuple_Fini() to _PyTuple_Fini(). These functions are only declared in the internal C API.
* bpo-27575: port set intersection logic into dictview intersection (GH-7696)Forest Gregg2019-08-261-4/+77
|
* bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15131)Nick Coghlan2019-08-251-9/+0
| | | | | | | | | | | | | | | - drop TargetScopeError in favour of raising SyntaxError directly as per the updated PEP 572 - comprehension iteration variables are explicitly local, but named expression targets in comprehensions are nonlocal or global. Raise SyntaxError as specified in PEP 572 - named expression targets in the outermost iterable of a comprehension have an ambiguous target scope. Avoid resolving that question now by raising SyntaxError. PEP 572 originally required this only for cases where the bound name conflicts with the iteration variable in the comprehension, but CPython can't easily restrict the exception to that case (as it doesn't know the target variable names when visiting the outermost iterator expression)
* bpo-19072: Make @classmethod support chained decorators (GH-8405)Berker Peksag2019-08-241-0/+4
|
* bpo-37812: Convert CHECK_SMALL_INT macro to a function so the return is ↵Greg Price2019-08-241-11/+25
| | | | explicit. (GH-15216)
* bpo-37830: Fix compilation of break and continue in finally. (GH-15320)Serhiy Storchaka2019-08-241-7/+16
| | | | | | Fix compilation of "break" and "continue" in the "finally" block when the corresponding "try" block contains "return" with a non-constant value.
* bpo-36311: Fixes decoding multibyte characters around chunk boundaries and ↵Steve Dower2019-08-211-6/+10
| | | | improves decoding performance (GH-15083)
* abstract.c should not be executable. (GH-15348)Benjamin Peterson2019-08-201-0/+0
|
* bpo-15913: Implement PyBuffer_SizeFromFormat() (GH-13873)Joannah Nanjekye2019-08-201-0/+42
| | | | Implement PyBuffer_SizeFromFormat() function (previously documented but not implemented): call struct.calcsize().
* bpo-37732: Fix GCC warning in _PyObject_Malloc() (GH-15333)Victor Stinner2019-08-201-21/+16
| | | | | | | pymalloc_alloc() now returns directly the pointer, return NULL on memory allocation error. allocate_from_new_pool() already uses NULL as marker for "allocation failed".
* bpo-37540: vectorcall: keyword names must be strings (GH-14682)Jeroen Demeyer2019-08-161-6/+19
| | | | | | | | The fact that keyword names are strings is now part of the vectorcall and `METH_FASTCALL` protocols. The biggest concrete change is that `_PyStack_UnpackDict` now checks that and raises `TypeError` if not. CC @markshannon @vstinner https://bugs.python.org/issue37540
* bpo-37207: enable vectorcall for type.__call__ (GH-14588)Jeroen Demeyer2019-08-151-2/+3
| | | | | | | | | | | | Base PR for other PRs that want to play with `type.__call__` such as #13930 and #14589. The author is really @markshannon I just made the PR. https://bugs.python.org/issue37207 Automerge-Triggered-By: @encukou
* bpo-36030: Improve performance of some tuple operations (GH-12052)Sergey Fedoseev2019-08-141-32/+71
|
* bpo-37681: no_sanitize_thread support from GCC 5.1 (GH-15096)Hai Shi2019-08-141-2/+2
| | | | Fix the following warning with GCC 4.8.5: Objects/obmalloc.c: warning: ‘no_sanitize_thread’ attribute directive ignored
* bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c (GH-14814)Zackery Spytz2019-08-141-1/+1
| | | | Commit b1263d5a60d3f7ab02dd28409fff59b3815a3f67 causes GCC 9.1.0 to give a warning in Objects/descrobject.c.
* bpo-37648: Fixed minor inconsistency in some __contains__. (GH-14904)Serhiy Storchaka2019-08-044-6/+4
| | | | | The collection's item is now always at the left and the needle is on the right of ==.
* Fix typos in comments, docs and test names (#15018)Min ho Kim2019-07-304-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | * Fix typos in comments, docs and test names * Update test_pyparse.py account for change in string length * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: Dealloccte -> Deallocate Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Update posixmodule checksum. * Reverse idlelib changes.
* bpo-37340: remove free_list for bound method objects (GH-14232)Inada Naoki2019-07-263-96/+11
|
* bpo-37543: optimize pymalloc (#14674)Inada Naoki2019-07-171-218/+226
| | | | | | PyObject_Malloc() and PyObject_Free() inlines pymalloc_alloc and pymalloc_free partially. But when PGO is not used, compiler don't know where is the hot part in pymalloc_alloc and pymalloc_free.
* bpo-29548: no longer use PyEval_Call* functions (GH-14683)Jeroen Demeyer2019-07-121-1/+10
|
* bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)Jeroen Demeyer2019-07-112-6/+6
|
* Fix compiler warning in new code. (#14690)Tim Peters2019-07-101-1/+1
| | | uintptr_t is an integer type, and can't be compared to NULL directly.
* bpo-37537: Compute allocated blocks in _Py_GetAllocatedBlocks() (#14680)Neil Schemenauer2019-07-101-7/+22
| | | | | | Keeping an account of allocated blocks slows down _PyObject_Malloc() and _PyObject_Free() by a measureable amount. Have _Py_GetAllocatedBlocks() iterate over the arenas to sum up the allocated blocks for pymalloc.
* bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)Jeroen Demeyer2019-07-086-11/+11
|
* bpo-37151: remove _PyMethodDef_RawFastCall* functions (GH-14603)Jeroen Demeyer2019-07-051-259/+0
|
* bpo-36974: separate vectorcall functions for each calling convention (GH-13781)Jeroen Demeyer2019-07-053-79/+354
|
* bpo-37483: add _PyObject_CallOneArg() function (#14558)Jeroen Demeyer2019-07-0415-40/+29
|
* bpo-37233: optimize method_vectorcall in case of totalargs == 0 (GH-14550)Jeroen Demeyer2019-07-031-6/+10
|
* bpo-36904: Optimize _PyStack_UnpackDict (GH-14517)Jeroen Demeyer2019-07-021-63/+85
|
* bpo-37221: Add PyCode_NewWithPosOnlyArgs to be used internally and set ↵Pablo Galindo2019-07-011-15/+31
| | | | | | PyCode_New as a compatibility wrapper (GH-13959) Add PyCode_NewEx to be used internally and set PyCode_New as a compatibility wrapper
* bpo-37337: Add _PyObject_VectorcallMethod() (GH-14228)Jeroen Demeyer2019-06-282-7/+46
|
* bpo-37417: Fix error handling in bytearray.extend. (GH-14407)Brandt Bucher2019-06-261-0/+4
|