This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Walter Szeliga
Recipients Walter Szeliga
Date 2017-02-03.00:04:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1486080253.05.0.537199940287.issue29425@psf.upfronthosting.co.za>
In-reply-to
Content
Methods on pathlib.PosixPath() and other objects that alter files on the file system should return new object instances with new information. For example, if there exists a file on the system called 'bar', then

bar_var = pathlib.PosixPath('bar')
bar_var.rename('foo')

will rename the file 'bar' to 'foo' on the system and leave 'bar' as a still-valid object that no longer points to a system file. Changing the return type of .rename() to return a new pathlib.PosixPath() object with path 'foo' could help reduce confusion about the behavior. For example:

bar_var = pathlib.PosixPath('bar')
foo_var = bar_var.rename('foo')

and foo_var would then be a pathlib.PosixPath() object pointing to 'foo'.
History
Date User Action Args
2017-02-03 00:04:13Walter Szeligasetrecipients: + Walter Szeliga
2017-02-03 00:04:13Walter Szeligasetmessageid: <1486080253.05.0.537199940287.issue29425@psf.upfronthosting.co.za>
2017-02-03 00:04:13Walter Szeligalinkissue29425 messages
2017-02-03 00:04:12Walter Szeligacreate