Is there have Multi-dispatch function or libary?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By freakcoco

Is there have best practice for function multiple dispatch?
Some kind of Idiomatic or library?

e.g.

func hi (id :int):
    print(checkID(id))
func hi(name:String):
    print(name):
:bust_in_silhouette: Reply From: Zylann

GDScript does not support function overloading. A function with a given name can only exist once.
However, GDScript is dynamically typed, so if you omit type hints, you can do what your code shows in this way:

func hi(arg):
	if typeof(arg) == TYPE_INT:
		print(checkID(id))
	elif typeof(arg) == TYPE_STRING:
		print(arg)