Révision 159 pobysoPythonSage/src/sageSLZ/sageRationalOperations.sage

sageRationalOperations.sage (revision 159)
20 20
    except Exception:
21 21
        print "denominators:", rationalList, \
22 22
                "does not understand the len() function."
23
        return([])
23
        return []
24 24
    if listLength == 0:
25
        return([])
25
        return []
26 26
    if listLength == 1:
27 27
        try:
28 28
            return([QQ(rationalList[0]).denominator()])
29 29
        except Exception:
30 30
            print "denominators:", rationalList[0], \
31 31
                    "has no \"denominator()\" member." 
32
            return([])
32
            return []
33 33
    denominatorsList = []    
34 34
    for i in xrange(listLength):
35 35
        try:
......
37 37
        except Exception:
38 38
            print "denominators:", rationalList[i], \
39 39
                    "has no \"denominator()\" member." 
40
            return([])
40
            return []
41 41
    return(denominatorsList)
42 42
# End sro_denominators
43 43

  
......
81 81
    except Exception:
82 82
        print "numerators:", rationalList, \
83 83
                "does not understand the len() function."
84
        return([])
84
        return []
85 85
    if listLength == 0:
86
        return([])
86
        return [] 
87 87
    if listLength == 1:
88 88
        try:
89 89
            return(QQ(rationalList[0]).numerator())
90 90
        except Exception:
91 91
            print "denominators:", rationalList[0], \
92 92
                    "has no \"numerator()\" member." 
93
            return([])
93
            return [] 
94 94
    numeratorsList = []    
95 95
    for i in xrange(listLength):
96 96
        try:
......
98 98
        except Exception:
99 99
            print "numerators:", rationalList[i], \
100 100
                    "has no \"numerator()\" member." 
101
            return([])
102
    return(numeratorsList)
101
            return [] 
102
    return numeratorsList
103 103
# End sro_numerators
104 104

  
105 105
print "\t...sageRationalOperations loaded"

Formats disponibles : Unified diff