Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


Top White Papers

More on LinuxToday


Python4Kids New Tutorial: Being Exceptional

May 29, 2012, 15:00 (0 Talkback[s])
(Other stories by Brendan Scott)

Apparently, in Python, it is easier to ask for forgiveness rather than seek permission. That is to say, the normal approach when writing Python code is to assume that what you are trying to do will work properly. If something exceptional happens and the code doesn’t work the way you were hoping, then the Python interpreter will tell you of the error so that you can handle that exceptional circumstance. This general approach, of trying to do something, then cleaning up if something goes wrong is acronymically called EAFP (easier to ask for forgiveness than permission). Here is a (somewhat silly) example...

Complete Story

Related Stories: