From 511d31cbd18a13794411c60d9c245b76d92c56a1 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Tue, 14 Jan 2025 19:02:53 -0700 Subject: lib9p: idl: Parser: Use Python 3.13 type aliases --- lib9p/idl/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib9p/idl/__init__.py b/lib9p/idl/__init__.py index 920d02d..634b447 100644 --- a/lib9p/idl/__init__.py +++ b/lib9p/idl/__init__.py @@ -1,12 +1,12 @@ # lib9p/idl/__init__.py - A parser for .9p specification files. # -# Copyright (C) 2024 Luke T. Shumaker +# Copyright (C) 2024-2025 Luke T. Shumaker # SPDX-License-Identifier: AGPL-3.0-or-later import enum import os.path import re -from typing import Callable, Literal, TypeAlias, TypeVar, cast +from typing import Callable, Literal, TypeVar, cast __all__ = [ # entrypoint @@ -181,8 +181,7 @@ class Message(Struct): return self.members[1].val.tokens[0].val -Type: TypeAlias = Primitive | Number | Bitfield | Struct | Message -# type Type = Primitive | Number | Bitfield | Struct | Message # Change to this once we have Python 3.13 +type Type = Primitive | Number | Bitfield | Struct | Message T = TypeVar("T", Number, Bitfield, Struct, Message) # Parse ######################################################################## -- cgit v1.2.3-2-g168b