3 ms·
"... list(set(['1', '2', '3', '1'])) ..." Nice earle. That's what I've come to expect from python. There is always a shorter better way. The only difference I'
by bootload 19y ago
"... list(set(['1', '2', '3', '1'])) ..."
Nice earle. That's what I've come to expect from python. There is always a shorter better way. The only difference I've found is the returned list is sorted & broke my test suite.
Here's the docs & PEP.
- http://docs.python.org/lib/module-sets.html http://docs.python.org/lib/module-sets.html
- http://www.python.org/dev/peps/pep-0218/ http://www.python.org/dev/peps/pep-0218/
Thx @Tipjoy for posting this or I'd still be using a 4-6 line clunker.