from collections import namedtuple
from dataclasses import dataclass


def test_namedtuple():

    # Создание namedtuple
    Duck = namedtuple('Duck', 'bill tail')
    duck = Duck('wide orange', 'long')

    # Можно сделать namedtuple из словаря
    parts = {'bill': 'wide orange', 'tail': 'long'}
    duck2 = Duck(**parts)

    print(duck)
    print(duck.bill)
    print(duck.tail)

    print(duck2)


@dataclass
class TeenyDataClass:
    name: str

@dataclass
class AnimalClass:
    name: str
    habitat: str
    teeth: int = 0


def dataclass_test():

    snowman = AnimalClass('yeti', 'Himalayas', 46)
    duck = AnimalClass(habitat='lake', name='duck')
    print(snowman)
    print(duck)

# teeny = TeenyDataClass('bitsy')
# print(teeny.name)


def main():
    dataclass_test()


if __name__ == '__main__':
    main()