Custom bicycle 'update_dict' was replaced with 'collections.defaultdict'.

This commit is contained in:
Alexander Artemenko 2010-12-26 23:59:30 +03:00
commit 01b4c06916
2 changed files with 5 additions and 16 deletions

View file

@ -7,17 +7,6 @@ from codecs import open as _open
from itertools import groupby
from operator import attrgetter
def update_dict(mapping, key, value):
"""Update a dict intenal list
:param mapping: the mapping to update
:param key: the key of the mapping to update.
:param value: the value to append to the list.
"""
if key not in mapping:
mapping[key] = []
mapping[key].append(value)
def get_date(string):
"""Return a datetime object from a string.