It works to create an alias, but ideally there is a way to create something callable too
I don’t know what the syntax should be. But I think specializing a function would be nice. The workaround is to create classes and abuse __new__, and use pyright since mypy is very opinionated on what __new__ is allowed to do. This works today
class my_generic_function[A, B]:
def __new__(cls, a: A, b: B) -> tuple[A, B]:
return a,b
class my_specialized_function[B](my_generic_function[str, B]): ...
my_specialized_function('hello', 1) # OK
my_specialized_function(1, 1) # Pyright correctly complains
but maybe there are more idiomatic solutions.