On Fri, Apr 19, 2019 at 09:49:54PM +0200, Sebastian M. Ernst wrote: > Hi everyone, > > many methods in `os` have a `dir_fd` parameter, for instance `unlink` [1]: > ```python > os.unlink(path, *, dir_fd=None) > ``` > > The `dir_fd` parameter [2] allows it to describe paths relative to > directory descriptors. Otherwise, relative paths are relative to the > current working directory. > > The implementation of `truncate` in `os` does not have this parameter [3]: > ```python > os.truncate(path, length) > ```
[...] > Why not add a convenience function or wrapper like above to the `os` > module, which closes this gap and is more consistent with other methods? I haven't seen any responses to your proposal, perhaps I missed something. The os module is supposed to be a thin wrapper around the os functionality, but your wrapper seems thin enough that I think it could and should just go into the os.truncate function itself, rather than adding a new function. -- Steven _______________________________________________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
