mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
🚨 Develop: 完全使用 ruff 替代 isort 与 black (#3151)
This commit is contained in:
@ -1,18 +1,18 @@
|
||||
import abc
|
||||
from copy import deepcopy
|
||||
from typing_extensions import Self
|
||||
from collections.abc import Iterable
|
||||
from dataclasses import field, asdict, dataclass
|
||||
from copy import deepcopy
|
||||
from dataclasses import asdict, dataclass, field
|
||||
from typing import ( # noqa: UP035
|
||||
Any,
|
||||
Type,
|
||||
Union,
|
||||
Generic,
|
||||
TypeVar,
|
||||
Optional,
|
||||
SupportsIndex,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from typing_extensions import Self
|
||||
|
||||
from nonebot.compat import custom_validation, type_validate_python
|
||||
|
||||
@ -329,8 +329,9 @@ class Message(list[TMS], abc.ABC):
|
||||
return self[type_]
|
||||
|
||||
iterator, filtered = (
|
||||
seg for seg in self if seg.type == type_
|
||||
), self.__class__()
|
||||
(seg for seg in self if seg.type == type_),
|
||||
self.__class__(),
|
||||
)
|
||||
for _ in range(count):
|
||||
seg = next(iterator, None)
|
||||
if seg is None:
|
||||
|
Reference in New Issue
Block a user