Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Interfaces and Exceptions

Thread Tools

Interfaces and Exceptions

Calvin Spealman
Posts: n/a
Two somewhat related questions:

1) Is there a standard Interface class or module? Is it included with the
python distribution or is it third party?

2) How can I raise an exception and catch it based on the interfaces it

Reply With Quote
Hung Jung Lu
Posts: n/a
Calvin Spealman <(E-Mail Removed)> wrote:
> 2) How can I raise an exception and catch it based on the interfaces it
> implements?

By using Java?

Seriously, checked exceptions a la Java were such a bad idea that even
Java people came up with "patterns" to convert them to unchecked
exceptions. C# designers simply discarded checked exceptions from a
start and designed their exception handling based on the Python
exception handling model. (This is mentioned in a Microsoft's paper,
but I don't have the reference off hand.)

So, no need to mix exceptions with interfaces, unless you are a


Hung Jung
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exceptions + Performance on path without exceptions C++ 3 04-16-2007 08:52 PM
Declaring and implementing exceptions inside interfaces? josh Java 6 12-19-2006 08:29 AM
Interfaces and exceptions, best practice question Jama Java 18 06-06-2006 03:28 AM
Checked exceptions vs unchecked exceptions Ahmed Moustafa Java 5 07-14-2004 01:46 PM
Custom exceptions -- inherit from exceptions.Exception? Paul Miller Python 3 11-12-2003 09:24 AM