[Python-ideas] Extend the os.stat() result objects with methods like isfile() and isdir()

Andrew Svetlov andrew.svetlov at gmail.com
Fri May 3 00:38:31 CEST 2013


+1

On Thu, May 2, 2013 at 10:07 PM, Paul Moore <p.f.moore at gmail.com> wrote:
>
> 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
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



-- 
Thanks,
Andrew Svetlov



More information about the Python-ideas mailing list