How to convert a namedtuple into a list of values and preserving the order of properties?

Viewed 18201
from collections import namedtuple
Gaga = namedtuple('Gaga', ['id', 'subject', 'recipient'])
g = Gaga(id=1, subject='hello', recipient='Janitor')

I want to be able to obtain this list (which preserves the order of the properties):

[1, 'hello', 'Janitor']

I could create this list myself manually but there must be an easier way. I tried:

g._asdict().values()

but the properties are not in the order I want.

1 Answers
Related