Udo Eberhardt added the comment:

So this is a trade-off between consistent behavior and efficiency. My point of 
view is that glob is for enumerating matching files and it should consistently 
return the real file names. Typically glob will be called with a pattern like 
'*.txt' and it will have to iterate names anyway, right? In the special case 
that it is called with a literal name it could do the same to produce 
consistent results. A user who wants to check (more efficiently) if a literal 
name exists, can use Path.exists().

The statement in the doc could be: 
Note: To find the literal names in the file system, glob always enumerates 
files and directories. To check more efficiently whether a specific file 
exists, use exists().

----------

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

Reply via email to