Blocking gevent's Hub Part 1: Understanding Blocking

In the beginning we talked about gevent's hub and how greenlets switch in and out of it to implement IO. Following that we showed how locks in gevent are implemented much the same way, by "parking" a waiting greenlet, switching to the hub to let other greenlets run or do IO, and eventually switching back to the parked greenlet.

That's a lot of switching. What does it mean if that switching doesn't happen? What should a programmer know about switching and its opposite, blocking? (There's also part 2.)

Read more…

Pixel Art in Yarn

Since its inception in 2011, NextThought has used the same star-shaped logo created by Whitney Martin Design. The logo has taken many forms and appeared in many places over the years: mugs, hats, stress balls, business cards, shirts, gym bags, this blog—the list goes on and on. But could it be re-created in yarn?

Spoiler alert: yes. Yes it could.

Read more…

Pre-release Version Pins are Sticky

The popular Python web framework Pyramid recently had a bug. Installing a released version of Pyramid, such as 1.8 or 1.9, somehow resulted in installing a pre-release version of one of its most important dependencies, WebOb. This was surprising and potentially disruptive in a production environment. Having been surprised by a similar bug in a different project, I followed this with interest.

Read more…

Python's Old Iteration Protocol

A few places in the Python language reference coyly refer to "the old-style iteration protocol." What is that protocol and how is it different from "the new-style iteration protocol?" Does it have anything to do with the difference between old-style and new-style classes? Let's dig in to see how iteration works now, and how it used to work.

Read more…

Editor Wars: Violent Delights Have Violent Ends

As developers, one of the most important tools in our toolkits is our editor. Looking around the office, you'll find a wide variety of editors in use, everything from editors with long pedigrees to the most recently developed editor boasting the technology du jour.

The choice of editor can be a very personal thing. While we have no interest in starting or escalating the actual editor war, we thought it would be interesting to survey the office and collect some stories about editors and the people who use them in this ongoing (sporadic) series.