Making John Corwin Proud

Posted in development, technology at 12:14 am by wingerz


Here’s some Python I wrote tonight for filtering our entries to generate feeds for Pundit Monitor. I know it’s basic stuff in the FP world, but it makes me happy since I’ve been programming in Java at work for the past few years. Elegance, how I’ve missed you.

def by(f):
  return lambda x: reduce (
    lambda a, b: a and b, 
    map(lambda k: x[k] == f[k], f.keys())
cahouse = {
  "state" : "California",
  "racetype" : "house"
entries = filter (by(cahouse), allentries)

« Previous Page « Previous Page Next entries »