(inp, leading_space, type_sign)
Convert BASIC number to Python bytes representation.
Convert BASIC number to Python bytes representation.
Convert BASIC number to Python bytes representation .
def to_repr(inp, leading_space, type_sign):
    """Convert BASIC number to Python bytes representation."""
    # PRINT, STR$ - yes leading space, no type sign
    # WRITE - no leading space, no type sign
    # LIST - no loading space, yes type sign
    if isinstance(inp, numbers.Number):
        return inp.to_str(leading_space, type_sign)
    elif isinstance(inp, strings.String):
        raise error.BASICError(error.TYPE_MISMATCH)
    raise TypeError('%s is not of class Value' % type(inp))
def to_repr ( inp , leading_space , type_sign ) : # PRINT, STR$ - yes leading space, no type sign # WRITE - no leading space, no type sign # LIST - no loading space, yes type sign if isinstance ( inp , numbers . Number ) : return inp . to_str ( leading_space , type_sign ) elif isinstance ( inp , strings . String ) : raise error . BASICError ( error . TYPE_MISMATCH ) raise TypeError ( '%s is not of class Value' % type ( inp ) )