A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-July/135434.html below:

[Python-Dev] Updates to PEP 471, the os.scandir() proposal

[Python-Dev] Updates to PEP 471, the os.scandir() proposalEthan Furman ethan at stoneleaf.us
Thu Jul 10 01:26:01 CEST 2014
On 07/09/2014 04:22 PM, MRAB wrote:
> On 2014-07-09 23:50, Ethan Furman wrote:
>>
>> Okay, marry the two ideas together:
>>
>>     scandir(path, info=None, onerror=None)
>>         """
>>         Return a generator that returns one directory entry at a time in a DirEntry object
>
> Should that be "that yields one directory entry at a time"?

Yes, thanks.

>>         info:  None --> DirEntries will have whatever attributes the O/S provides
>>                'type'  --> DirEntries will already have at least the file/dir distinction
>>                'stat'  --> DirEntries will also already have stat information
>>         """
>>
>>     DirEntry.is_dir()
>>        Return True if this is a directory-type entry; may call os.lstat if the cache is empty.
>>
>>     DirEntry.is_file()
>>        Return True if this is a file-type entry; may call os.lstat if the cache is empty.
>>
>>     DirEntry.is_symlink()
>>        Return True if this is a symbolic link; may call os.lstat if the cache is empty.
>>
>>     DirEntry.stat
>>        Return the stat info for this link; may call os.lstat if the cache is empty.
>
> Why is "is_dir", et al, functions, but "stat" not a function?

Good point.  Make stat a function as well.

--
~Ethan~
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4