[Python-ideas] Implementation of shutil.move

Terry Reedy tjreedy at udel.edu
Sun Aug 14 07:06:42 CEST 2011


On 8/14/2011 12:06 AM, David Townshend wrote:

> Initially I thought it would be better to use an argument, but having
> had a look at the code I'm not so sure any more, since it could end up
> as two different implementations in the same function. Also, I'm not so
> sure its a good idea to have an optional argument (never_overwrite) that
> defaults to False for backward compatibility, but should usually be set
> to True for safe behaviour.

The new 4th parameter for difflib.SequenceMatcher is much like that. For 
me the issue is whether the code look like

if param:
     do algorithm a
else:
     do algorithm b

versus

code
           if param: something
           else: something else
more code

-- 
Terry Jan Reedy




More information about the Python-ideas mailing list