class CardinalityEnumMember:
    pass

class CardinalityEnum:

    def __init__(self):
        pass

    def lookup(self,st):
        rt = filter(lambda x,t=st: x._n == t,self.elements)
        if len(rt):
            return rt[0]
        return None

    class c1_1(CardinalityEnumMember):
        _n = 'c1_1'
        _v = 0
    class c1_N(CardinalityEnumMember):
        _n = 'c1_N'
        _v = 1
    class cN_1(CardinalityEnumMember):
        _n = 'cN_1'
        _v = 2
    class cN_N(CardinalityEnumMember):
        _n = 'cN_N'
        _v = 3

    elements = (c1_1,
                c1_N,
                cN_1,
                cN_N)



Cardinality = CardinalityEnum()

