pylib/uxml/uxpath/functions.py
def number(ctx, seq=None):
    '''
    Yields one float, derived from the first item in the argument sequence (unless empty in which case yield NaN) as follows:

    * If string with optional whitespace followed by an optional minus sign followed by a Number followed by whitespace, converte to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; in case of any other string yield NaN
    * If boolean true yield 1; if boolean false yield 0
    * If a node convert to string as if by a call to string(); yield the same value as if passed that string argument to number()
    '''
    if hasattr(obj, 'compute'):
        obj = next(seq.compute(ctx), '')
    else:
        obj = seq
    yield next(to_number(obj), '')
def number(ctx, seq=None):
    '''
    Yields one float, derived from the first item in the argument sequence (unless empty in which case yield NaN) as follows:

    * If string with optional whitespace followed by an optional minus sign followed by a Number followed by whitespace, converte to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; in case of any other string yield NaN
    * If boolean true yield 1; if boolean false yield 0
    * If a node convert to string as if by a call to string(); yield the same value as if passed that string argument to number()
    '''
    if hasattr(obj, 'compute'):
        obj = next(seq.compute(ctx), '')
    else:
        obj = seq
    yield next(to_number(obj), '')
Yields one float, derived from the first item in the argument sequence (unless empty in which case yield NaN) as follows:

    * If string with optional whitespace followed by an optional minus sign followed by a Number followed by whitespace, converte to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; in case of any other string yield NaN
    * If boolean true yield 1; if boolean false yield 0
    * If a node convert to string as if by a call to string(); yield the same value as if passed that string argument to number()