New submission from Alberto Gomez-Casado:

Extracted from issue31154

Both calls lack any kind of return, which leads me to expect after a 
rename/replace the Path instance would be changed to the new path. This is not 
the case (reading the PEP I have seen Path instances are kind of immutable), 
after the call the Path instance keeps "pointing" to the previous (and quite 
likely now useless) path. 

Returning the new path would be a reasonable option. In any case, I think the 
documentation should mention this behavior explicitly.

----------
assignee: docs@python
components: Documentation, Library (Lib)
messages: 300019
nosy: Alberto Gomez-Casado, docs@python, pitrou
priority: normal
severity: normal
status: open
title: Return destination path in Path.rename and Path.replace
type: enhancement
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31163>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to