On Mon, Jun 06, 2005 at 01:38:36PM -0500, Skip Montanaro wrote: > > > Reinhold> - Flat namespace: Should we tend to a more hierarchic library > Reinhold> (e.g. inet.url, inet.http, inet.nntp)? This would increase > Reinhold> clarity when searching for a module. > > We've talked about this before. The main technical challenge seems to be > backward compatibility. You need to support both flat ("import urllib") and > packaged namespaces ("from www import urllib"), possibly within the same > application. That is, postulating a www package, if I execute > > import urllib > from www.urllib import urlopen > > the module-level code should only be executed once, and > > urlopen == urllib.urlopen > > should evaluate to True.
Can't this be handled with an __init__ module? Create an inet package and having the __init__ module pull whatever it wanted into it's own namespace. It would be nice to then use warnings to show deprecation messages when the old import is used (import url instead of import inet.url), but I don't think that is quite so easy. -- David Stanek www.roninds.net GPG keyID #6272EDAF on http://pgp.mit.edu Key fingerprint = 8BAA 7E11 8856 E148 6833 655A 92E2 3E00 6272 EDAF
pgptKki5DlMrm.pgp
Description: PGP signature
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com