'Create a ConfParse with the conf data. ``conf`` may be a string
or a file-like object with a ``read(nbytes)`` method.'

def __init__(self, conf):

    dict.__init__(self)
    parser = xml.parsers.expat.ParserCreate()
    parser.StartElementHandler = self._element_start
    parser.EndElementHandler = self._element_end
    parser.CharacterDataHandler = self._char_handler
    self._curname = None
    self._element = None
    try:
        if callable(conf.read):
            parser.ParseFile(conf)
    except AttributeError:
        parser.Parse(conf)
