[Python-ideas] Implementation of shutil.move

David Townshend aquavitae69 at gmail.com
Sun Aug 14 06:06:14 CEST 2011


The behaviour is platform dependant only because it uses os.rename. The
implementation is independent of platform so any change would affect all
platforms. This might not matter if os.link behaves the same across them all
though.

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.
On Aug 13, 2011 7:23 PM, "Masklinn" <masklinn at masklinn.net> wrote:
> On 13 août 2011, at 19:08, MRAB <python at mrabarnett.plus.com> wrote:
>> On 13/08/2011 15:59, David Townshend wrote:
>>> There was a suggestion on the issue tracker that it might be better to
>>> add an optional argument to shutil.move rather than create a new
>>> function. Does anyone have any comments or suggestions about this?
>>>
>> [For reference, it's issue 12741 ("Add function similar to shutil.move
>> that does not overwrite".)]
>>
>> My preference is for adding an optional argument because the difference
>> in behaviour seems too small to justify a different function.
> Likewise, and even more so because the current behaviour is
platform-dependent and dome platforms already behave as proposed, so the
proposal really unifies the behaviour across platforms.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110814/47422f01/attachment.html>


More information about the Python-ideas mailing list