allow switch-on/cases for every attribute
I have encountered compilation errors when tried to switch encoding and something else. I guess we need to implement switch in the way allowing to use it nearly on any attribute. I guess switch should be translated into switch or analogues. And in python where possible it should use a look-up dictionary instead of elif.