def test_list_based_with_try_except():
        "list-based switch + additional try/except-based default case support"
        switch = ListBasedSwitch.switch
        default_case = ListBasedSwitch.get_default_case()
        _error = IndexError
        x = ''
        for key in case_keys:
            try:
                x = switch[key](x[:10])
            except _error:
                x = default_case(x[:10])
list-based switch + additional try/except-based default case support
recipes/Python/577864_Fast_elegant_switchcaselike/recipe-577864.py