On 26.02.17 15:39, Vamsi Krishna Avula wrote:
This is somewhere between a question and a proposal. I'm just trying to 
understand why Path objects use an explicit iterdir method.
Why not make them iterable?

Because this is ambiguous. Iterating can mean many different things:

1. Iterate characters of string representation of the path (str(path)).

2. Iterate path components (path.parts).

3. Open a file and iterate its lines (path.open()).

4. Iterate files in the directory (path.iterdir()).


_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to