diff options
| author | Scott Gasch <[email protected]> | 2022-02-09 10:30:44 -0800 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2022-02-09 10:30:44 -0800 |
| commit | 244e8476c95d14a480be7160042b2b27b693ca63 (patch) | |
| tree | 661f9903aac5ac05693d1f74a4272c4b42c41477 /text_utils.py | |
| parent | ea7a67e2cf8dc6d7a41e7ff035acae7b36a41a1d (diff) | |
Ditch named tuples for dataclasses.
Diffstat (limited to 'text_utils.py')
| -rw-r--r-- | text_utils.py | 10 |
1 files changed, 6 insertions, 4 deletions
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: |
