Interfaces and Exceptions

Discussion in 'Python' started by Calvin Spealman, Jun 8, 2004.

  1. 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
    implements?
     
    Calvin Spealman, Jun 8, 2004
    #1
    1. Advertising

  2. Calvin Spealman

    Hung Jung Lu Guest

    Calvin Spealman <> 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
    masochist.

    http://www.mindview.net/Etc/Discussions/CheckedExceptions

    regards,

    Hung Jung
     
    Hung Jung Lu, Jun 9, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ahmed Moustafa
    Replies:
    5
    Views:
    30,098
    Chris Smith
    Jul 14, 2004
  2. Jama
    Replies:
    18
    Views:
    13,890
    Dimitri Maziuk
    Jun 6, 2006
  3. Paul Miller
    Replies:
    3
    Views:
    1,049
    Alex Martelli
    Nov 12, 2003
  4. josh
    Replies:
    6
    Views:
    458
    Ed Kirwan
    Dec 19, 2006
  5. Replies:
    3
    Views:
    630
    Sherm Pendley
    Apr 16, 2007
Loading...

Share This Page