can some one please share their knowledge on instance vs object, i am using python 2.7 version.
i created a class and assigned to a variable t
class test(): pass t=test()
at this point i thought t is an object of class test but when i print i get a instance
print t <__main__.test instance at 0x7fb1a3562b00> type(t) <type 'instance'>
now i created another class with object
class Spam(object): pass s=Spam()
so when i printed this i was expecting it to be an object or instance , but i get a class type.
print s <__main__.Spam object at 0x7fb1a3560f10> >>> type(s) <class '__main__.Spam'>
i thought object is the base class from which all the classes are derived, if i mention in the class def or not. i am confused.
please share your thoughts
thanks pradeep