| ▲ | Philip-J-Fry 2 hours ago | |
If your function changes it's behaviour based on the type, then it's not generic. Your list_contains function should be able to just do a == comparison regardless of whether it's an int or a string. This is effectively no different than adding a parameter to one of your non-"generic" functions and just swapping behaviour based on that? | ||