[Python-ideas] Policy for altering sys.path

Terry Reedy tjreedy at udel.edu
Thu May 7 18:11:08 CEST 2015


On 5/7/2015 4:31 AM, Paul Moore wrote:

> Generally, I would say that applications have every right to alter
> sys.path to suit their needs. Libraries (typically) shouldn't alter
> sys.path - in particular on import - without that being part of the
> documented API.

I agree.  Altering sys.path is an instance of monkeypatching, as is 
altering sys.std*.  Libraries that automatically do either on import 
limit their usefulness and should document their behavior.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list