Skip to content

Instantly share code, notes, and snippets.

Matt Bone thatmattbone

Block or report user

Report or block thatmattbone

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
thatmattbone /
Created May 4, 2012
a tour of python's ElementTree path language
import sys
import trace
import xml.etree.ElementTree
from xml.etree.ElementPath import prepare_child, xpath_tokenizer
TEST_DOC = """
<b value="2"/>
thatmattbone /
Created Apr 28, 2011
exec() yourself silly
import random
class AreYouFeelingLuckyDict(dict):
"""A dictionary with a 50% chance of returning the thing you
actually put into it."""
exclude = set(["runs",
class LazyDictionary(object):
def __init__(self, callback=dict): = None
self.callback = callback
def evaluate_callback(self): = self.callback()
def __getitem__(self, name):
You can’t perform that action at this time.