summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-14 19:02:53 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-14 20:01:28 -0700
commit511d31cbd18a13794411c60d9c245b76d92c56a1 (patch)
tree27254323d0a4def8d933129c920726a856b65dc8
parent2ae048377f738cb1c96f8132eae106271ca05ab8 (diff)
lib9p: idl: Parser: Use Python 3.13 type aliases
-rw-r--r--lib9p/idl/__init__.py7
1 files 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 <lukeshu@lukeshu.com>
+# Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
# 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 ########################################################################