1 """
2 anypy.sets_: sets compatibility module
4 uses the built-in type 'set' if available, and thus avoids
5 deprecation warnings. Simple usage:
7 Change all
8 from sets import Set
9 to
10 from roundup.anypy.sets_ import set
12 and use 'set' instead of 'Set'.
13 To avoid unnecessary imports, you can:
15 try:
16 set
17 except NameError:
18 from roundup.anypy.sets_ import set
20 see:
21 http://docs.python.org/library/sets.html#comparison-to-the-built-in-set-types
23 """
25 try:
26 set = set # built-in since Python 2.4
27 except (NameError, TypeError):
28 from sets import Set as set # deprecated as of Python 2.6
30 # vim: ts=8 sts=4 sw=4 si et