[Tutor] Playing with generators
Leam Hall
leamhall at gmail.com
Wed Aug 10 22:10:02 EDT 2022
On 8/10/22 14:44, avi.e.gross at gmail.com wrote:
> My daughter just got engaged and it is going to soak up a lot of my time, so
> ...
CONGRATULATIONS! More important, too. :)
I'm a bit worn out, so will limit this to what I can think through. I do want to answer a couple of questions/comments, though.
"dn" apologized for potentially treating me as a "beginner"; I strive (but often fail) to maintain a "beginner's mind", even though I've been doing stuff like this for a while. In this particular instance I've been on page 27 of "Fluent Python" (1st ed) for a bit longer than a smart person would be. Generators are interesting, and I saw a reference that they could replace maps and lambdas, so I figured learning them was a good idea.
Also, Mats pointed out dataclasses, and I think they fit a lot of how I normally think about classes. In this particular case, though, I was trying to keep things as simple as possible, but no simpler. From the comments, I'm not sure I succeeded, but that was a goal.
More tomorrow. If needed, anyway.
Leam
--
Automation Engineer (reuel.net/resume)
Scribe: The Domici War (domiciwar.net)
General Ne'er-do-well (github.com/LeamHall)
More information about the Tutor
mailing list