[issue36701] module 'urllib' has no attribute 'request'

Brett Cannon report at bugs.python.org
Tue Apr 23 13:08:29 EDT 2019


Brett Cannon <brett at python.org> added the comment:

I'm -1 on pulling `request` up to implicitly be part of the `urllib` namespace without an import. `os.path` is the only exception that I know of in the stdlib and that's historical (it predates packages existing in the language). Otherwise the proposed change is suggesting that we automatically import all submodules to the top of a package which is expensive (as Martin pointed out), and simply not how Python's import is meant to be used.

And the statement that "`request` is part of `urllib`" is true today, just like saying any submodule is part of a package. If that wording is confusing then a PR to tweak the wording could be considered.

Since there are 3 core devs who are against this idea I'm closing this as "not a bug". Thanks for the idea regardless, Piyush!

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36701>
_______________________________________


More information about the Python-bugs-list mailing list