[Python-ideas] Extend the os.stat() result objects with methods like isfile() and isdir()
Paul Moore
p.f.moore at gmail.com
Thu May 2 21:07:28 CEST 2013
On 2 May 2013 17:49, Pieter Nagel <pieter at nagel.co.za> wrote:
> I propose adding methods like isfile(), isdir(), islink(), isfifo() and
> so on - basically everything that would currently be done via code like
> "stat.S_ISREG(s.st_mode)".
>
> Please indicate support or not, so I can know whether to draft a PEP and
> work on implementation.
>
+1 for all the reasons you mention. I would never think of using
stat.S_ISREG(s.st_mode) - it looks too low level. But s.isfile() looks
completely obvious.
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130502/003176d6/attachment.html>
More information about the Python-ideas
mailing list