[Python-ideas] PEP: Extended stat_result (First Draft)

Pieter Nagel pieter at nagel.co.za
Mon May 6 21:46:59 CEST 2013


On Mon, 2013-05-06 at 15:32 -0400, random832 at fastmail.us wrote:

> Also,
> they silently fail (i.e. return False) rather than let exceptions be
> raised from stat

I think this is actually good design. It makes total sense to me that
os.path.isfile('/nonexistent') return False. Of course it isn't a file,
since it doesn't exist. It's not a directory, symlink.. either, for the
same reason.

It would be most inconvenient if one needed to guard os.path.isfile()
with a os.path.exists() first.

-- 
Pieter Nagel





More information about the Python-ideas mailing list