paint-brush
WTF are Python Generators?by@jeff-ridgeway
419 reads
419 reads

WTF are Python Generators?

by Jeff Ridgeway5mMay 9th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Python programming is a way of returning values as you need them vs. all at once. Generators operate in a similar vein as Python’s readline(size) function. They evaluate the value as necessary (in our case, necessary is the number of bytes to be read and if 0, reads until the newline character is approached. This is also called saving/accessing the state of the generator object when you reenter the function when you need to reenter it.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - WTF are Python Generators?
Jeff Ridgeway HackerNoon profile picture
Jeff Ridgeway

Jeff Ridgeway

@jeff-ridgeway

Software Engineer/Blogger

Learn More
LEARN MORE ABOUT @JEFF-RIDGEWAY'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Jeff Ridgeway HackerNoon profile picture
Jeff Ridgeway@jeff-ridgeway
Software Engineer/Blogger

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here