def outer(**kwargs): def nested(): print(kwargs['foo']) return kwargs.get('bar')