I am working with mongodb in python and want to define some functions. One function needs a collection object as well as its name represented as string. However for the user its the same name. The only difference is, that the user has to define the name one time as obejct as well as string, like
myfunc(object, "object")
However, I want to change this and want to convert the object internally into a string like
myfunc(object)
When I use str()
, the values of the string are show but not the string-representation of the object like "object".
So, is there a way to convert the object name directly into string?