If two objects are of equal value you can compare them with ==. What I
want to do is find out if two objects are actually just references to
the same object, how can I do this in Python?
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
Use the dir() function
dir(myClass)
returns a list of strings
-Dan
--
http://mail.python.org/mailman/listinfo/python-list
Awesome, wrapping that into a function:
def getargs(func):
numArgs = func.func_code.co_argcount
names = func.func_code.co_varnames
return names[:numArgs]
short, concise, and it works :)
variables declared inside the function body are also in co_varnames
but after the arguments only it s
You can take a dictionary of key/value pairs and pass it to a function as
keyword arguments:
def func(foo,bar):
print foo, bar
args = {'foo':1, 'bar':2}
func(**args)
will print "1 2"
But what if you try passing those arguments to a function
def func2(bar,zoo=''):
print bar, zoo
H