Other articles


  1. Python 1.0

    This morning, I decided to try to install Python 1.0. I wanted to get a glimpse of where the language came from, how it's grown, and what it was like in its early days. I figured an earlier version would probably be a little simpler, and perhaps the ...

    read more

    There are comments.

  2. Don't waste your iterators!

    There's a pattern I see fairly often in code where someone uses a function that returns a sequence of some sort, filters it, and then wants to use the first result that matches the filter. It looks something like this:

    return [x for x in foo if len(x ...
    read more

    There are comments.

  3. Iterators and iterables clarified

    Note

    Need to fix code formatting

    So what exactly is a python iterator, and how is that different from an iterable?

    An iterable is an object that implements a method __iter__(), which, when called, returns an iterator. The __iter__() method can be called by the iter() function, and is also ...

    read more

    There are comments.

  4. Page 1 / 1