You might also try: foo['spam'] = foo.setdefault('spam',0) + 1 -- Emile van Sebille emile at fenx.com