[issue13287] urllib.request exposes too many names

Florent Xicluna report at bugs.python.org
Fri Oct 28 17:01:15 CEST 2011


New submission from Florent Xicluna <florent.xicluna at gmail.com>:

>>> len(dir())
4
>>> import urllib.request import *
>>> len(dir())
88


In this list we find 14 modules:
['base64', 'collections', 'ssl', 'bisect', 'http', 're', 'email', 'socket', 'os', 'posixpath', 'hashlib', 'io', 'time', 'sys']

And many non-documented functions:
 - ftperrors
 - getproxies_environment
 - getproxies_macosx_sysconf
 - localhost
 - noheaders
 - parse_http_list
 - parse_keqv_list
 - proxy_bypass
 - proxy_bypass_environment
 - proxy_bypass_macosx_sysconf
 - quote
 - randombytes
 - request_host
 - urlunparse
 - splitattr
 - splithost
 - splitpasswd
 - splitport
 - splitquery
 - splittag
 - splittype
 - splituser
 - splitvalue
 - thishost
 - to_bytes
 - unquote
 - unwrap
 - urljoin
 - urlparse
 - urlsplit

It may be good to define __all__ for this module, and to preprend "_" on some of these names.

----------
components: Library (Lib)
messages: 146568
nosy: flox
priority: normal
severity: normal
stage: needs patch
status: open
title: urllib.request exposes too many names
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13287>
_______________________________________


More information about the Python-bugs-list mailing list