Created
July 30, 2018 22:57
-
-
Save alairock/822ede91eb7e8d8a7d76cefee72a6bc2 to your computer and use it in GitHub Desktop.
Generator pipelining hard
This file contains hidden or 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
def employees(): | |
for y in ['Bob', 'Sally', 'Jake']: | |
yield y | |
def customers(): | |
for ex in ['James', 'Ted', 'Kent']: | |
yield ex | |
def retrieve_all_users(): | |
for employee in employees(): | |
yield employee | |
for customer in customers(): | |
yield customer | |
for user in retrieve_all_users(): | |
print(user) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment