namedtuple

from collections import namedtuple

A namedtuple can be used as a lightweight class (with a class name and attribute names).

Crayon = namedtuple('Crayon', 'code color')

red = Crayon(121, 'pale geranium lake')
yellow = Crayon(105, 'light cadmium yellow')
green = Crayon(112, 'leaf green')
blue = Crayon(120, 'ultramarine')
print(yellow)
Crayon(code=105, color='light cadmium yellow')
print(red.code)
print(blue.color)
print(yellow[0])
121
ultramarine
105
Crayon._fields
('code', 'color')
for key, value in green._asdict().items():
    print(key, ':', value)
code : 112
color : leaf green

Instantiate using a tuple.

new_crayon = (141, 'Delft blue')
blue_2 = Crayon._make(new_crayon)
blue_2 = Crayon(*new_crayon)

If you spot any errors please let me know on twitter.