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

Laura Creighton lac at openend.se
Sun Nov 1 03:08:36 EST 2015


In a message of Sun, 01 Nov 2015 18:58:36 +1100, Chris Angelico writes:
>sys.path = ['/usr/local/lib/python36.zip', '/usr/local/lib/python3.6',
>'/usr/local/lib/python3.6/plat-linux',
>'/usr/local/lib/python3.6/lib-dynload', '',
>'/home/rosuav/.local/lib/python3.6/site-packages',
>'/usr/local/lib/python3.6/site-packages']
>
>Equivalently, for the system Python:
>
>sys.path = ['/usr/lib/python3.4',
>'/usr/lib/python3.4/plat-x86_64-linux-gnu',
>'/usr/lib/python3.4/lib-dynload', '',
>'/usr/local/lib/python3.4/dist-packages',
>'/usr/lib/python3/dist-packages']
>
>
>So the current directory is after everything that's logically the
>standard library, but before things that would be installed separately
>(site-packages, dist-packages, etc). It'd no longer be possible to
>shadow wave.py, but you could shadow sqlalchemy.py.
>
>ChrisA

But the kid who just wrote string.py or turtle.py will still have
the 'why isn't this working at all?' experience instead of something
that warns her what her problem is.

Laura


More information about the Python-ideas mailing list