Stephen J. Turnbull wrote:
I don't really understand what Tres is talking about when he writes "modules that expect to be imported this way". The *imported* module shouldn't care, no? This is an issue for the *importing* code to deal with.
I think he's talking about modules that add a prefix to all of their exported names, such as Tkinter starting everything with "Tk", on the expectation that import * will be the normal way of using the module. For very well-known modules with very well-known prefixes, this probably doesn't do too much harm, since it's usually fairly obvious where a given name is coming from. However, it's probably best not encouraged, as it could lead people who don't know better into bad habits. There's also the downside that people who choose *not* to use import *, and instead import the module itself and use qualified references, end up with everything being prefixed twice, e.g. 'import Tkinter as tk' leads to 'tk.TkWhatever' everywhere. On the other hand, when wrapping a C library there's a desire to keep the Python names as close as possible to the C ones, which usually come with prefixes to manage C's totally-global namespace. So there's a bit of a double bind there. -- Greg _______________________________________________ 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