From 244e8476c95d14a480be7160042b2b27b693ca63 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Wed, 9 Feb 2022 10:30:44 -0800 Subject: Ditch named tuples for dataclasses. --- text_utils.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'text_utils.py') diff --git a/text_utils.py b/text_utils.py index 7910990..720bf20 100644 --- a/text_utils.py +++ b/text_utils.py @@ -8,18 +8,20 @@ import logging import math import sys from collections import defaultdict -from typing import Dict, Generator, List, Literal, NamedTuple, Optional, Tuple +from dataclasses import dataclass +from typing import Dict, Generator, List, Literal, Optional, Tuple from ansi import fg, reset logger = logging.getLogger(__file__) -class RowsColumns(NamedTuple): +@dataclass +class RowsColumns: """Row + Column""" - rows: int - columns: int + rows: int = 0 + columns: int = 0 def get_console_rows_columns() -> RowsColumns: -- cgit v1.3