summaryrefslogtreecommitdiff
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-37207: Add _PyArg_NoKwnames() helper function (GH-18980)Dong-hee Na2020-03-162-4/+2
|
* bpo-37207: Use _PyArg_CheckPositional() for tuple vectorcall (GH-18986)Dong-hee Na2020-03-161-2/+2
|
* Fix a possible refleak in tupleobject.c (GH-19018)Hai Shi2020-03-151-1/+3
|
* Revert "bpo-39087: Add _PyUnicode_GetUTF8Buffer()" (GH-18985)Inada Naoki2020-03-141-35/+0
| | | | | | | * Revert "bpo-39087: Add _PyUnicode_GetUTF8Buffer() (GH-17659)" This reverts commit c7ad974d341d3edb6b9d2a2dcae4d3d4794ada6b. * Update unicodeobject.h
* bpo-39087: Add _PyUnicode_GetUTF8Buffer() (GH-17659)Inada Naoki2020-03-141-0/+35
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-39947: Use _PyInterpreterState_GET_UNSAFE() (GH-18978)Victor Stinner2020-03-131-2/+2
| | | | | | | Replace _PyInterpreterState_Get() function call with _PyInterpreterState_GET_UNSAFE() macro which is more efficient but don't check if tstate or interp is NULL. _Py_GetConfigsAsDict() now uses _PyThreadState_GET().
* bpo-36144: OrderedDict Union (PEP 584) (#18967)Brandt Bucher2020-03-131-75/+120
|
* bpo-39947: Hide implementation detail of trashcan macros (GH-18971)Victor Stinner2020-03-131-0/+24
| | | | | | Py_TRASHCAN_BEGIN_CONDITION and Py_TRASHCAN_END macro no longer access PyThreadState attributes, but call new private _PyTrash_begin() and _PyTrash_end() functions which hide implementation details.
* bpo-37207: Use PEP 590 vectorcall to speed up tuple() (GH-18936)Dong-hee Na2020-03-131-0/+21
| | | | | | | | | | | Master: ./python.exe -m pyperf timeit "tuple((1, 2, 3, 4, 5))" Mean +- std dev: 361 ns +- 15 ns PEP-590: ./python.exe -m pyperf timeit "tuple((1, 2, 3, 4, 5))" Mean +- std dev: 203 ns +- 13 ns
* bpo-39947: Move Py_EnterRecursiveCall() to internal C API (GH-18972)Victor Stinner2020-03-134-0/+4
| | | | | | Move the static inline function flavor of Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() to the internal C API: they access PyThreadState attributes. The limited C API provides regular functions which hide implementation details.
* bpo-39884: Add method name in "bad call flags" error (GH-18944)Victor Stinner2020-03-122-2/+4
| | | | PyDescr_NewMethod() and PyCFunction_NewEx() now include the method name in the SystemError "bad call flags" error message to ease debug.
* Update some www.unicode.org URLs to use HTTPS. (GH-18912)Benjamin Peterson2020-03-101-1/+1
|
* closes bpo-39926: Update Unicode to 13.0.0. (GH-18910)Benjamin Peterson2020-03-101-518/+575
|
* bpo-38249: Expand Py_UNREACHABLE() to __builtin_unreachable() in the release ↵Serhiy Storchaka2020-03-091-4/+5
| | | | | mode. (GH-16329) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is ↵Serhiy Storchaka2020-03-091-9/+6
| | | | called with invalid base. (GH-18863)
* bpo-39904: Move handling of one-argument call of type() from type.__new__() ↵Serhiy Storchaka2020-03-091-39/+32
| | | | to type.__call__(). (GH-18852)
* bpo-36144: Update MappingProxyType with PEP 584's operators (#18814)Brandt Bucher2020-03-071-1/+25
| | | We make `|=` raise TypeError, since it would be surprising if `C.__dict__ |= {'x': 0}` silently did nothing, while `C.__dict__.update({'x': 0})` is an error.
* bpo-39882: Py_FatalError() logs the function name (GH-18819)Victor Stinner2020-03-071-12/+13
| | | | | | | | | | | | The Py_FatalError() function is replaced with a macro which logs automatically the name of the current function, unless the Py_LIMITED_API macro is defined. Changes: * Add _Py_FatalErrorFunc() function. * Remove the function name from the message of Py_FatalError() calls which included the function name. * Update tests.
* bpo-39573: Use Py_IS_TYPE() macro to check for types (GH-18809)Andy Lester2020-03-065-10/+9
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-39873: Cleanup _PyObject_CheckConsistency() (GH-18807)Victor Stinner2020-03-061-1/+0
| | | | Remove redundant check on Py_TYPE() value: it's already checked inside _PyType_CheckConsistency().
* bpo-39873: PyObject_Init() uses PyObject_INIT() (GH-18804)Victor Stinner2020-03-061-9/+2
| | | | | | Avoid duplicated code: * PyObject_Init() uses PyObject_INIT() * PyObject_InitVar() uses PyObject_INIT_VAR()
* bpo-39573: Finish converting to new Py_IS_TYPE() macro (GH-18601)Andy Lester2020-03-049-27/+27
|
* bpo-35712: Make using NotImplemented in a boolean context issue a ↵MojoVampire2020-03-031-2/+18
| | | | deprecation warning (GH-13195)
* bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and ↵Pablo Galindo2020-03-021-2/+0
| | | | | | tp_clear (GH-18749) Objects do not own weak references to them directly through the __weakref__ list so these do not need to be traversed by the GC.
* bpo-39087: Optimize PyUnicode_AsUTF8AndSize() (GH-18327)Inada Naoki2020-02-272-43/+90
| | | Avoid using temporary bytes object.
* bpo-39737: Remove code repitition in list_richcompare (GH-18638)sweeneyde2020-02-261-2/+1
| | | I may speed up list comparison on some platforms.
* bpo-36144: Dictionary Union (PEP 584) (#12088)Brandt Bucher2020-02-241-18/+53
|
* Give proper credits for the memoryview implementation. (#18626)Stefan Krah2020-02-241-1/+11
|
* bpo-39382: Avoid dangling object use in abstract_issubclass() (GH-18530)Yonatan Goldschmidt2020-02-221-3/+9
| | | | | Hold reference of __bases__ tuple until tuple item is done with, because by dropping the reference the item may be destroyed.
* closes bpo-39684: Combine two if/thens and squash uninit var warning. (GH-18565)Andy Lester2020-02-201-8/+3
|
* bpo-37207: Use vectorcall for range() (GH-18464)Petr Viktorin2020-02-181-17/+33
| | | | | | | This continues the `range()` part of #13930. The complete pull request is stalled on discussions around dicts, but `range()` should not be controversial. (And I plan to open PRs for other parts if this is merged.) On top of Mark's change, I unified `range_new` and `range_vectorcall`, which had a lot of duplicate code. https://bugs.python.org/issue37207
* bpo-36347: stop using RESTRICTED constants (GH-12684)Jeroen Demeyer2020-02-183-10/+8
| | | | | | | | The constants `RESTRICTED` and `PY_WRITE_RESTRICTED` no longer have a meaning in Python 3. Therefore, CPython should not use them. CC @matrixise https://bugs.python.org/issue36347
* bpo-39500: Fix compile warnings in unicodeobject.c (GH-18519)Hai Shi2020-02-171-2/+2
|
* bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)Dong-hee Na2020-02-173-8/+8
|
* bpo-39573: Update clinic to use Py_IS_TYPE() function (GH-18507)Dong-hee Na2020-02-141-2/+2
|
* closes bpo-39630: Update pointers to string literals to be const char *. ↵Andy Lester2020-02-132-3/+3
| | | | (GH-18510)
* bpo-39573: Add Py_IS_TYPE() function (GH-18488)Dong-hee Na2020-02-131-1/+1
| | | Co-Author: Neil Schemenauer <nas-github@arctrix.com>
* bpo-39606: allow closing async generators that are already closed (GH-18475)Nathaniel J. Smith2020-02-131-4/+11
| | | | | | | | | | | | | | The fix for [bpo-39386](https://bugs.python.org/issue39386) attempted to make it so you couldn't reuse a agen.aclose() coroutine object. It accidentally also prevented you from calling aclose() at all on an async generator that was already closed or exhausted. This commit fixes it so we're only blocking the actually illegal cases, while allowing the legal cases. The new tests failed before this patch. Also confirmed that this fixes the test failures we were seeing in Trio with Python dev builds: https://github.com/python-trio/trio/pull/1396 https://bugs.python.org/issue39606
* bpo-35081: Move dtoa.h header to the internal C API (GH-18489)Victor Stinner2020-02-121-0/+1
| | | | | | | Move the dtoa.h header file to the internal C API as pycore_dtoa.h: it only contains private functions (prefixed by "_Py"). The math and cmath modules must now be compiled with the Py_BUILD_CORE macro defined.
* bpo-35081: Move bytes_methods.h to the internal C API (GH-18492)Victor Stinner2020-02-125-5/+5
| | | | | Move the bytes_methods.h header file to the internal C API as pycore_bytes_methods.h: it only contains private symbols (prefixed by "_Py"), except of the PyDoc_STRVAR_shared() macro.
* bpo-39605: Remove a cast that causes a warning. (GH-18473)Benjamin Peterson2020-02-111-1/+1
|
* closes bpo-39605: Fix some casts to not cast away const. (GH-18453)Andy Lester2020-02-116-31/+31
| | | | | | | | | | | | | | | gcc -Wcast-qual turns up a number of instances of casting away constness of pointers. Some of these can be safely modified, by either: Adding the const to the type cast, as in: - return _PyUnicode_FromUCS1((unsigned char*)s, size); + return _PyUnicode_FromUCS1((const unsigned char*)s, size); or, Removing the cast entirely, because it's not necessary (but probably was at one time), as in: - PyDTrace_FUNCTION_ENTRY((char *)filename, (char *)funcname, lineno); + PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno); These changes will not change code, but they will make it much easier to check for errors in consts
* bpo-39245: Switch to public API for Vectorcall (GH-18460)Petr Viktorin2020-02-1119-48/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of this patch was generated automatically with: for name in \ PyObject_Vectorcall \ Py_TPFLAGS_HAVE_VECTORCALL \ PyObject_VectorcallMethod \ PyVectorcall_Function \ PyObject_CallOneArg \ PyObject_CallMethodNoArgs \ PyObject_CallMethodOneArg \ ; do echo $name git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g" done old=_PyObject_FastCallDict new=PyObject_VectorcallDict git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g" and then cleaned up: - Revert changes to in docs & news - Revert changes to backcompat defines in headers - Nudge misaligned comments
* bpo-39500: Document PyUnicode_IsIdentifier() function (GH-18397)Victor Stinner2020-02-111-14/+33
| | | | PyUnicode_IsIdentifier() does not call Py_FatalError() anymore if the string is not ready.
* bpo-39573: Use Py_SET_SIZE() function (GH-18402)Victor Stinner2020-02-077-54/+61
| | | | Replace direct acccess to PyVarObject.ob_size with usage of the Py_SET_SIZE() function.
* bpo-39573: Add Py_SET_SIZE() function (GH-18400)Victor Stinner2020-02-071-1/+1
| | | Add Py_SET_SIZE() function to set the size of an object.
* bpo-39573: Use Py_TYPE() macro in object.c (GH-18398)Victor Stinner2020-02-071-12/+8
| | | | Replace direct acccess to PyVarObject.ob_size with usage of the Py_SIZE() macro.
* bpo-39573: Add Py_SET_TYPE() function (GH-18394)Victor Stinner2020-02-075-11/+15
| | | Add Py_SET_TYPE() function to set the type of an object.
* bpo-39573: Use Py_TYPE() macro in Objects directory (GH-18392)Victor Stinner2020-02-0720-109/+109
| | | Replace direct access to PyObject.ob_type with Py_TYPE().
* bpo-39573: Use Py_TYPE() in abstract.c (GH-18390)Victor Stinner2020-02-071-94/+94
| | | Replace direct access to PyObject.ob_type with Py_TYPE().