
June 29, 2014
5:02 p.m.
On 06/29/2014 05:28 AM, Nick Coghlan wrote:
So, here's my alternative proposal: add an "ensure_lstat" flag to scandir() itself, and don't have *any* methods on DirEntry, only attributes.
That would make the DirEntry attributes:
is_dir: boolean, always populated is_file: boolean, always populated is_symlink boolean, always populated lstat_result: stat result, may be None on POSIX systems if ensure_lstat is False
(I'm not particularly sold on "lstat_result" as the name, but "lstat" reads as a verb to me, so doesn't sound right as an attribute name)
+1 -- ~Ethan~