[issue21798] Allow adding Path or str to Path

2014-06-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Indeed, not trying to pretend to act like a string was one of the design points of the pathlib module, and the "/" operator already performs logical path joining. I'm therefore closing this issue as rejected. -- resolution: -> rejected status: open ->

[issue21798] Allow adding Path or str to Path

2014-06-18 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with David. And, it already works, but uses '/', not '+': >>> b / "_name.dat" PosixPath('/tmp/some_base/_name.dat') -1 to using + to be the equivalent of: >>> pathlib.Path(str(b) + "_name.dat") PosixPath('/tmp/some_base_name.dat') -- nosy: +eri

[issue21798] Allow adding Path or str to Path

2014-06-17 Thread R. David Murray
R. David Murray added the comment: I would expect addition to return PosixPath('/tmp/some_base/_name.dat'), (ie: path.join). -- nosy: +pitrou, r.david.murray ___ Python tracker

[issue21798] Allow adding Path or str to Path

2014-06-17 Thread Gerrit Holl
New submission from Gerrit Holl: It would be great if we could "add" either str or Path to Path objects. Currently, we can join paths only by adding a directory, or by replacing the suffix. But sometimes we want to build up a path more directly. With strings we can do that simply by concate