On Wed, May 6, 2009 at 1:32 PM, Tres Seaver <tsea...@palladion.com> wrote:
> > I'd be tempted to call this an edge-case. You should be able to expose > > the internal detail you'd need via a module scope alias for the > > particular case. That seems easier than providing a whole new notion. > > I'm actually a big fan of the ':', because it makes explicit the > difference between the "import" and the "named thing", even for > module-scoped names. > Yeah, I also like it primarily for clarity. Also you can provide better error messages when it fails, matching up the error against the intention. In some contexts I also extend this syntax to do something like: module, path = name.split(':', 1) obj = eval(path, load_module(module).__dict__) I don't propose that we do eval for plugins, but it's a nice side-effect of the syntax that it's possible to add in other contexts. Also I don't think there's any strong precedence for purely dot notation, loading objects from strings is something that's always done ad hoc, and the only widely used library I know of that people use for this is Setuptools (indirectly through entry points). -- Ian Bicking | http://blog.ianbicking.org
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig