From: Peter W. <pw...@en...> - 2007-01-11 15:14:44
|
On Jan 11, 2007, at 12:55 AM, Steve Chaplin wrote: >> I have never run into a problem with relative imports, though I don't >> object to removing them. Why are they bad style and what is the >> danger? > > Its because you can unwittingly end up with module name clashes. There > can be two different modules in two different directories with the > same > name and you import the wrong module by mistake. Just wanted to chime in here -- with python 2.5, you can have your cake and eat it too: from .localpkg import Symbol1, Symbol2 from . import localpkg This disambiguates the "calendar.py" problem that you had (and that about 90% of python coders have had at least once in their lives). :) -Peter |