Join Slack
Powered by
if I want to use generics in function definition, ...
# getting-started
i
Ifvwm
06/20/2019, 2:52 AM
if I want to use generics in function definition, do I must need to put a <T> before the function's name like fun <T> whatever(x: T, y: T) ?
k
karelpeeters
06/20/2019, 5:28 AM
Either that or the generic argument comes from the containing class.
s
Shawn
06/20/2019, 11:22 AM
It’s similar to declaring a typevar if you’ve used generics with python’s type annotations
4
Views
Open in Slack
Previous
Next