Is there anyway to get the names of passed arguments to a function in python?

前端 未结 6 1969
栀梦
栀梦 2021-01-06 15:50

I like to know what was the local variable names when they are passed to a function. I\'m not sure whether this is possible at all. Let\'s consider this example:

fun

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-06 16:12

    It seems that it's impossible in Python but it's actually possible in C++.

    #define show(x)   std::cout << #x << " = " << x << std::endl
    

提交回复
热议问题