def tester(**kwargs):
    print(kwargs)


class D:
    """http://stackoverflow.com/a/8601389/190597 (Raymond Hettinger)"""

def keys(self):
    return ['a', 'b']

def __getitem__(self, key):
    return key.upper()
How to test if object is a mapping (supports **O usage)