Nick Craig-Wood wrote:
Why is it like that?

Speed, I assume - if it was exception based, then *every* operation effectively gets wrapped in a try/except block. Yikes!


Also, for C implementations, the error return is fairly natural. It's only when implementing operations in Python that it bites.

 And could it be changed (Nick Coghlan's proposal
seems good to me)?

Take a look at my latest suggestion using OperatorTypeError and operatormethod. (which makes it easy to put the try/catch block in place if you want it, while still leaving it out for the common case).


Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
_______________________________________________
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