summaryrefslogtreecommitdiffstats
path: root/Objects/genobject.c
Commit message (Collapse)AuthorAgeFilesLines
* gh-110209: Add __class_getitem__ for generator and coroutine (#110212)James Hilton-Balfe2024-05-071-0/+2
|
* GH-117714: implement athrow().close() and asend().close() using throw ā†µThomas Grainger2024-05-061-4/+38
| | | | | | | | | | | | | | | | | | (GH-117906) * GH-117714: replace athrow().close() and asend().close() stubs with implimentations * test athrow().close() and asend().close() raises RuntimeError * šŸ“œšŸ¤– Added by blurb_it. * Update Objects/genobject.c Co-authored-by: Petr Viktorin <encukou@gmail.com> --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* GH-117881: fix athrow().throw()/asend().throw() concurrent access (GH-117882)Thomas Grainger2024-05-011-0/+37
|
* gh-117657: Fix small issues with instrumentation and TSAN (#118064)Dino Viehland2024-04-301-3/+5
| | | Small TSAN fixups for instrumentation
* gh-118272: Clear generator frame's locals when the generator is closed (#118277)Irit Katriel2024-04-301-0/+1
| | | Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* GH-117536: GH-117894: fix athrow().throw(...) unawaited warning (GH-117851)Thomas Grainger2024-04-241-1/+8
|
* gh-111968: Split _Py_async_gen_asend_freelist out of _Py_async_gen_frā€¦ ā†µDonghee Na2024-02-171-21/+30
| | | | (gh-115546)
* gh-111968: Rename freelist related struct names to Eric's suggestion (gh-115329)Donghee Na2024-02-141-21/+21
|
* gh-111968: Refactor _PyXXX_Fini to integrate with _PyObject_ClearFreeLists ā†µDonghee Na2024-02-101-11/+0
| | | | (gh-114899)
* gh-111968: Use per-thread freelists for dict in free-threading (gh-114323)Donghee Na2024-02-011-0/+4
|
* gh-111968: Unify freelist naming schema to Eric's suggestion (gh-114581)Donghee Na2024-01-261-2/+2
|
* gh-111968: Use per-thread freelists for generator in free-threading (gh-114189)Donghee Na2024-01-181-40/+24
|
* gh-113753: Clear finalized bit when putting PyAsyncGenASend back into free ā†µSam Gross2024-01-101-0/+2
| | | | list (#113754)
* gh-111058: Change coro.cr_frame/gen.gi_frame to be None for a closed ā†µIrit Katriel2023-12-011-1/+1
| | | | coroutine/generator. (#112428)
* gh-111354: remove comparisons with enum values, variable reuse, unused ā†µIrit Katriel2023-11-091-22/+14
| | | | imports in genobject.c (#111708)
* gh-111354: Simplify _PyGen_yf by moving some of its work to the compiler and ā†µIrit Katriel2023-11-031-24/+9
| | | | frame state (#111648)
* gh-111354: simplify detection of RESUME after YIELD_VALUE at except-depth 1 ā†µIrit Katriel2023-11-021-18/+9
| | | | (#111459)
* gh-111354: define names for RESUME oparg values (#111365)Irit Katriel2023-10-261-1/+2
|
* gh-109094: replace frame->prev_instr by frame->instr_ptr (#109095)Irit Katriel2023-10-261-5/+8
|
* gh-100762: Fix optimization in gen_close (#111069)Irit Katriel2023-10-251-2/+3
|
* gh-110964: Remove private _PyArg functions (#110966)Victor Stinner2023-10-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the following private functions and structures to pycore_modsupport.h internal C API: * _PyArg_BadArgument() * _PyArg_CheckPositional() * _PyArg_NoKeywords() * _PyArg_NoPositional() * _PyArg_ParseStack() * _PyArg_ParseStackAndKeywords() * _PyArg_Parser structure * _PyArg_UnpackKeywords() * _PyArg_UnpackKeywordsWithVararg() * _PyArg_UnpackStack() * _Py_ANY_VARARGS() Changes: * Python/getargs.h now includes pycore_modsupport.h to export functions. * clinic.py now adds pycore_modsupport.h when one of these functions is used. * Add pycore_modsupport.h includes when a C extension uses one of these functions. * Define Py_BUILD_CORE_MODULE in C extensions which now include directly or indirectly (via code generated by Argument Clinic) pycore_modsupport.h: * _csv * _curses_panel * _dbm * _gdbm * _multiprocessing.posixshmem * _sqlite.row * _statistics * grp * resource * syslog * _testcapi: bad_get() no longer uses METH_FASTCALL calling convention but METH_VARARGS. Replace _PyArg_UnpackStack() with PyArg_ParseTuple(). * _testcapi: add PYTESTCAPI_NEED_INTERNAL_API macro which is defined by _testcapi sub-modules which need the internal C API (pycore_modsupport.h): exceptions.c, float.c, vectorcall.c, watchers.c. * Remove Include/cpython/modsupport.h header file. Include/modsupport.h no longer includes the removed header file. * Fix mypy clinic.py
* GH-108614: Add `RESUME_CHECK` instruction (GH-108630)Mark Shannon2023-09-071-1/+5
|
* GH-108035: Remove the `_PyCFrame` struct as it is no longer needed for ā†µMark Shannon2023-08-171-4/+4
| | | | performance. (GH-108036)
* GH-100964: Break cycles involving exception state when returning from ā†µMark Shannon2023-08-021-5/+4
| | | | generator (GH-107563)
* gh-106869: Use new PyMemberDef constant names (#106871)Victor Stinner2023-07-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove '#include "structmember.h"'. * If needed, add <stddef.h> to get offsetof() function. * Update Parser/asdl_c.py to regenerate Python/Python-ast.c. * Replace: * T_SHORT => Py_T_SHORT * T_INT => Py_T_INT * T_LONG => Py_T_LONG * T_FLOAT => Py_T_FLOAT * T_DOUBLE => Py_T_DOUBLE * T_STRING => Py_T_STRING * T_OBJECT => _Py_T_OBJECT * T_CHAR => Py_T_CHAR * T_BYTE => Py_T_BYTE * T_UBYTE => Py_T_UBYTE * T_USHORT => Py_T_USHORT * T_UINT => Py_T_UINT * T_ULONG => Py_T_ULONG * T_STRING_INPLACE => Py_T_STRING_INPLACE * T_BOOL => Py_T_BOOL * T_OBJECT_EX => Py_T_OBJECT_EX * T_LONGLONG => Py_T_LONGLONG * T_ULONGLONG => Py_T_ULONGLONG * T_PYSSIZET => Py_T_PYSSIZET * T_NONE => _Py_T_NONE * READONLY => Py_READONLY * PY_AUDIT_READ => Py_AUDIT_READ * READ_RESTRICTED => Py_AUDIT_READ * PY_WRITE_RESTRICTED => _Py_WRITE_RESTRICTED * RESTRICTED => (READ_RESTRICTED | _Py_WRITE_RESTRICTED)
* gh-106521: Remove _PyObject_LookupAttr() function (GH-106642)Serhiy Storchaka2023-07-121-2/+2
|
* GH-100987: Allow objects other than code objects as the "executable" of an ā†µMark Shannon2023-06-141-3/+3
| | | | | | | | | | internal frame. (GH-105727) * Add table describing possible executable classes for out-of-process debuggers. * Remove shim code object creation code as it is no longer needed. * Make lltrace a bit more robust w.r.t. non-standard frames.
* GH-105162: Account for `INSTRUMENTED_RESUME` in gen.close/throw. (GH-105187)Mark Shannon2023-06-021-3/+15
|
* gh-105140: remove unused arg of _PyErr_ChainStackItem (#105141)Irit Katriel2023-06-011-1/+1
|
* GH-89091: raise `RuntimeWarning` for unawaited async generator methods (#104611)Kumar Aditya2023-05-261-0/+26
|
* gh-104770: Let generator.close() return value (#104771)Nicolas Tessore2023-05-231-3/+8
| | | | Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* GH-102181: Improve specialization stats for SEND (GH-102182)penguin_wwy2023-05-101-3/+0
|
* GH-96803: Add three C-API functions to make _PyInterpreterFrame less opaque ā†µMark Shannon2023-05-051-1/+2
| | | | for users of PEP 523. (GH-96849)
* gh-79940: add introspection API for asynchronous generators to `inspect` ā†µThomas Krennwallner2023-03-111-0/+10
| | | | module (#11590)
* gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives ā†µIrit Katriel2023-03-081-48/+16
| | | | (in Objects/) (#102218)
* fix typo in async generator code field name `ag_code` (#102448)Kumar Aditya2023-03-081-1/+1
|
* GH-100719: Remove redundant `gi_code` field from generator object. (GH-100749)Mark Shannon2023-02-231-17/+55
|
* gh-101907: Stop using `_Py_OPCODE` and `_Py_OPARG` macros (GH-101912)Steve Dower2023-02-201-5/+5
| | | | | | * gh-101907: Removes use of non-standard C++ extension from Include/cpython/code.h * Make cases_generator correct on Windows
* GH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. ā†µMark Shannon2023-01-241-1/+23
| | | | | | (GH-101013) * Store exception stack depth in YIELD_VALUE's oparg and use it avoid expensive gen.throw() in gen.close() where possible.
* GH-100126: Skip incomplete frames in more places (GH-100613)Brandt Bucher2023-01-091-4/+7
|
* GH-99005: More intrinsics (GH-100774)Mark Shannon2023-01-061-2/+2
| | | * Remove UNARY_POSITIVE, LIST_TO_TUPLE and ASYNC_GEN_WRAP, replacing them with intrinsics.
* gh-100720: refactor calculation of number of frame slots for a code object ā†µIrit Katriel2023-01-041-2/+2
| | | | into the new function _PyFrame_NumSlotsForCodeObject (#100722)
* gh-99537: Use Py_SETREF() function in C code (#99657)Victor Stinner2022-11-221-2/+1
| | | | | | | | | | | | | | | Fix potential race condition in code patterns: * Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);" * Replace "Py_XDECREF(var); var = new;" with "Py_XSETREF(var, new);" * Replace "Py_CLEAR(var); var = new;" with "Py_XSETREF(var, new);" Other changes: * Replace "old = var; var = new; Py_DECREF(var)" with "Py_SETREF(var, new);" * Replace "old = var; var = new; Py_XDECREF(var)" with "Py_XSETREF(var, new);" * And remove the "old" variable.
* gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530)Victor Stinner2022-11-161-4/+2
| | | | Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
* gh-99300: Use Py_NewRef() in Objects/ directory (#99335)Victor Stinner2022-11-101-42/+22
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Objects/ directory.
* GH-96421: Insert shim frame on entry to interpreter (GH-96319)Mark Shannon2022-11-101-12/+3
| | | | | | * Adds EXIT_INTERPRETER instruction to exit PyEval_EvalDefault() * Simplifies RETURN_VALUE, YIELD_VALUE and RETURN_GENERATOR instructions as they no longer need to check for entry frames.
* GH-96793: Specialize FOR_ITER for generators. (GH-98772)Mark Shannon2022-11-071-4/+4
|
* GH-96793: Implement PEP 479 in bytecode. (GH-99006)Mark Shannon2022-11-031-19/+3
| | | | | * Handle converting StopIteration to RuntimeError in bytecode. * Add custom instruction for converting StopIteration into RuntimeError.
* GH-98686: Quicken everything (GH-98687)Brandt Bucher2022-11-021-2/+1
|
* gh-96348: Deprecate the 3-arg signature of coroutine.throw and ā†µOfey Chan2022-09-301-3/+29
| | | | generator.throw (GH-96428)