By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,345 Members | 1,783 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,345 IT Pros & Developers. It's quick & easy.

Find out the name of a variable passed as an argument

P: n/a
Hello everybody,

is there a way to receive the name of an object passed to a function
from within the function.

something like

def foo(param):
print theNameOfTheVariablePassedToParam

var1 = "hello"
var2 = "world"
>>foo(var1)
var1
>>foo(var2)
var2

thanks in advance,

greets

Andreas Huesgen

Oct 4 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Algol, anyone?
Andreas Huesgen wrote:
Hello everybody,

is there a way to receive the name of an object passed to a function
from within the function.

something like

def foo(param):
print theNameOfTheVariablePassedToParam

var1 = "hello"
var2 = "world"
>>foo(var1)
var1
>>foo(var2)
var2

thanks in advance,

greets

Andreas Huesgen
Oct 4 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.