Skip to content

A backport of Python 3's "yield from" to Python 2.7.

License

Notifications You must be signed in to change notification settings

hchasestevens/yield-from

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yield-from

PyPI version Liberapay receiving

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

pip install yield-from

Usage

>>> 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

About

A backport of Python 3's "yield from" to Python 2.7.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages