[Python-ideas] Definition Symmetry (original) (raw)

Barry Warsaw barry at python.org
Thu Jan 31 22:06:57 CET 2013


On Jan 31, 2013, at 11:33 PM, Andrew Grigorev wrote:

Other strange thing is that the raise statement doesn't require to instantiate an Exception object, allowing to pass an Exception class to it.

raise NotImplementedError raise NotImplementedError() Is there any difference between this two lines of code?

The main difference (I think this is still true) is that in the first example, if the exception is caught in C it can avoid instantiation.

Cheers, -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130131/5a3412a0/attachment.pgp>



More information about the Python-ideas mailing list