I didn't find how to make a generic function in Python (not classes)
For instance, in .net
I can have something like this:
static T methodName<T>(string v)
{
# foo
# bar
}
In Python it would be something like:
from typing import TypeVar, Generic
T = TypeVar('T')
def get_info_from_toml[T](section: str) -> T:
pass
As I'm using mypy to check types, it makes my code coherent to the checks and avoids the need for arbitrary casts.
Is it possible to have something similar to it in Python?