'Return a deepcopy of self as a dictionary.
All members that are ``Section`` instances are recursively turned to
ordinary dictionaries - by calling their ``dict`` method.
>>> n = a.dict()
>>> n == a
1
>>> n is a
0'

def dict(self):

    newdict = {}
    for entry in self:
        this_entry = self[entry]
        if isinstance(this_entry, Section):
            this_entry = this_entry.dict()
        elif isinstance(this_entry, list):
            this_entry = list(this_entry)
        elif isinstance(this_entry, tuple):
            this_entry = tuple(this_entry)
        newdict[entry] = this_entry
    return newdict
