On 10/27/07, David Joyner <[EMAIL PROTECTED]> wrote: > Is the following a feature or a bug? > > sage: set([1,2]) > set([1, 2]) > sage: set([[1],[2]]) > --------------------------------------------------------------------------- > <type 'exceptions.TypeError'> Traceback (most recent call last) > > /Users/wdj/sagefiles/sage-2.8.2/<ipython console> in <module>() > > <type 'exceptions.TypeError'>: list objects are unhashable > > (Set also does this).
Elements of Python sets must be immutable. I wouldn't call it either a feature or a bug. Perhaps it's a defficiency, though sets of lists would be very inefficient in Python, if they were limited. Anyway, you should use tuples instead of lists if you want sets of them. -- William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] 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/ -~----------~----~----~----~------~----~------~--~---
