Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
There was a similar (closed) issue about making Path an iterable. The problem with both these related ideas is that they are ambiguous. Does it means that a directory contains a specified file, or that a path contains a specified path component, or that a specified path is a prefix of other path? There are third-party pathlib-like implementations that make Path a str subclass. They have both __iter__ and __contains__ inherited from str, but with different meaning. I'm -1. It is better to write explicitly what you mean than allow the computer to guess. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33301> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com