I am trying to return a version number, with a way to implement exceptions.
Since the exceptions can be for any of my classes I am trying to get the classname from the object.
Problem is, I get a tuple instead of a string:
def version_control(*args):
version = 1.0
print args
#Exception example:
print str(args.__class__.__name__)
if 'User' == args.__class__.__name__:
version = 12.3
return version
How can I change the str(args.__class__.__name__) in such a way that it return the name of the class as string?
args.__class__.__name__; something else is wrong. And why not useif isinstance(args, User):instead?