[issue39682] pathlib.Path objects can be used as context managers

Barney Gale report at bugs.python.org
Tue Mar 3 09:35:33 EST 2020


Barney Gale <barney.gale at gmail.com> added the comment:

Can I ask what sort of backwards-compatibility guarantees Python provides for these cases? In the case of using a Path object as a context manager, I think we can say:

- It's easy to do - there's no need to call any underscore-prefixed methods for example
- It's undocumented
- It's pretty hard to determine existing usage statically - grepping for `with p:` is years of work.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39682>
_______________________________________


More information about the Python-bugs-list mailing list