Search notes:

Python standard library: typing.NamedTuple

from typing import NamedTuple

class Information(NamedTuple):
    id:        int | None
    name:      str | None
    year_pub:
    lang:      str | None

info = Information(id = 42, name = 'Hello World', year_pub = 2020, lang = 'en')

print(info.name)

See also

collections.namedtuple
dataclasses.dataclass
typing

Index