|
Introducing jyset: msg#00038lang.jython.user
Jyset is a module that implements a Set class in Jython that emulates the Set class introduced in CPython 2.3. Note that this is an implementation of Set class -- not BaseSet or ImmutableSet. For more information about the Set class, see the current Python documentation on that module.[1] If you look under the hood you will discover that this is really just a wrapper around java.util.LinkedHashSet It does most of the heavy-lifting. I don't mind standing on the shoulders of giants. Jyset is distributed under the Apache 2.0 license. You can grab jyset here: http://users.binary.net/thehaas/lab/files/jyset.zip Here is a sample of how it works, in case you aren't familiar with Set: s=Set([1,2,3]) Length of s = 3 s1=Set([2,3,4,5]) s.union(s1) = Set([1,2,3,4,5]) s.intersection(s1) = Set([2,3]) s.symmetric_difference(s1) = Set([1,4,5]) s.pop() = 1 [1] http://docs.python.org/lib/module-sets.html [2] http://java.sun.com/j2se/1.4.2/docs/api/java/util/LinkedHashSet.html -- Mike Hostetler http://users.binary.net/thehaas/cgi-haas/blosxom.cgi ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Standard workaround for scripts requiring set working directories?, Chris Wood |
|---|---|
| Next by Date: | Remove Edmacc@xxxxxxx, edmacc |
| Previous by Thread: | Standard workaround for scripts requiring set working directories?, Chris Wood |
| Next by Thread: | Remove Edmacc@xxxxxxx, edmacc |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |