T
Note that field ordering of dict s is only maintained in newer python versions ( officially since 3.7, but also in CPython 3.6 ). >>> c = { "r" : 50 , "g" : 205 , "b" : 50 , "alpha" : alpha} >>> Color = namedtuple( "Color" , c) >>> Color(**c) Color(r= 50 , g= 205 , b= 50 , alpha= 0 )