def update(self, d, **kw):
        """Update the properties of the wrapped object from d and kw, with the
        same semantics as dict.update.

        if d has keys, for k in d: self[k] = d[k]
        else, for k, v in d: self[k] = v
        then, for k in kw: self[k] = kw[k].

        """
        if hasattr(d, 'keys'):
            for k in d:
                self[k] = d[k]
        else:
            for k, v in d:
                self[k] = v
        for k, v in kw.iteritems():
            self[k] = v
Update the properties of the wrapped object from d and kw, with the
        same semantics as dict.update.

        if d has keys, for k in d: self[k] = d[k]
        else, for k, v in d: self[k] = v
        then, for k in kw: self[k] = kw[k].

        
recipes/Python/502219_attrview_dictstyle_access/recipe-502219.py