summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* bpo-39481: Implementation for PEP 585 (#18239)Guido van Rossum2020-04-077-0/+520
| | | | | | | | | | | | This implements things like `list[int]`, which returns an object of type `types.GenericAlias`. This object mostly acts as a proxy for `list`, but has attributes `__origin__` and `__args__` that allow recovering the parts (with values `list` and `(int,)`. There is also an approximate notion of type variables; e.g. `list[T]` has a `__parameters__` attribute equal to `(T,)`. Type variables are objects of type `typing.TypeVar`.
* bpo-37388: Don't check encoding/errors during finalization (GH-19409)Victor Stinner2020-04-071-0/+6
| | | | | | | | | str.encode() and str.decode() no longer check the encoding and errors in development mode or in debug mode during Python finalization. The codecs machinery can no longer work on very late calls to str.encode() and str.decode(). This change should help to call _PyObject_Dump() to debug during late Python finalization.
* bpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function (GH-19377)Victor Stinner2020-04-063-2/+11
| | | | | | | | Convert the PyObject_GET_WEAKREFS_LISTPTR() macro to a function to hide implementation details: the macro accessed directly to the PyTypeObject.tp_weaklistoffset member. Add _PyObject_GET_WEAKREFS_LISTPTR() static inline function to the internal C API.
* bpo-37207: Use PEP 590 vectorcall to speed up dict() (GH-19280)Dong-hee Na2020-04-021-0/+33
|
* bpo-40130: _PyUnicode_AsKind() should not be exported. (GH-19265)Serhiy Storchaka2020-04-011-49/+46
| | | | | Make it a static function, and pass known attributes (kind, data, length) instead of the PyUnicode object.
* bpo-37207: Use vectorcall for list() (GH-18928)Petr Viktorin2020-03-301-0/+28
| | | | | | | Speed up calls to list() by using the PEP 590 vectorcall calling convention. Patch by Mark Shannon. Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-39943: Properly const the pointers in dictkeys_get_index (GH-19170)Andy Lester2020-03-261-5/+5
|
* bpo-39882: Add _Py_FatalErrorFormat() function (GH-19157)Victor Stinner2020-03-253-27/+21
|
* bpo-40024: Add PyModule_AddType() helper function (GH-19088)Dong-hee Na2020-03-221-0/+1
|
* bpo-37207: Use PEP 590 vectorcall to speed up frozenset() (GH-19053)Dong-hee Na2020-03-181-18/+50
|
* bpo-38373: Change list overallocating strategy. (GH-18952)Serhiy Storchaka2020-03-171-6/+8
| | | | | * Add padding to make the allocated size multiple of 4. * Do not overallocate if the new size is closer to overalocated size than to the old size.
* bpo-39824: module_traverse() don't call m_traverse if md_state=NULL (GH-18738)Victor Stinner2020-03-171-23/+13
| | | | | | | | | | | | | Extension modules: m_traverse, m_clear and m_free functions of PyModuleDef are no longer called if the module state was requested but is not allocated yet. This is the case immediately after the module is created and before the module is executed (Py_mod_exec function). More precisely, these functions are not called if m_size is greater than 0 and the module state (as returned by PyModule_GetState()) is NULL. Extension modules without module state (m_size <= 0) are not affected. Co-Authored-By: Petr Viktorin <encukou@gmail.com>
* bpo-37207: Use PEP 590 vectorcall to speed up set() constructor (GH-19019)Dong-hee Na2020-03-161-0/+23
|
* 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-111-1/+1
|
* closes bpo-39926: Update Unicode to 13.0.0. (GH-18910)Benjamin Peterson2020-03-111-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-061-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-251-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-211-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-142-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>