Python basics: Bytecode

I want to delve into some of the internals of Python, and in order to demonstrate what’s going on I’m going to be taking apart some bytecode. To avoid repeating myself, I’ll get some of the basics out of the way here. Think about the process of executing a piece of Python code. The code […]

Dictionaries preserve ordering

I came across something unexpected when preparing my post about the basics of dictionaries in Python. For as long as I’ve been using Python, it’s been a fundamental truth that dictionaries don’t have a reliable ordering. It’s mentioned all over StackOverflow. The standard library even has an OrderedDict container for cases where you want your […]

Answers to questions nobody asked

Who are you? I’m Tim Martin, a working programmer / small-time CTO. At the time of writing I’m working for these people, but I’ve done many different things over the years. I started this blog because I like to write and I’m doing a lot of Python at the moment, and writing about things is […]

Python basics: dict lookup

I had a bunch of posts I wanted to write that would refer to dict lookup in various ways, and rather than repeat myself in those I thought it would be useful to write a single post that establishes some of the basics. You may already know this stuff, in which case please ignore it. […]