Named tuple (sort of immutable dictionary)
-
namedtuple
-
A bit like an immutable dictionary
from collections import namedtuple
Person = namedtuple('Person', ['name', 'email'])
one = Person(name='Joe', email='joe@example.com')
two = Person(name='Jane', email='jane@example.com')
print(one.name)
print(two.email)