PEP 718: subscriptable functions

This may be out of scope for this PEP, but has the use case of specializing generic functions been discussed? I have a generic implementation that takes various type variables, but parts of the application only use a fixed value for that type variable and I want to save users from having to know the underlying implementation is generic. I essentially want an alias for the function but with some type vars clamped.
Example

def mygenericfun[A, B](a: A, b:B) -> A: ...

## Specialization (desired)
myfun[B] = mygenericfun[str, B]

# Users import `myfun` not `mygenericfun`
### LSPs/type checkers/linters now can show a signature for myfun as myfun[B](a: str, B) -> str ```

Currently this possible with possible with classes through inheritance and to some degree with type aliases. AFAIK for functions the only solution is to write a full wrapper.

EDIT: Added an example here

2 Likes