def __init__(self): for typ, keys in self._types.items(): for key in keys.split(): self[key] = typ self['_%s' % key] = '%s[]' % typ # this could be a static method in Python > 2.6