[Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iterator (original) (raw)
Ethan Furman ethan at stoneleaf.us
Sun Jun 29 19:02:16 CEST 2014
- Previous message: [Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iterator
- Next message: [Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iterator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 06/29/2014 05:28 AM, Nick Coghlan wrote:
So, here's my alternative proposal: add an "ensurelstat" flag to scandir() itself, and don't have any methods on DirEntry, only attributes. That would make the DirEntry attributes: isdir: boolean, always populated isfile: boolean, always populated issymlink boolean, always populated lstatresult: stat result, may be None on POSIX systems if ensurelstat is False (I'm not particularly sold on "lstatresult" as the name, but "lstat" reads as a verb to me, so doesn't sound right as an attribute name)
+1
--
Ethan
- Previous message: [Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iterator
- Next message: [Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iterator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]