From dd5caa4a8f16a31a6486fa1a69e840d8708a558d Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Fri, 1 Mar 2024 20:09:18 +0200 Subject: [PATCH] replace use of pytools.Record with dataclass --- meshpy/ply.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/meshpy/ply.py b/meshpy/ply.py index a006967..8022f90 100644 --- a/meshpy/ply.py +++ b/meshpy/ply.py @@ -1,3 +1,13 @@ +from dataclasses import dataclass +from typing import List + + +@dataclass(frozen=True) +class DataBlock: + properties: List[str] + data: List[str] + + def parse_int(it): return int(next(it)) @@ -69,11 +79,6 @@ def parse_line(parsers, line): result.append(p(it)) return result - from pytools import Record - - class DataBlock(Record): - pass - for name, line_count, props in data_queue: prop_names, parsers = list(zip(*props)) result[name] = DataBlock(