summaryrefslogtreecommitdiffstats
path: root/Lib/urlparse.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-01-06 12:30:53 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-01-06 12:30:53 (GMT)
commitf2128b004c5cac7ae8766329b061867de6fb6093 (patch)
treebf7302e88942f08b083370f8dbda2c8eddc71526 /Lib/urlparse.py
parent077c5823d11f6e11f97d3c1d412a6622d953ec6f (diff)
downloadcpython-f2128b004c5cac7ae8766329b061867de6fb6093.zip
cpython-f2128b004c5cac7ae8766329b061867de6fb6093.tar.gz
cpython-f2128b004c5cac7ae8766329b061867de6fb6093.tar.bz2
Used dictionaries rather than lists for membership testing.
Diffstat (limited to 'Lib/urlparse.py')
-rw-r--r--Lib/urlparse.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/Lib/urlparse.py b/Lib/urlparse.py
index b8f747f..171092e 100644
--- a/Lib/urlparse.py
+++ b/Lib/urlparse.py
@@ -8,26 +8,26 @@ __all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag",
"urlsplit", "urlunsplit"]
# A classification of schemes ('' means apply by default)
-uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'imap', 'wais', 'file',
+uses_relative = dict.fromkeys(['ftp', 'http', 'gopher', 'nntp', 'imap', 'wais', 'file',
'https', 'shttp',
- 'prospero', 'rtsp', 'rtspu', '']
-uses_netloc = ['ftp', 'http', 'gopher', 'nntp', 'telnet', 'imap', 'wais',
+ 'prospero', 'rtsp', 'rtspu', ''])
+uses_netloc = dict.fromkeys(['ftp', 'http', 'gopher', 'nntp', 'telnet', 'imap', 'wais',
'file',
'https', 'shttp', 'snews',
- 'prospero', 'rtsp', 'rtspu', '']
-non_hierarchical = ['gopher', 'hdl', 'mailto', 'news', 'telnet', 'wais',
+ 'prospero', 'rtsp', 'rtspu', ''])
+non_hierarchical = dict.fromkeys(['gopher', 'hdl', 'mailto', 'news', 'telnet', 'wais',
'imap', 'snews', 'sip',
- ]
-uses_params = ['ftp', 'hdl', 'prospero', 'http', 'imap',
+ ])
+uses_params = dict.fromkeys(['ftp', 'hdl', 'prospero', 'http', 'imap',
'https', 'shttp', 'rtsp', 'rtspu', 'sip',
- '']
-uses_query = ['http', 'wais', 'imap',
+ ''])
+uses_query = dict.fromkeys(['http', 'wais', 'imap',
'https', 'shttp',
'gopher', 'rtsp', 'rtspu', 'sip',
- '']
-uses_fragment = ['ftp', 'hdl', 'http', 'gopher', 'news', 'nntp', 'wais',
+ ''])
+uses_fragment = dict.fromkeys(['ftp', 'hdl', 'http', 'gopher', 'news', 'nntp', 'wais',
'https', 'shttp', 'snews',
- 'file', 'prospero', '']
+ 'file', 'prospero', ''])
# Characters valid in scheme names
scheme_chars = ('abcdefghijklmnopqrstuvwxyz'