Hi David.  Thanks for the quick reply :)

> def get_partitions(x, y=None):
>         if y is None:
>                 y = []
>         [... other stuff ...]

It works!  I guess I'm still learning the intricacies of Python.  All
I had to do was the changes you suggested and then make sure to change
the recursive calls explicitly define 'y'.  Here it is:

def get_partitions(x,y=None):
    """
    Gets the list of the input argument and all the
    partitions that follow it lexicographically.
    See Partition.next().
    """

    if y == None:
        y = []
    if type(x) is Integer:
        return get_partitions([x],y)
    y.append(x)
    x = Partition(x).next()
    if x != False:
        return get_partitions(x,y)
    return y
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to