Programming

2 thoughts
last posted Oct. 21, 2014, 1:29 a.m.

1 earlier thought

0

Python Dynamic Type System idea

@constrain(name=str, value=int_between_0_and_100)
def foo(name, value):
    pass


def foo(name, value):
    """    
    Where:
        - name (unicode)
        - value (int): > 0, < 100
    """

@alt(foo)
def foo(name, coef):
    """
    Where:
        - name (str)
        - value (float): > 0
    """