I had barely no idea that the iter
function could do that in Python. You can call it with two arguments, a function and a stop value, and have your function being executed until the stop value is returned. It can have some interesting usages, as shown in the article. I would not use it all over the place because it looks like a bit dark magic but still a nice tool to keep in mind.
Other articles
8 versions of UUID and when to use them
I'm used to UUID v4 to generates random globally unique IDs whenever I need it in places where I can not benefit from a database with an auto numbering column. Actually, this is just the tree hiding the forest of UUIDs. This great article list the 8 versions of UUID and explain what they are about and when to use them.
read more10 Python programming optimisation techniques.
In this article, the author provide some interesting techniques for optimising Python code, in particular, memory consumption for cases where memory is critical or resources are limited. I would personally not apply all those techniques by default and reserve them for specific use cases, preferring readability in a first place. Still, those techniques are interesting to have in mind.
read more