💥 remove Python 3.7 support (#1148)

This commit is contained in:
Ju4tCode
2022-08-14 19:41:00 +08:00
committed by GitHub
parent 0620bec51f
commit 4974c596ec
26 changed files with 261 additions and 317 deletions

View File

@ -12,9 +12,8 @@ import re
import shlex
from itertools import product
from argparse import Namespace
from typing_extensions import TypedDict
from argparse import ArgumentParser as ArgParser
from typing import Any, List, Tuple, Union, Optional, Sequence, NamedTuple
from typing import Any, List, Tuple, Union, Optional, Sequence, TypedDict, NamedTuple
from pygtrie import CharTrie
@ -83,8 +82,7 @@ class TrieRule:
message_seg: MessageSegment = message[0]
if message_seg.is_text():
segment_text = str(message_seg).lstrip()
pf = cls.prefix.longest_prefix(segment_text)
if pf:
if pf := cls.prefix.longest_prefix(segment_text):
value: TRIE_VALUE = pf.value
prefix[RAW_CMD_KEY] = pf.key
prefix[CMD_START_KEY] = value.command_start