Python’s Map(): Processing Iterables Without a Loop

In this step-by-step tutorial, you’ll learn how Python’s map() works and how to use it effectively in your programs. You’ll also learn how to use list comprehension and generator expressions to replace map() in a Pythonic and efficient way. Read more

Similar

Python Coverage could be Fast

Ned Batchelder’s coverage.py is a foundation of the Python testing ecosystem. It is solid, well maintained, and does its job extremely well. I think literally every Python project that cares about testing should be using it. (more…)

Read more »

The Walrus-While Python Pattern

Suppose you are reading from an unbounded data source in increments of a certain size. This is a common sort of situation; for example, reading lines from stdin. The total length of the data source is not known in advance, so the only thing to do is keep ... (more…)

Read more »