classification
Title: Missing case / switch / evaluate
Type: Stage:
Components: Interpreter Core Versions: 3rd party
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, dbodin
Priority: normal Keywords:

Created on 2008-03-15 16:41 by dbodin, last changed 2008-03-15 16:43 by christian.heimes. This issue is now closed.

Messages (2)
msg63555 - (view) Author: BODIN (dbodin) Date: 2008-03-15 16:41
I am not the code :

if toto == 1:
   ...
elsif toto == 2:
      ...
     elsif

In ADA for example :

      case C is	                                   --  4 Start a case
statement
         when Red => Result := 1;
         when Blue =>Result := 2;
         when Black .. Brown => Result := 3;
         when Orange | Indigo => Result := 4;
         when  others => Result := 5;required for unspecified cases.
      end case;	

Is it not better?
msg63556 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-03-15 16:43
This is a bug tracker and not a help forum. Please use the Python
general mailinglist to get help. Your problem can be solved with a
pattern called "dispatcher dict".
History
Date User Action Args
2008-03-15 16:43:46christian.heimessetstatus: open -> closed
resolution: not a bug
messages: + msg63556
nosy: + christian.heimes
2008-03-15 16:41:08dbodincreate