Skip to content

Python

Python internals, packaging, and constructions.
Choose a tag. Hold Command or Control to combine tags.

Base52 moment stamps

 3 min Nine ASCII-ordered characters of microseconds that byte-sort by time and omit A, E, I, O, and U, reducing accidental matches when keys live inside model prose.

Sep 23, 2026

Where CONTRIBUTORS.txt Ends Up

 3 min Tracing an old memory about Android phones and Cisco equipment to the files that carried my name.

Aug 27, 2026

EOF after the parent disappears

 2 min A small guardian process ties a command group to its Python parent’s lifetime through a pipe, even when Python cannot run its own cleanup.

Aug 17, 2026

The sqlite3 close trap

 2 min Python’s sqlite3 context manager ends a transaction but leaves the connection open. A finally block owns the close.

Jul 15, 2026

Millimeters and arcminutes

 2 min layoutc keeps meter and degree scales plus its full-turn constant in one IntEnum, using arcminutes to keep both angular constants integral.

May 20, 2024

One bunker per pixel

 4 min layoutc stores a paintball field layout as a PNG—sub-pixel position in R/G, rotation in B, identity in A, and transparency as literal emptiness.

May 20, 2024

One bit in the rounding gap

 2 min layoutc stores a quadrant in the sign of a micron-scale nudge that the codec’s 1.5 mm grid snap folds back to exactly zero.

May 20, 2024

The deferred namespace

 3 min A custom Python namespace records imports, then resolves deferred names on first lookup.

Sep 11, 2017

Source ready to distribute

 2 min A source release can include generated C, headers, and version data without requiring those artifacts to live in the original checkout.

Jul 10, 2017

Why not ZIP?

 1 min In the packaging discussion I favored ZIP’s mechanics and Python’s existing use of it; the source-distribution contract chose tar.gz.

Jun 15, 2017

D is for dog

 1 min A little Python program I wrote with my first-grade son: type a letter, hear an animal.

Dec 8, 2015

Materializing a default

 1 min settingsd copied a mutable fallback correctly, then lost edits because the copy had never become namespace state.

Mar 6, 2015

Static Python

 7 min zippy: a PGO-built CPython with every C extension statically folded in, the application zipped onto the tail of the binary, and the interpreter treated as just another dependency.

Feb 2, 2015

Logging after the fact

 3 min retrospect instrumented already-compiled Python functions by swapping in rewritten code objects at runtime—and restored the exact original on request.

Dec 1, 2014

Validation before initialization

 1 min Python-SAML checked for embedded certificates through state its constructor had not assigned yet.

Nov 26, 2014

settingsd

 3 min conf.d for Python settings, with ordered executable fragments and a record of where assignments came from.

Nov 3, 2014

The polyglot activate script

 2 min zippy’s bin/activate was six lines valid in both bash and Python, and sourcing it executed itself to print its own exports.

Jun 5, 2014

NUL-joined argv

 2 min Write a readable Python argv literal with NUL separators, provided every formatted value is NUL-free.

Jun 3, 2014

The settrace ambush

 3 min CPython 2 had no general hook after PySys_SetArgv finalized startup state but before user code, so zippy’s site.py armed a one-shot trace function.

Jun 3, 2014

Couch Multiseat

 4 min Five weeks to build a from-scratch X11 window manager that gave each gamepad an independent pointer so several Minecraft clients could share one TV.

Apr 26, 2014

Xacto

 4 min Deriving a command tree from Python modules and signatures, then making tool discovery work across deferred imports and ZIP files.

Mar 19, 2014

Callable modules

 2 min A CPython experiment put a module body inside a function, made attributes share its globals, and used a call to execute it again.

Mar 14, 2014

Returning the fault

 1 min Suds could return different fault types through different paths; I proposed returning the same WebFault object callers could otherwise catch.

Jan 23, 2014

The other serializer

 1 min A Celery event setting failed despite an explicit accept list, and embedding the worker in uWSGI amplified the retry loop.

Dec 13, 2013

Quotes for the next parser

 2 min A Distil build exposed two separate needs: keep the compiler argument together, and preserve the quotes inside its C macro value.

Aug 19, 2013

The mapping constructor

 1 min A one-line Spyne change let the configured mapping type receive the member pairs the serializer already produced.

Jul 15, 2013

Building against the metadata

 5 min Distlib and Distil exposed the practical edges of a static Python build: incompatible local candidates, ZIP resources, changing schemas, and executable build steps.

Jul 10, 2013

python32.3

 1 min A bulk shebang rewrite left gprof2html.py asking for an interpreter that never existed. Arch was patching it with sed, so I sent the report upstream.

Apr 20, 2013

GridFUSE

 4 min A filesystem experiment over MongoDB GridFS: directories as queries, new versions on overwrite, and deletion through a visibility flag.

Apr 10, 2013

Threesixty

 4 min Xbox 360 through a compressed VPN to DigitalOcean, with a live player map, traffic-based host estimates, and replayable captures.

Mar 27, 2013

The VPython Years

 2 min I learned Python for a 3D library, then kept following its imports and build machinery into the language itself.

Jan 15, 2013

uWSGI

 5 min Learning through a server I wanted to use for almost everything: embedded files, Python entry points, packet boundaries, and the order things came alive.

Nov 20, 2012

Before partialmethod

 2 min The Python 2 recipe for binding a functools.partial as a method—three-argument MethodType plus update_wrapper—and the stdlib name that replaced it.

Nov 13, 2012

A paste from the terminal

 2 min Adding multipart uploads to pastie-sane meant accepting files, recognizing compressed text, and returning a link a shell user could use.

Oct 20, 2012

Nested AMQP tables through librabbitmq

 2 min An unmerged librabbitmq patch taught a Python/C boundary to carry nested AMQP tables and arrays instead of flattening their structure.

Oct 12, 2012

Relocatable Python with $ORIGIN

 3 min A runtime library path relative to the executable lets a built interpreter move as a tree—verified in the ELF policy and the loader’s result.

Sep 13, 2012

Before the handler

 1 min Missing AMQP properties could trap Kombu in a delivery-time KeyError before user code received the message.

Jul 31, 2012

The type of infinity

 1 min Spyne’s unbounded defaults used float infinity, which made Decimal validation depend on the Python version.

Jul 12, 2012

Comments at the parser boundary

 1 min XML comments were becoming empty RPC models; configuring the parser removed them before either decoder saw them.

Jun 24, 2012

Optional and nil

 2 min Two Spyne fixes separated whether an XML element must appear from whether its value may be nil.

Jun 19, 2012

What Happened With pyjs

 7 min Working on a Python-to-JavaScript toolkit, the 2012 split, and what I would do differently.

May 3, 2012

Callback identity for WebKit DOM events

 2 min Making WebKit’s DOM events usable from Python required callback types, lifetime information, and an identity the remove operation could recognize.

Feb 5, 2012

The missing python2 shebang

 1 min Pygments recognized python and python2.7 but missed python2, just as Arch made the major-version name useful.

Mar 26, 2011

pacproxy

 4 min A caching proxy for Arch packages that streamed and cached in one pass, kept HTTP validators as sidecar state, and published its own caveat list.

Dec 20, 2009

Two Import Interfaces

 2 min A teaching library’s wildcard namespace and an integrator’s explicit namespace are different interfaces, and a module can carry both on purpose.

Oct 22, 2009

Pinning a HUD to a Moving Camera

 2 min A label pinned to the viewport exposes the difference between world, camera, and screen coordinates.

Oct 22, 2009

Learning Python by Debugging Boost.Python

 2 min A VPython crash took me through Python versions, word sizes, and Boost builds to find a working combination.

Sep 16, 2009

Teaching Aliasing with Streams

 1 min Open streams and database connections gave me a useful way to explain Python assignment: another name refers to the same live resource.

Sep 13, 2009

A Dependency Edit Does Not Change an ABI

 1 min Changing package metadata changes what the package manager accepts; it does not establish that a compiled artifact can run against a new interpreter.

Sep 4, 2009
No matching items