Below is an example piece of code from the python documentation dealing with exception handling and classes. I am working to understand both of these, and my background is in Java, so I am used to strongly typed classes and variables. Would someone please explain in detail what is going on here?
class B:
pass
class C(B):
pass
class D(C):
pass
for c in [B, C, D]:
try:
raise c()
except D:
print "D"
except C:
print "C"
except B:
print "B"
Are the first six lines actually creating instances of B, C, and D or just creating a class type. If they are just class types, I assume they are instated in for c in [B, C, D]:. How can instances of classes C and D be instantiated without parameters? Then what is going on with the exception stuff?