summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-01-07 02:09:16 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-01-07 02:09:16 (GMT)
commitef30dc872b895245b24aae85e808638a928d14f1 (patch)
tree64d8514fb816d2e5dc99c84ec73a888e27b2841e
parent625812f6184438d33ac0f2d70ab1276691a30162 (diff)
downloadcpython-ef30dc872b895245b24aae85e808638a928d14f1.zip
cpython-ef30dc872b895245b24aae85e808638a928d14f1.tar.gz
cpython-ef30dc872b895245b24aae85e808638a928d14f1.tar.bz2
Revert change 1.37.
The nanoseconds saved by using dict.fromkeys aren't worth the loss in clarity. Linear searches live on.
-rw-r--r--Lib/urlparse.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/Lib/urlparse.py b/Lib/urlparse.py
index 0106469..9681c7c 100644
--- a/Lib/urlparse.py
+++ b/Lib/urlparse.py
@@ -8,22 +8,22 @@ __all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag",
"urlsplit", "urlunsplit"]
# A classification of schemes ('' means apply by default)
-uses_relative = dict.fromkeys(['ftp', 'http', 'gopher', 'nntp', 'imap',
+uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'imap',
'wais', 'file', 'https', 'shttp', 'mms',
- 'prospero', 'rtsp', 'rtspu', ''])
-uses_netloc = dict.fromkeys(['ftp', 'http', 'gopher', 'nntp', 'telnet',
+ 'prospero', 'rtsp', 'rtspu', '']
+uses_netloc = ['ftp', 'http', 'gopher', 'nntp', 'telnet',
'imap', 'wais', 'file', 'mms', 'https', 'shttp',
- 'snews', 'prospero', 'rtsp', 'rtspu', ''])
-non_hierarchical = dict.fromkeys(['gopher', 'hdl', 'mailto', 'news',
- 'telnet', 'wais', 'imap', 'snews', 'sip'])
-uses_params = dict.fromkeys(['ftp', 'hdl', 'prospero', 'http', 'imap',
+ 'snews', 'prospero', 'rtsp', 'rtspu', '']
+non_hierarchical = ['gopher', 'hdl', 'mailto', 'news',
+ 'telnet', 'wais', 'imap', 'snews', 'sip']
+uses_params = ['ftp', 'hdl', 'prospero', 'http', 'imap',
'https', 'shttp', 'rtsp', 'rtspu', 'sip',
- 'mms', ''])
-uses_query = dict.fromkeys(['http', 'wais', 'imap', 'https', 'shttp', 'mms',
- 'gopher', 'rtsp', 'rtspu', 'sip', ''])
-uses_fragment = dict.fromkeys(['ftp', 'hdl', 'http', 'gopher', 'news',
+ 'mms', '']
+uses_query = ['http', 'wais', 'imap', 'https', 'shttp', 'mms',
+ 'gopher', 'rtsp', 'rtspu', 'sip', '']
+uses_fragment = ['ftp', 'hdl', 'http', 'gopher', 'news',
'nntp', 'wais', 'https', 'shttp', 'snews',
- 'file', 'prospero', ''])
+ 'file', 'prospero', '']
# Characters valid in scheme names
scheme_chars = ('abcdefghijklmnopqrstuvwxyz'