On Tuesday, March 26, 2013 12:33:54 PM UTC-4, Jerry Hill wrote: > On Mon, Mar 25, 2013 at 11:49 PM, rocky wrote: > > >> On Sun, 24 Mar 2013 18:12:49 -0500, Fabian von Romberg wrote: > > >> > I have a package name collections and inside of my package I want to > > > > > I find this kind of thing sad: it feels to me that programmers are working > > around somewhat arbitrary and changing restrictions. Rather than avoid > > names like "collections", why not try to address the underlying problem? > > There isn't an ambiguity here in my view: the fullname is > > mypackage.collections > > > > You've said a couple of times now that the original author has a > > package named "mypackage" with a module "collections" in it. As far > > as I can tell, that's untrue. The original post claims to have a > > package named "collections", which is colliding with the builtin > > module of the same name. > > > > As far as I can tell, all of your suggestions about using your > > pyimport-relative tool aren't helpful unless the author re-names his > > package from "collections" to "mypackage" and then moves all of their > > code into a "collections" module inside "mypackage", right?
Right. Perhaps then I misunderstand. Having a package called "collections" when there is something out there already called "collections" clearly ill advised. But in that case, using sys.path to get around this is still a bad idea: the clash should be fixed. Sure, only in the case that this really can't be addressed would I use sys.path. > > > > -- > > Jerry -- http://mail.python.org/mailman/listinfo/python-list