Created
May 30, 2014 15:11
-
-
Save thezerobit/724ed47128252c476302 to your computer and use it in GitHub Desktop.
yield_from macro for Boo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Boo macro for delegating to subgenerators ala PEP 380 | |
macro yield_from: | |
yield [| | |
for _x in $(yield_from.Arguments[0]): yield _x | |
|] | |
def myrange(): | |
yield_from range(99) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment