Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Add NULL check for gen->gi_code in gen_send_ex() | Christian Heimes | 2016-09-08 | 1 | -1/+1 |
| | | | | | | | | | | | _PyGen_Finalize() checks that gen->gi_code is not NULL before it accesses the flags of the code object. This means that the flag could be NULL. It passes down the generatore to gen_close() and gen_send_ex(). gen_send_ex() did not check for gen->gi_code != NULL. CID 1297900 | ||||
* | merge 3.5 (#27968) | Benjamin Peterson | 2016-09-07 | 1 | -12/+15 |
|\ | |||||
| * | supress coroutine warning when an exception is pending (#27968) | Benjamin Peterson | 2016-09-07 | 1 | -12/+15 |
| | | |||||
* | | Avoid calling functions with an empty string as format string | Victor Stinner | 2016-09-06 | 1 | -1/+1 |
| | | | | | | | | Directly pass NULL rather than an empty string. | ||||
* | | merge 3.5 (#27812) | Benjamin Peterson | 2016-09-05 | 1 | -1/+4 |
|\ \ | |/ | |||||
| * | clear out f_gen during generator finalization (closes #27812) | Benjamin Peterson | 2016-09-05 | 1 | -1/+4 |
| | | | | | | | | Patch from Armin Rigo. | ||||
* | | merge 3.5 (closes #27811) | Benjamin Peterson | 2016-09-05 | 1 | -12/+13 |
|\ \ | |/ | |||||
| * | do not allow _PyGen_Finalize to fail (closes #27811) | Benjamin Peterson | 2016-09-05 | 1 | -12/+13 |
| | | | | | | | | Patch from Armin Rigo. | ||||
* | | Merge 3.5 (issue #27243) | Yury Selivanov | 2016-06-09 | 1 | -0/+94 |
|\ \ | |/ | |||||
| * | Issue #27243: Fix __aiter__ protocol | Yury Selivanov | 2016-06-09 | 1 | -0/+94 |
| | | |||||
* | | Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode. | Serhiy Storchaka | 2016-05-24 | 1 | -2/+2 |
| | | | | | | | | Patch by Demur Rumed. | ||||
* | | Issue #22570: Renamed Py_SETREF to Py_XSETREF. | Serhiy Storchaka | 2016-04-06 | 1 | -2/+2 |
|\ \ | |/ | |||||
* | | Merge 3.5 (issue #25888) | Yury Selivanov | 2016-03-02 | 1 | -6/+6 |
|\ \ | |/ | |||||
| * | coroutines: Error when awaiting on coroutine that's being awaited | Yury Selivanov | 2016-03-02 | 1 | -6/+6 |
| | | | | | | | | Issue #25888 | ||||
* | | Merge 3.5 (issue #25887) | Yury Selivanov | 2016-02-13 | 1 | -12/+21 |
|\ \ | |/ | |||||
| * | Issue #25887: Raise a RuntimeError when a coroutine is awaited more than once. | Yury Selivanov | 2016-02-13 | 1 | -12/+21 |
| | | |||||
* | | Issue #26136: Upgrade the generator_stop warning to DeprecationWarning | Martin Panter | 2016-02-10 | 1 | -1/+1 |
| | | | | | | | | Patch by Anish Shah. | ||||
* | | Issue #20440: Cleaning up the code by using Py_SETREF. | Serhiy Storchaka | 2016-01-05 | 1 | -10/+2 |
|/ | |||||
* | Issue #24450: Add gi_yieldfrom to generators; cr_await to coroutines. | Yury Selivanov | 2015-07-03 | 1 | -0/+22 |
| | | | | Patch by Benno Leslie and Yury Selivanov. | ||||
* | Issue #24439: Improve PEP 492 related docs. | Yury Selivanov | 2015-06-24 | 1 | -5/+5 |
| | | | | Patch by Martin Panter. | ||||
* | Issue #24400: Introduce a distinct type for 'async def' coroutines. | Yury Selivanov | 2015-06-22 | 1 | -57/+268 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary of changes: 1. Coroutines now have a distinct, separate from generators type at the C level: PyGen_Type, and a new typedef PyCoroObject. PyCoroObject shares the initial segment of struct layout with PyGenObject, making it possible to reuse existing generators machinery. The new type is exposed as 'types.CoroutineType'. As a consequence of having a new type, CO_GENERATOR flag is no longer applied to coroutines. 2. Having a separate type for coroutines made it possible to add an __await__ method to the type. Although it is not used by the interpreter (see details on that below), it makes coroutines naturally (without using __instancecheck__) conform to collections.abc.Coroutine and collections.abc.Awaitable ABCs. [The __instancecheck__ is still used for generator-based coroutines, as we don't want to add __await__ for generators.] 3. Add new opcode: GET_YIELD_FROM_ITER. The opcode is needed to allow passing native coroutines to the YIELD_FROM opcode. Before this change, 'yield from o' expression was compiled to: (o) GET_ITER LOAD_CONST YIELD_FROM Now, we use GET_YIELD_FROM_ITER instead of GET_ITER. The reason for adding a new opcode is that GET_ITER is used in some contexts (such as 'for .. in' loops) where passing a coroutine object is invalid. 4. Add two new introspection functions to the inspec module: getcoroutinestate(c) and getcoroutinelocals(c). 5. inspect.iscoroutine(o) is updated to test if 'o' is a native coroutine object. Before this commit it used abc.Coroutine, and it was requested to update inspect.isgenerator(o) to use abc.Generator; it was decided, however, that inspect functions should really be tailored for checking for native types. 6. sys.set_coroutine_wrapper(w) API is updated to work with only native coroutines. Since types.coroutine decorator supports any type of callables now, it would be confusing that it does not work for all types of coroutines. 7. Exceptions logic in generators C implementation was updated to raise clearer messages for coroutines: Before: TypeError("generator raised StopIteration") After: TypeError("coroutine raised StopIteration") | ||||
* | Issue 24017: Drop getawaitablefunc and friends in favor of unaryfunc. | Yury Selivanov | 2015-05-28 | 1 | -1/+1 |
| | |||||
* | Issue 24237: Raise PendingDeprecationWarning per PEP 479 | Yury Selivanov | 2015-05-22 | 1 | -3/+20 |
| | | | | | | | | | Raise PendingDeprecationWarning when generator raises StopIteration and no __future__ import is used. Fix offenders in the stdlib and tests. See also issue 22906. Thanks to Nick Coghlan and Berker Peksag for reviews. | ||||
* | Issue #24257: Fixed incorrect uses of PyObject_IsInstance(). | Serhiy Storchaka | 2015-05-22 | 1 | -3/+2 |
|\ | | | | | | | | | Fixed segmentation fault in sqlite3.Row constructor with faked cursor type. Fixed system error in the comparison of faked types.SimpleNamespace. | ||||
| * | Issue #24257: Fixed incorrect uses of PyObject_IsInstance(). | Serhiy Storchaka | 2015-05-22 | 1 | -3/+2 |
| | | | | | | | | | | Fixed segmentation fault in sqlite3.Row constructor with faked cursor type. Fixed system error in the comparison of faked types.SimpleNamespace. | ||||
* | | Fix warnings for gen_get_iter() | Yury Selivanov | 2015-05-12 | 1 | -1/+1 |
| | | |||||
* | | PEP 0492 -- Coroutines with async and await syntax. Issue #24017. | Yury Selivanov | 2015-05-12 | 1 | -5/+97 |
| | | |||||
* | | Issue #22906: Do incref before SetCause/SetContext | Yury Selivanov | 2015-05-10 | 1 | -1/+1 |
| | | |||||
* | | Issue 22906: Increment refcount after PyException_SetContext | Yury Selivanov | 2015-05-09 | 1 | -0/+1 |
| | | |||||
* | | PEP 479: Change StopIteration handling inside generators. | Yury Selivanov | 2015-05-09 | 1 | -0/+24 |
| | | | | | | | | Closes issue #22906. | ||||
* | | Issue #23996: Avoid a crash when a delegated generator raises an ↵ | Antoine Pitrou | 2015-04-26 | 1 | -5/+22 |
|\ \ | |/ | | | | | unnormalized StopIteration exception. Patch by Stefan Behnel. | ||||
| * | Issue #23996: Avoid a crash when a delegated generator raises an ↵ | Antoine Pitrou | 2015-04-26 | 1 | -5/+22 |
| | | | | | | | | unnormalized StopIteration exception. Patch by Stefan Behnel. | ||||
* | | Issue #21938: simplify gen_iternext() | Antoine Pitrou | 2014-07-08 | 1 | -5/+1 |
| | | |||||
* | | Issue #21205: Add a new ``__qualname__`` attribute to generator, the qualified | Victor Stinner | 2014-06-16 | 1 | -15/+75 |
|/ | | | | | | | name, and use it in the representation of a generator (``repr(gen)``). The default name of the generator (``__name__`` attribute) is now get from the function instead of the code. Use ``gen.gi_code.co_name`` to get the name of the code. | ||||
* | Issue #17934: Add a clear() method to frame objects, to help clean up ↵ | Antoine Pitrou | 2013-08-05 | 1 | -3/+5 |
| | | | | expensive details (local variables) and break reference cycles. | ||||
* | Issue #18112: PEP 442 implementation (safe object finalization). | Antoine Pitrou | 2013-07-30 | 1 | -71/+32 |
| | |||||
* | Backout c89febab4648 following private feedback by Guido. | Antoine Pitrou | 2013-05-14 | 1 | -32/+219 |
| | | | | (Issue #17807: Generators can now be finalized even when they are part of a reference cycle) | ||||
* | Issue #17807: Generators can now be finalized even when they are part of a ↵ | Antoine Pitrou | 2013-05-08 | 1 | -219/+32 |
| | | | | reference cycle. | ||||
* | don't run frame if it has no stack (closes #17669) | Benjamin Peterson | 2013-04-10 | 1 | -1/+1 |
| | |||||
* | Issue #13783: PEP 380 cleanup part 2, using the new identifier APIs in the ↵ | Nick Coghlan | 2012-06-17 | 1 | -2/+4 |
| | | | | generator implementation | ||||
* | Issue #13783: the PEP 380 implementation no longer expands the public C API | Nick Coghlan | 2012-06-17 | 1 | -3/+4 |
| | |||||
* | merge 3.2 (#14717) | Benjamin Peterson | 2012-05-03 | 1 | -1/+1 |
|\ | |||||
| * | close() doesn't take any args (closes #14717) | Benjamin Peterson | 2012-05-03 | 1 | -1/+1 |
| | | |||||
* | | space | Benjamin Peterson | 2012-03-15 | 1 | -1/+1 |
| | | |||||
* | | perform yield from delegation by repeating YIELD_FROM opcode (closes #14230) | Benjamin Peterson | 2012-03-15 | 1 | -120/+59 |
| | | | | | | | | | | | | | | This allows generators that are using yield from to be seen by debuggers. It also kills the f_yieldfrom field on frame objects. Patch mostly from Mark Shannon with a few tweaks by me. | ||||
* | | make gi_running a boolean | Benjamin Peterson | 2012-03-08 | 1 | -1/+1 |
| | | |||||
* | | indicate we're not running as we leave this block | Benjamin Peterson | 2012-03-08 | 1 | -0/+1 |
| | | |||||
* | | make delegating generators say they running (closes #14220) | Benjamin Peterson | 2012-03-07 | 1 | -14/+37 |
| | | |||||
* | | Fix a crash when the return value of a subgenerator is a temporary | Amaury Forgeot d'Arc | 2012-01-13 | 1 | -1/+2 |
| | | | | | | | | object (with a refcount of 1) | ||||
* | | Implement PEP 380 - 'yield from' (closes #11682) | Nick Coghlan | 2012-01-13 | 1 | -13/+206 |
| | |