[Python-Dev] If you shadow a module in the standard library that IDLE depends on, bad things happen

Paul Moore p.f.moore at gmail.com
Thu Oct 29 15:13:08 EDT 2015

On 29 October 2015 at 18:46, Laura Creighton <lac at openend.se> wrote:
> In a message of Thu, 29 Oct 2015 18:27:59 +0000, Paul Moore writes:
>>The idle issues seem to me to demonstrate that shadowing the stdlib is
>>a bad idea. Of course, consenting adults, and if you override you're
>>responsible for correctly replacing the functionality, and all that,
>>but honestly, I don't think it needs to be *easy* to shadow the stdlib
>>- there's nothing wrong with it being an "advanced" technique that
>>people have to understand in order to use.
> I am actually sick of the 'consenting adults' argument.
> I am dealing with '11 year old children trying to write their
> first, third and tenth python programs'.  For the life of me
> I cannot see how convenience for the sort of person who has a
> legitimate reason to shadow the syslib should get a higher priority
> over these mites who are doing their damndest to write python
> despite natural language barriers  and the fact that their peers
> and parents think they are nuts to want to do so.

That's actually a very good point, and I agree totally. To my mind,
the point about "consenting adults" (and when I referred to that I was
anticipating others using that argument, not proposing it myself) is
that we don't *prevent* people from doing weird and wonderful things.
But conversely, it's not a reason for making it *easy* to do such
things. Quite the opposite - a "consenting adult" should be assumed to
be capable of writing an import hook, or manipulating sys.path, or


More information about the Python-Dev mailing list