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 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.python.org/pipermail/python-dev/attachments/20050607/0d897c63/attachment.pgp
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4