datalite
datalite copied to clipboard
Enhancement: proper fetch* type hinting
Current implementation of fetch methods do not type hint objects returned, which makes it more difficult to use.
Suggestion:
Add a TypeVar to fetch.py:
from typing import TypeVar
T = TypeVar('T')
Modify fetch* functions type hinting from:
def fetch_from(class_: type, obj_id: int) -> Any:
to:
def fetch_from(class_: type[T], obj_id: int) -> T:
That will give a proper type hint to IDE.