PyWart: "Python's import statement and the history of external dependencies"

Tim Chase python.list at tim.thechases.com
Sat Nov 22 20:33:30 EST 2014


On 2014-11-23 12:00, Steven D'Aprano wrote:
> >> > And after all that, it would still fail if you happened to
> >> > want to import both "calendar" modules into the same module.  
> >> 
> >> __path__ = []
> >> import calendar
> >> __path__ = ['my/python/modules']
> >> import calendar as mycalendar  
> > 
> > Hrm.  Never knew this.  Could you point me at some docs on that?
> > (searching for "__path__" on python.org isn't turning up much that
> > jumps out at me as being correlated)  
> 
> You've misunderstood what I said, I was proposing it as a
> hypothetical feature, not something existing. Sorry for any
> confusion.

Ah, thanks.  I wondered but should have tried it out to see that it
wasn't an existing feature.  I'm not sure if/when I would use such a
feature, but it was at least an interesting idea.

-tkc





More information about the Python-list mailing list