[Tutor] class questions
g.nius.ck at gmail.com
Sun Jun 27 01:38:05 CEST 2010
Well the application of defining ones own error is in a module. For example,
if I make a banking account module, I might define a WithdrawError if there
is a place where a error might occur. That way if client code tries to
withdraw too much, you can have a very descriptive error making it easier to
On Sat, Jun 26, 2010 at 8:17 AM, Payal <payal-python at scriptkitchen.com>wrote:
> 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,
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor