Код: Выделить всё
from collections import namedtuple
InstTyp = namedtuple(
typename='InstTyp',
field_names='''
instance_type
memory
num_cpus
'''
)
Код: Выделить всё
it = InstTyp(
instance_type='tx',
memory=64,
num_cpus=8
)
Подробнее здесь: https://stackoverflow.com/questions/749 ... -parameter
Мобильная версия