Pyhon 2.x or 3.x, which is faster?

Steven D'Aprano steve at pearwood.info
Tue Mar 8 19:04:02 EST 2016


On Wed, 9 Mar 2016 12:49 am, BartC wrote:

>> Nevertheless, in the real world, you have to deal with corrupt JPGs and
>> files mislabelled as JPGs. And "crashing" doesn't count as "deal with"
>> :-)
> 
> OK, I changed the 'raise' line to 'exit(0)'. Job done!


Possibly a really amateurish, lazy job, but still done.

So now when you can't process a file, you silently exit, giving no
indication that there was a problem or what the problem was. You suppress
the helpful traceback, making sure that it is as difficult as possible for
the user to diagnose the problem. You even exit with an exit code of 0
("success") in order to confuse any scripts they use. Brilliant! I love
helpful tools like that!

How many years did you say you have been programming?



-- 
Steven




More information about the Python-list mailing list