You have probably been using iterators and generators since you started programming in Python but you may not have realized it. In this article, we will learn what an iterator and a generator are. We will also be learning how they are created so we can create our own should we need to. Iterators An […]
This week we have the honor of welcoming Mark Lutz as our PyDev of the Week. Mark is the author of the first Python book ever, Programming Python. He has also authored Learning Python and the Python Pocket Reference, all three of which were with O'Reilly publishing. Rather than rehash more of his background, let's […]
This week we welcome Nicole Harris (@nlhkabu) as our PyDev of the Week! Nicole is the lead designer of Warehouse, the replacement for the Python Packaging Index (PyPI). You can see a demo version of the site here. She is also working with O'Reilly publishing on a Django screencast, which you'll hear more about below. […]
Python provides a great module for creating your own iterators. The module I am referring to is itertools. The tools provided by itertools are fast and memory efficient. You will be able to take these building blocks to create your own specialized iterators that can be used for efficient looping. In this chapter, we will […]
This week we welcome Peter Damoc as our PyDev of the Week! I first came across some of Peter's work in the wxPython source code. Let's spend some time getting to know him better! Can you tell us a little about yourself (hobbies, education, etc): I'm 39 and I'm the oldest of five. I have […]
According to the Python documentation, deques "are a generalization of stacks and queues". They are pronounced "deck" which is short for "double-ended queue". They are a replacement container for the Python list. Deques are thread-safe and support memory efficient appends and pops from either side of the deque. A list is optimized for fast fixed-length […]