WTF are Python Generators?

Written by jeff-ridgeway | Published 2020/05/09
Tech Story Tags: python3 | programming | codenewbie | generator | 100daysofcode | python-top-story | python-generators-explained | what-are-python-generators

TLDR 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.via the TL;DR App

no story

Written by jeff-ridgeway | Software Engineer/Blogger
Published by HackerNoon on 2020/05/09