E
а чего за бот?
Основная функциональность там была реализована через arq - очередь на редисе для asyncio.
либа от создателя pydantic
https://github.com/samuelcolvin/arq
Size: a a a
E
SB
VA
ВТ
ВТ
VA
А4
AO
AO
ВТ
IS
Б
Called
?from functools import partial
from typing import TypeVar, Callable
T = TypeVar('T')
class Called:
def __class_getitem__(cls, callback: Callable[..., T]) -> T:
return callback()
def get_bar() -> str:
return 'bazilik'
def check_bar(bar: Called[get_bar]) -> bool:
return bar.startswith('baz')
YV
DB
Called
?from functools import partial
from typing import TypeVar, Callable
T = TypeVar('T')
class Called:
def __class_getitem__(cls, callback: Callable[..., T]) -> T:
return callback()
def get_bar() -> str:
return 'bazilik'
def check_bar(bar: Called[get_bar]) -> bool:
return bar.startswith('baz')
YV
DB
ВТ
Б
called.py:16: error: "Called" expects no type arguments, but 1 given
called.py:16: error: Function "scratch_24.get_bar" is not valid as a type
called.py:16: note: Perhaps you need "Callable[...]" or a callback protocol?
called.py:17: error: "Called" has no attribute "startswith"
DB