T
Tim Golden
Lawrence said:Want sorted order?
sorted(tuple(the_set))
Not sure why you want the tuple () there, but
you probably knew that...
TJG
Lawrence said:Want sorted order?
sorted(tuple(the_set))
Why not just "sorted(the_set)"?Lawrence said:the_set = set( ... )
if str in the_set :
... "retrieval" case ...
else :
the_set.add(str)
#end if
Want sorted order?
sorted(tuple(the_set))
What could be simpler?
Lawrence said:In message <[email protected]>, João
Valverde wrote:
the_set = set( ... )
if str in the_set :
... "retrieval" case ...
else :
the_set.add(str)
#end if
Want sorted order?
sorted(tuple(the_set))
What could be simpler?
João said:Try putting that inside a loop with thousands of iterations and you'll
see what the problem is.
Lawrence D'Oliveiro said:You could apply the same argument to anything. E.g. why create a tree
structure with a million elements? Try putting that inside a loop with
thousands of iterations and you'll see what the problem is.
João said:Lawrence D'Oliveiro wrote: [...]Want sorted order?
sorted(tuple(the_set))
What could be simpler?
Try putting that inside a loop with thousands of iterations and you'll
see what the problem is.
You could apply the same argument to anything. E.g. why create a tree
structure with a million elements? Try putting that inside a loop with
thousands of iterations and you'll see what the problem is.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.