TheSaint wrote: > I've stumble to find a solution to get a list from a set > > <code> > >>>> aa= ['a','b','c','f'] >>>> aa > ['a', 'b', 'c', 'f'] >>>> set(aa)
To clarify: this creates a new object, so aa is still a list. > {'a', 'c', 'b', 'f'} >>>> [k for k in aa] > ['a', 'b', 'c', 'f'] So you are actually converting a list to a (new) list here. Of course it would have worked with a set or an arbitrary iterable, too. > </code> > I repute the comprehension list too expensive, is there another method? mylist = list(myset) Do you notice the similarity to converting a list to a set? -- http://mail.python.org/mailman/listinfo/python-list