[Python-checkins] python/dist/src/Lib urlparse.py,1.36,1.37

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Mon, 06 Jan 2003 04:30:56 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv4016

Modified Files:
	urlparse.py 
Log Message:
Used dictionaries rather than lists for membership testing.


Index: urlparse.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urlparse.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** urlparse.py	6 Jan 2003 06:51:36 -0000	1.36
--- urlparse.py	6 Jan 2003 12:30:53 -0000	1.37
***************
*** 9,32 ****
  
  # A classification of schemes ('' means apply by default)
! uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'imap', 'wais', 'file',
                   'https', 'shttp',
!                  'prospero', 'rtsp', 'rtspu', '']
! uses_netloc = ['ftp', 'http', 'gopher', 'nntp', 'telnet', 'imap', 'wais',
                 'file',
                 'https', 'shttp', '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',
!                '']
! uses_query = ['http', 'wais', 'imap',
                'https', 'shttp',
                'gopher', 'rtsp', 'rtspu', 'sip',
!               '']
! uses_fragment = ['ftp', 'hdl', 'http', 'gopher', 'news', 'nntp', 'wais',
                   'https', 'shttp', 'snews',
!                  'file', 'prospero', '']
  
  # Characters valid in scheme names
--- 9,32 ----
  
  # A classification of schemes ('' means apply by default)
! uses_relative = dict.fromkeys(['ftp', 'http', 'gopher', 'nntp', 'imap', 'wais', 'file',
                   'https', 'shttp',
!                  'prospero', 'rtsp', 'rtspu', ''])
! uses_netloc = dict.fromkeys(['ftp', 'http', 'gopher', 'nntp', 'telnet', 'imap', 'wais',
                 'file',
                 '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',
                 'https', 'shttp', 'rtsp', 'rtspu', 'sip',
!                ''])
! uses_query = dict.fromkeys(['http', 'wais', 'imap',
                'https', 'shttp',
                'gopher', 'rtsp', 'rtspu', 'sip',
!               ''])
! uses_fragment = dict.fromkeys(['ftp', 'hdl', 'http', 'gopher', 'news', 'nntp', 'wais',
                   'https', 'shttp', 'snews',
!                  'file', 'prospero', ''])
  
  # Characters valid in scheme names