On 2016-03-03 16:29, Oscar Benjamin wrote: > On 3 March 2016 at 11:48, Tim Chase <python.l...@tim.thechases.com> > wrote: > > On 2016-03-03 10:43, Nick Sarbicki wrote: > >> The number of times I've had to correct a student for naming > >> their script "turtle.py". > >> > >> And the number of times I've caught myself doing it... > > > > I'm surprised at the number of times I find myself creating an > > "email.py" DESPITE KNOWING BETTER EVERY SINGLE TIME. > > This mistake is too easy to make and should be fixed in the language > somehow. There's no way that a novice user can know which module > names are implicitly "reserved" by being used somewhere in the > stdlib or the collection of 3rd party modules that they may happen > to have installed.
I think that relative imports should ameliorate this, as I usually hit it when I'm using smtplib which in turn imports "email" (and, in 2.x when it found my local email.py would crash and burn). If it used a relative import that forced it to find the one in the stdlib, it should(?) prevent it from finding my local version first. -tkc -- https://mail.python.org/mailman/listinfo/python-list