bvdp wrote:
Which is preferred in a raise: X or X()? I've seen both. In my specific case 
I'm dumping out of a deep loop:

try:
  for ...
    for ...
      for ...
        if match:
           raise StopInteration()
         else ...

except StopInteration:
   print "found it"

I prefer the raise X() version, it fulfils the zen of python :

"Special cases aren't special enough to break the rules.
There should be one-- and preferably only one --obvious way to do it."

I still wonder why they've added the class raise form, on which purpose.

JM

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to