Why no 'elif' in try/except?
Marcin 'Qrczak' Kowalczyk
qrczak at knm.org.pl
Mon Jun 4 11:55:53 EDT 2001
More information about the Python-list mailing list
Mon Jun 4 11:55:53 EDT 2001
- Previous message (by thread): Why no 'elif' in try/except?
- Next message (by thread): Why no 'elif' in try/except?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Sun, 3 Jun 2001 22:15:23 -0700, John Roth <johnroth at ameritech.net> pisze: > Mixing the two makes no sense. In an except clause, there is no > result to test; in an else clause, there is. Is the elif supposed > to execute when there are exceptions, or when there aren't? Of course it would mean the same as 'else: if', without forcing another level of indentation. > If it's simply an extension to the else clause, then I suppose > it doesn't harm anything, but it adds complexity to the language > definition. At this point in my life, I tend to agree with Einstein - > make everything as simple as possible, but no simpler. Ok, so why elif exists in the first place at all? It's redundant. It can be replaced by 'else: if' and more indents. Answer: convenience, to avoid those indents. I don't understand only one thing. Why it is spelled 'elif' and not 'else if'? -- __("< Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK
- Previous message (by thread): Why no 'elif' in try/except?
- Next message (by thread): Why no 'elif' in try/except?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list