In PyCharm, you can declare a named tuple.
from collections import namedtuple
InstTyp = namedtuple(
typename='InstTyp',
field_names='''
instance_type
memory
num_cpus
'''
)
Code that uses the named tuple runs without error.
it = InstTyp(
instance_type='tx',
memory=64,
num_cpus=8
)
However, PyCharm raises "Unexpected argument" and "unfilled parameter" inspection warnings.
The field_names are a sequence of strings such as ['x', 'y']. Alternatively, field_names can be a single string with each fieldname separated by whitespace and/or commas, for example 'x y' or 'x, y'.
The python interpreter handles all whitespace, so the code runs. PyCharm does not handle newlines in whitespace, so PyCharm displays inspection warnings.
There are two solutions.
Split field_names into an array:
Put field_names on a single line.
The PyCharm inspection warnings are gone.