New submission from Patrick Reader <pxe...@protonmail.com>:

It would be nice to have a `.path` method or property on 
`tempfile.NamedTemporaryFile`, `tempfile.TemporaryDirectory` which produces a 
`pathlib.Path` of their `.name` attribute, so one can use the modern interface 
directly.

I think a method would be more appropriate than a property because you're 
explicitly allocating a new object (unless you use `@functools.cached_property` 
or similar to have a shared object between successive calls)

I can do a PR.

----------
components: Library (Lib)
messages: 388540
nosy: pxeger
priority: normal
severity: normal
status: open
title: Add .path method/property to tempfile.* for a pathlib.Path
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43480>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to