Skip to content

Instantly share code, notes, and snippets.

bfroehle /
Last active Oct 6, 2020
Proof of concept of using the LLVM JIT compiler to load Python extension modules.

Python & LLVM Extension Modules

This is a quick proof of concept of using the LLVM JIT compiler as Python's extension module loader. This implelentation completely replaces the standard extension module framework, so regular extension modules cannot be loaded. It would not be too difficult to extend the patch to allow loading both LLVM bitcode (.bc) and regular extension (.so) modules.

sunetos /
Created Nov 4, 2012
Bitey Autogeneration of Struct Member Names with Ctags
#!/usr/bin/env python
"""Patch bitey to auto-generate struct member names with exuberant ctags."""
__author__ = ' (Adam R. Smith)'
from collections import OrderedDict
import logging as log
import os
import subprocess
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

bfroehle /
Created Feb 29, 2012 for Python 2.6, 2.7, and 3.2
An Python re-implementation of hierarchical module import.
Function names and arguments have been chosen to mimic the C code in
`Python/import.c` whenever possible.
This code is intended to be read, not executed. However, it does work
-- all you need to do to enable it is "import knee".
(The name is a pun on the klunkier predecessor of this module, "ni".)
You can’t perform that action at this time.