# coding=utf-8
"""
The switch class refers to PEP 275 (Marc-André Lemburg <mal at lemburg.com>)
(https://www.python.org/dev/peps/pep-0275/)

"""
class switch(object):
    def __init__(self,value):
        self.value = value
        self.fall = False

    def __iter__(self):
        """Return the match method once, then Stop"""
        yield self.match
        raise StopIteration

    def match(self,*args):
        """Indicate whether or not to enter a case suite"""
        if self.fall or not args:
            return True
        elif self.value in args:
            self.fall = True
            return True
        else:
            return False

Add switch class for good utility