[Python-ideas] [Python-Dev] If you shadow a module in the standard library that IDLE depends on, bad things happen
Alexander Walters
tritium-list at sdamon.com
Mon Nov 2 01:54:48 EST 2015
On 11/1/2015 08:53, Laura Creighton wrote:
> In a message of Sun, 01 Nov 2015 08:25:54 -0500, Alexander Walters writes:
>> Honestly, shadowing modules is something that should be solved by
>> renaming modules. If you are worrying about shadowing ONLY the standard
>> library - guess what? those names don't change often, and are well
>> known. Don't use those names.
> The problem is that the sort of people who make these errors don't
> know the names. Knowing that 'turtle.py' is a bad name for 'my
> very first program that does turtle graphics' is a more advanced
> skill than the turtle program writers, or even their teachers, can
> be expected to have.
This is what is called a teachable moment. It is BETTER that python
does nothing to prevent or warn the user. Let them fail, and fail
hard. Its better for them to fail. I see any argument against this as
pure detriment to the user. Wanting these warnings is wanting to
disadvantage the new user - debugging shadowed names is a skill you need
in your toolbox, and this deprives people of that vital early lesson.
More information about the Python-ideas
mailing list