0

In python class is an object. When I create a class like this -

class example1:
    pass:

and then print the class object I get this -

print example1
__main__.example1

But when I create a class as a subclass of Object class -

class example2(object):
    pass:

and then print the class object I get this -

print example2
<class '__main__.example2'>

Why is there a difference between two representations of class objects?What is exactly main in both the cases?

akg
  • 670
  • 10
  • 30
  • And now do the same, but using Python 3 instead... –  Jul 23 '15 at 09:27
  • 2
    As for `__main__`, see e.g. http://stackoverflow.com/a/419185/3001761, https://docs.python.org/2/library/__main__.html - and please ask one question at a time. – jonrsharpe Jul 23 '15 at 09:27

0 Answers0