creating dictionnaries

Christian Caremoli Christian.Caremoli at der.edf.fr
Tue Jun 22 08:33:42 EDT 1999


Hi,
Dictionnaries can be created like that :
d={'a':1,'b':2}

By calling a function you create a dictionnary like that :
def f(**d):
   return d

d=f(a=1,b=2)

I would like to be able to create dictionnaries with some similar syntax
like keyed tuples :
d=(a=1,b=2)

Is there a way to do that ?

Thanks

Christian Caremoli





More information about the Python-list mailing list