Python/named tuple magic

import collections
company = collections.namedtuple('company', 'ceo, ticker, price')

Create instances from lists

# load some data from a list, e.g.:
data = [‘Jeff Bezos’, ‘AMZN’, 997]
# _make method
Amazon = company._make(data)
# or list unpacking; same result
Amazon = company(*data)

Get data back

Amazon.ticker
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.