From cdca198228104e624047365c7b87e85669613536 Mon Sep 17 00:00:00 2001 From: Bastiaan Welmers Date: Mon, 4 May 2020 19:31:13 +0200 Subject: [PATCH] use better typing.NamedTuple --- videodinges/models.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/videodinges/models.py b/videodinges/models.py index d353eec..1afd708 100644 --- a/videodinges/models.py +++ b/videodinges/models.py @@ -1,8 +1,13 @@ from datetime import datetime -from collections import namedtuple +from typing import NamedTuple + from django.db import models -Quality = namedtuple('Quality', ['name', 'width', 'height', 'priority']) +class Quality(NamedTuple): + name: str + width: int + height: int + priority: int qualities = ( Quality(name='360p', width=640, height=360, priority=1),