Rémi Lapeyre <remi.lape...@henki.fr> added the comment:

> Decorating __new__ with lru_cache would likely run into memory leakage 
> problems?

I think the LRU cache would be for returning the same instance when called with 
the same string. I don't think it would be needed to return the same instance 
when called with a Path instance.

> From a quick look it appears to only be settable by using the path (not the 
> actual file) as a context manager, and only serves to block further 
> filesystem methods, but I'm not even sure why?

This came up in bpo-39682 recently, I'm not sure what this flag is supposed to 
mean and I could not find it in the documentation.

Since it's uncorrelated to the file object and the physical file, I think it 
may actually be dangerous to rely on this flag. I don't know why is the purpose 
of using Path as a context manager.

----------

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

Reply via email to