Message262593
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:24 | udo.eberhardt | set | recipients:
+ udo.eberhardt, paul.moore, pitrou, tim.golden, zach.ware, serhiy.storchaka, steve.dower |
2016-03-29 08:02:24 | udo.eberhardt | set | messageid: <1459238544.27.0.825805273603.issue26655@psf.upfronthosting.co.za> |
2016-03-29 08:02:24 | udo.eberhardt | link | issue26655 messages |
2016-03-29 08:02:23 | udo.eberhardt | create | |
|