[Tutor] class questions

Payal payal-python at scriptkitchen.com
Sat Jun 26 14:17:45 CEST 2010


Hi,
Some questions about which I am a bit confused.

1. I know there is a difference between mro of classic and new style
classes. but I do not get why we need the new mro, the old one is easy
to predict and understand?

2. A friend of mine told me that in C++ abstract classes are classes
which can not be instatiated. Is she right, do we have them in python,
if yes can someone give a simple example?

3. In http://www.alan-g.me.uk/tutor/index.htm , Alan has given an
example in "User Defined Exceptions",
>>> class BrokenError(Exception): pass

Even after reading the section a few times over, I fail to get utility
of such a class. Can someone please explain with better example?
Alan can you please cleanup that section, maybe make it broader and put
the stuff about "SystemExit" elsewhere.

Thanks a lot in advance.

With warm regards,
-Payal
-- 




More information about the Tutor mailing list