MAL> I must have missed this one:

That's because it was brief and to the point, so the discussion lasted for
maybe three messages.  Also, someone told us you were on holiday so we
thought we could squeak it through without you noticing.  Darn those
Aussies.  Late on the pydev summary again! <wink>

    >> ----------------------------
    >> Style for raising exceptions
    >> ----------------------------
    >> 
    >> Guido explained that these days exceptions should always be raised as::
    >> 
    >> raise SomeException("some argument")
    >> 
    >> instead of::
    >> 
    >> raise SomeException, "some argument"
    >> 
    >> The second will go away in Python 3.0, and is only present now for
    >> backwards compatibility.  (It was necessary when strings could be
    >> exceptions, in order to pass both the exception "type" and message.)
    >> PEPs 8_ and 3000_ were accordingly updated.

I do have a followup question on the style thing.  (I'll leave others to
answer MAL's question about optimization.)  If I want to raise an exception
without an argument, which of the following is the proper form?

    raise ValueError
    raise ValueError()

Skip
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to