Show More
@@ -224,13 +224,7 b' def binary(s):' | |||||
224 |
|
224 | |||
225 | def unique(g): |
|
225 | def unique(g): | |
226 | """return the uniq elements of iterable g""" |
|
226 | """return the uniq elements of iterable g""" | |
227 | seen = {} |
|
227 | return dict.fromkeys(g).keys() | |
228 | l = [] |
|
|||
229 | for f in g: |
|
|||
230 | if f not in seen: |
|
|||
231 | seen[f] = 1 |
|
|||
232 | l.append(f) |
|
|||
233 | return l |
|
|||
234 |
|
228 | |||
235 | class Abort(Exception): |
|
229 | class Abort(Exception): | |
236 | """Raised if a command needs to print an error and exit.""" |
|
230 | """Raised if a command needs to print an error and exit.""" |
General Comments 0
You need to be logged in to leave comments.
Login now