https://github.com/hchasestevens/yield-from
A backport of Python 3's "yield from" to Python 2.7.
https://github.com/hchasestevens/yield-from
ast-transformations backport don-t-use mea-culpa
Last synced: 4 months ago
JSON representation
A backport of Python 3's "yield from" to Python 2.7.
- Host: GitHub
- URL: https://github.com/hchasestevens/yield-from
- Owner: hchasestevens
- License: mit
- Created: 2017-09-22T02:14:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-16T03:51:47.000Z (over 7 years ago)
- Last Synced: 2025-01-12T15:31:08.354Z (5 months ago)
- Topics: ast-transformations, backport, don-t-use, mea-culpa
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yield-from
[](https://badge.fury.io/py/yield-from)
[](https://liberapay.com/hchasestevens/)A backport of `yield from` from Python 3 to Python 2.7.
For more information, see https://github.com/hchasestevens/hchasestevens.github.io/blob/master/notebooks/backporting-yield-from-to-python-27.ipynb
## Installation
```bash
pip install yield-from
```## Usage
```python
>>> from yieldfrom import yield_from, rewrite_yield_from
>>> def inner():
... yield 'inner'
...
>>> @rewrite_yield_from
... def outer():
... yield 'outer start'
... yield_from(inner())
... yield 'outer end'
...
>>> list(outer())
['outer start', 'inner', 'outer end']
```## Contacts
* Name: [H. Chase Stevens](http://www.chasestevens.com)
* Twitter: [@hchasestevens](https://twitter.com/hchasestevens)