def update(x, *maps, **entries):
    """Update a dict or an object with slots according to entries.
    
    >>> update({'a': 1}, a=10, b=20)
    {'a': 10, 'b': 20}
    >>> update(Struct(a=1), a=10, b=20)
    Struct(a=10, b=20)
    """
    for m in maps:
        if isinstance(m, dict):
            entries.update(m)
        else:
            entries.update(m.__dict__)

    if isinstance(x, dict):
        x.update(entries)
    else:
        x.__dict__.update(entries)
    return x