diff options
author | Guido van Rossum <guido@python.org> | 1992-10-18 17:09:59 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-10-18 17:09:59 (GMT) |
commit | 2db91358def94cf8081f27b736988320d14eba39 (patch) | |
tree | f73562d6cfd16adf8723bbe702be55d13e2122f5 /Lib/stringold.py | |
parent | 0cb8e8cfc09dd0919882da968c3e95bf070e257d (diff) | |
download | cpython-2db91358def94cf8081f27b736988320d14eba39.zip cpython-2db91358def94cf8081f27b736988320d14eba39.tar.gz cpython-2db91358def94cf8081f27b736988320d14eba39.tar.bz2 |
Misc changes and new modules. whrandom is "objectified". SOCKET.py
is moved to the sgi subdirectory.
Diffstat (limited to 'Lib/stringold.py')
-rw-r--r-- | Lib/stringold.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/stringold.py b/Lib/stringold.py index 6386a95..cc60678 100644 --- a/Lib/stringold.py +++ b/Lib/stringold.py @@ -163,3 +163,15 @@ def expandtabs(s, tabsize): res = res + line line = '' return res + line + + +# Try importing optional built-in module "strop" -- if it exists, +# it redefines some string operations that are 100-1000 times faster. +# The manipulation with index_error is needed for compatibility. + +try: + from strop import * + from strop import index + index_error = ValueError +except ImportError: + pass # Use the original, slow versions |