All pastes #436792 Raw Edit

Stuff

public text v1 · immutable
·published 2007-04-12 18:41 UTC
rendered paste body

from chandlerdb.util.c import Nil

a = {'foo': 1}

def f():
    if 'bar' in a:
        v = a['bar']
    else:
        v = 'no bar'
    return v

def g():
    v = a.get('bar', Nil)
    if v is Nil:
        v = 'no bar'
    return v