Ticket #6542: trac_6542_tachyon_tostr.2.patch

File trac_6542_tachyon_tostr.2.patch, 830 bytes (added by mhampton, 13 years ago)

new version with doctest

  • sage/plot/plot3d/tachyon.py

    # HG changeset patch
    # User Marshall Hampton <hamptonio@gmail.com>
    # Date 1247774553 18000
    # Node ID b57497f7f18ca580da288e7120bad372c132e91b
    # Parent  ca1f31d6f6bf7b1f8da0cb8973c838ab19921c29
    Tachyon tostr fix for 4.1, trac 6542.
    
    diff -r ca1f31d6f6bf -r b57497f7f18c sage/plot/plot3d/tachyon.py
    a b  
    986986        return False
    987987
    988988def tostr(s):
     989    """
     990    Converts vector information to a space-seperated string.
     991
     992    EXAMPLES::
     993
     994        sage: from sage.plot.plot3d.tachyon import tostr
     995        sage: tostr((1,1,1))
     996        ' 1.0 1.0 1.0 '
     997        sage: tostr('2 3 2')
     998        '2 3 2'
     999    """
    9891000    if isinstance(s, str):
    9901001        return s
     1002    return ' %s %s %s '%(float(s[0]), float(s[1]), float(s[2]))