Code

- add a small word-splitting test for the indexers when answering an
[roundup.git] / roundup / anypy / README.txt
1 roundup.anypy package - Python version compatibility layer
2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 Roundup currently supports Python 2.3 to 2.6; however, some modules
5 have been introduced, while others have been deprecated.  The modules
6 in this package provide the functionalities which are used by Roundup
8 - adapting the most recent Python usage
9 - using new built-in functionality
10 - avoiding deprecation warnings
12 Use the modules in this package to preserve Roundup's compatibility.
14 sets_: sets compatibility module
15 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17 Since Python 2.4, there is a built-in type 'set'; therefore, the 'sets'
18 module is deprecated since version 2.6.  As far as Roundup is concerned,
19 the usage is identical; see 
20 http://docs.python.org/library/sets.html#comparison-to-the-built-in-set-types
22 Uses the built-in type 'set' if available, and thus avoids
23 deprecation warnings. Simple usage:
25 Change all::
26   from sets import Set
28 to::
29   from roundup.anypy.sets_ import set
31 and use 'set' instead of 'Set' (or sets.Set, respectively).
32 To avoid unnecessary imports, you can::
34   try:
35       set
36   except NameError:
37       from roundup.anypy.sets_ import set
39 hashlib_: md5/sha/hashlib compatibility
40 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42 The md5 and sha modules are deprecated since Python 2.6; the hashlib
43 module, introduced with Python 2.5, is recommended instead.
45 Change all::
46   import md5
47   md5.md5(), md5.new()
48   import sha
49   sha.sha(), sha.new()
51 to::
52   from roundup.anypy.hashlib_ import md5
53   md5()
54   from roundup.anypy.hashlib_ import sha1
55   sha1()
57 # vim: si