[Python] PyCharm: namedtuple: unexpected argument, unfilled parameter

Discussão em 'Python' iniciado por Stack, Fevereiro 11, 2025.

  1. Stack

    Stack Membro Participativo

    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.

    [​IMG]

    Continue reading...

Compartilhe esta Página