Case Statements

jj0gen0info at gmail.com jj0gen0info at gmail.com
Tue Mar 15 16:46:25 EDT 2016


Given that "Case Statements" are more compact and less redundant than a sequence of if-elif statements, and usually can contain embedded match lists:
Is there any chance future versions of Python will adopt a case structure?

Something like

select x
   case in [1,2,3,5,7,9]
   print ....
   case in [4,6,8]
   print ....
   case else
   print ....

Just a thought.

JJ



More information about the Python-list mailing list