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-June/135238.html below:

[Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iterator

[Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iteratorJonas Wielicki j.wielicki at sotecware.net
Fri Jun 27 12:28:27 CEST 2014
On 27.06.2014 03:50, MRAB wrote:
> On 2014-06-27 02:37, Ben Hoyt wrote:
>> I don't mind iterdir() and would take it :-), but I'll just say why I
>> chose the name scandir() -- though it wasn't my suggestion originally:
>>
>> iterdir() sounds like just an iterator version of listdir(), kinda
>> like keys() and iterkeys() in Python 2. Whereas in actual fact the
>> return values are quite different (DirEntry objects vs strings), and
>> so the name change reflects that difference a little.
>>
> [snip]
> 
> The re module has 'findall', which returns a list of strings, and
> 'finditer', which returns an iterator that yields match objects, so
> there's a precedent. :-)

A bad precedent in my opinion though -- I was just recently bitten by
that, and I find it very untypical for python.

regards,
Jonas
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