float_len_T480.pyx 322 Bytes
Newer Older
1 2
# ticket: 480

Robert Bradshaw's avatar
Robert Bradshaw committed
3 4 5
def f(x):
    return x

6
def len_f(x):
Robert Bradshaw's avatar
Robert Bradshaw committed
7
    """
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
    >>> len_f([1,2,3])
    3
    """
    return len(f(x))

def float_len_f(x):
    """
    >>> float_len_f([1,2,3])
    3.0
    """
    return float(len(f(x)))

def cast_len_f(x):
    """
    >>> cast_len_f([1,2,3])
Robert Bradshaw's avatar
Robert Bradshaw committed
23 24
    3.0
    """
25
    return <double>len(f(x))