On 15/03/2016 20:46, jj0gen0i...@gmail.com wrote:
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


Been suggested and rejected via https://www.python.org/dev/peps/pep-3103/ and https://www.python.org/dev/peps/pep-0275/. The "Rejection Notice" section of the former states "A quick poll during my keynote presentation at PyCon 2007 shows this proposal has no popular support. I therefore reject it.".

See also http://c2.com/cgi/wiki?SwitchStatementsSmell

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to