Other articles

  1. Death to the rubber stamp!

    July 19 2015

    You work really hard on some code, submit a pull request, hoping for some feedback, and then, dun dun dunnnn...

    ✨ lgtm! ✨

    Come on. We all know that all software is broken. No pull request is perfect -- there's always room for improvement. Yet so often we respond with an even ...

    tags: code review

  2. Watch it fail

    June 27 2015

    A tenet of test-driven development is, because you're writing your test first, you watch it fail, and then you write code to make it pass. Here are three examples of tests that pass even when they shouldn't. See if you can figure out why!

    1. willow

    A colleague ...

    tags: testing puzzles

  3. Module objects are global!

    June 14 2015

    One of my favorite kinds of bugs is when a test that seems entirely unrelated to a code change fails. I've trained myself to look for the common causes, usually having to deal with shared state due to a test missing a proper teardown. But this week, I had ...

    tags: python import debugging

  4. Things you can do other than scoffing at someone

    May 16 2015

    Things you can do other than scoffing at someone who says they use a technology you heard was horrible:

    • ask them about it, maybe they know things you don't know
    • change the subject
    • say something nice, like "I like your hat"
    • don't do or say anything
    • excuse yourself ...


  5. PyCon Recording: Investigating Python Wats

    April 18 2015

    Many of us have experienced a "wat" in Python - some behavior that totally mystifies us. Here is my PyCon talk on Investigating Python Wats, where we uncover some surprising implementation details of CPython, some unexpected consequences of mutability, and details of scope and name resolution.

    tags: speaking pycon python wats

  6. Python Wats: Mutable Default Arguments

    April 25 2014

    Let's look at a common Python wat and try to figure out wat's actually happening!

    We'll define a function, foo, which takes one argument, l, which has the default value of an empty list.

    >>> def foo(l=[]):
    ...     l.append('cat')
    ...     return l

    What happens when we call ...

    tags: python python internals

  7. Introducing Iron Maker Or Forger Or Something

    April 19 2014

    The end of Hacker School is quickly approaching and a thousand kittens are crying tears of sadness!

    In order to maintain momentum and Never Graduate, I'm challenging myself and some other Hacker Schoolers to complete a programming project once a week for two(?) months.

    This challenge is inspired by ...

    tags: hacker school

  8. Python Closures and Free Variables

    April 10 2014

    Today, friends, we will continue to dissect functional programming concepts in Python. We're going to try to figure out what the hell is going on in this chunk of code:

    >>> def make_contains_function(x):
    ...     def contains(s):
    ...             return x in s
    ...     return contains

    What happens when we pass make_contains_function a ...

    tags: python python internals functional programming closures

  9. Page 1 / 3 »