[docs] [issue31163] Return destination path in Path.rename and Path.replace
report at bugs.python.org
Wed Aug 9 11:32:24 EDT 2017
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 at python
components: Documentation, Library (Lib)
nosy: Alberto Gomez-Casado, docs at python, pitrou
title: Return destination path in Path.rename and Path.replace
versions: Python 3.6
Python tracker <report at bugs.python.org>
More information about the docs