On Saturday, November 8, 2014, Xavier Morel <python-dev at masklinn.net> wrote: > > > Why would pathlib need to provide this when tempfile already does? > > with tempfile.NamedTemporaryFile(prefix='') as f: > tmp = pathlib.Path(f.name) > > with tempfile.TemporaryDirectoryDirectory(prefix='') as d: > tmp = pathlib.Path(d.name) > > For the same reason pathlib provides path manipulation functionality while os.path already does: a cohesive and more convenient api. In other words, I want to have less calls and variables around (less room for errors, less visual bloat), and this is such a common pattern it's worth supporting it in pathlib. -- Thanks, -- Ionel M. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20141108/30593dfd/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4