[Python-Dev] Re: switch statement (original) (raw)
Michael Walter michael.walter at gmail.com
Thu Apr 28 14:46:22 CEST 2005
- Previous message: [Python-Dev] Re: switch statement
- Next message: [Python-Dev] Re: switch statement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 4/28/05, Stephen J. Turnbull <stephen at xemacs.org> wrote:
>>>>> "Guido" == Guido van Rossum <gvanrossum at gmail.com> writes:
Guido> You mean like this? if x > 0: ...normal case... elif y > 0: ....abnormal case... else: ...edge case... The salient example! If it's no accident that those conditions are mutually exclusive and exhaustive, doesn't that code require at least a comment saying so, and maybe even an assertion to that effect?
I usually do:
if ...: return ... if ...: return ... assert ... return ...
Michael
- Previous message: [Python-Dev] Re: switch statement
- Next message: [Python-Dev] Re: switch statement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]