This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author benhoyt
Recipients benhoyt, docs@python, gvanrossum, serhiy.storchaka, vstinner
Date 2016-01-31.16:43:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454258622.6.0.285150622743.issue26248@psf.upfronthosting.co.za>
In-reply-to
Content
Per Guido's comment about DirEntry documentation on Issue 26032, especially http://bugs.python.org/issue26032#msg257665, it'd be good to improve the docs of the scandir DirEntry methods with regard to symlinks and caching.

Attaching my stab at a documentation fix. Changes here are:

1) Clarify that the return values of is_dir()/is_file()/etc are cached separately for follow_symlinks True and False.
2) Be more specific about when the functions require a system call, and how it relates to caching and follow_symlinks.
3) DRY up common stuff between is_dir and is_file by saying "Caching, system calls made, and exceptions raised are as per is_dir" in is_file.
4) Tweak to the first paragraph of docs for is_dir/is_file to simplify: assume the follow_symlinks=True default, then note the follow_symlinks=False non-default case after.

I think they're all improvements, though I'm not sure about #3. Is it better to just repeat those couple of paragraphs verbatim?

I'm also not 100% sure about mentioning the DT_UNKNOWN thing. But you really can't get more specific about when system calls are required on Unix without mentioning it.
History
Date User Action Args
2016-01-31 16:43:42benhoytsetrecipients: + benhoyt, gvanrossum, vstinner, docs@python, serhiy.storchaka
2016-01-31 16:43:42benhoytsetmessageid: <1454258622.6.0.285150622743.issue26248@psf.upfronthosting.co.za>
2016-01-31 16:43:42benhoytlinkissue26248 messages
2016-01-31 16:43:41benhoytcreate