How can I get the name of a function?

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

I want to have print the name of a function. But str(my_function()) calls the function because functions aren’t first-class objects (yet). So how can I print either: my_function() or: my_function without passing it between quotation marks?

I’m afraid you cannot do that (yet) in GDscript. What are you trying to achieve with that?

njamster | 2020-06-06 12:20

I wanted to get the function name of which button was pressed but now I found a better solution: just connected all buttons to the same signal but each with another extra_argument.

MaaaxiKing | 2020-06-06 13:03