[stdlib-sig] the "py" prefix
Brett Cannon
brett at python.org
Fri Apr 11 20:41:23 CEST 2008
On Fri, Apr 11, 2008 at 9:50 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
>
> With the stricter distinction between absolute and relative imports,
> isn't all this discussion a bit obsolete ?
>
> If you want to import the builtin "types" module:
> import types
> If you want to import the local "types" module:
> from . import types
>
> I don't see the need for a "py" prefix.
But what if you want to install a third-party library that is named
'types'? ``import types`` will import either from the stdlib or the
third-party library based on sys.path. The thinking for the top-level
'py' namespace is that this situation becomes (basically) impossible.
-Brett
More information about the stdlib-sig
mailing list