We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b26eb7 commit 1a3f1ccCopy full SHA for 1a3f1cc
src/wyoming_openai/utilities.py
@@ -2,12 +2,9 @@
2
from collections.abc import Callable
3
from enum import Enum
4
from io import BytesIO
5
-from typing import TypeVar
6
7
-E = TypeVar('E', bound=Enum)
8
9
-
10
-def create_enum_parser(enum_class: type[E], case_insensitive: bool = True) -> Callable[[str], E]:
+def create_enum_parser[E: Enum](enum_class: type[E], case_insensitive: bool = True) -> Callable[[str], E]:
11
"""
12
Create a type-safe parser function for argparse that converts strings to enum members.
13
0 commit comments