This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author udo.eberhardt
Recipients paul.moore, pitrou, serhiy.storchaka, steve.dower, tim.golden, udo.eberhardt, zach.ware
Date 2016-03-29.08:02:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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().
Date User Action Args
2016-03-29 08:02:24udo.eberhardtsetrecipients: + udo.eberhardt, paul.moore, pitrou, tim.golden, zach.ware, serhiy.storchaka, steve.dower
2016-03-29 08:02:24udo.eberhardtsetmessageid: <>
2016-03-29 08:02:24udo.eberhardtlinkissue26655 messages
2016-03-29 08:02:23udo.eberhardtcreate