Instantiating sub-class from super

Eryk Sun eryksun at gmail.com
Thu Oct 17 16:27:23 EDT 2019


On 10/17/19, MRAB <python at mrabarnett.plus.com> wrote:
> On 2019-10-17 20:06, Eryk Sun wrote:
>
>> I'm bugged by how the article mis-characterizes the fundamental
>> problem. The operating system has nothing to do with the order of a
>> directory listing, which varies even with an OS, depending on the file
>> system. The latter could store each entry in a tree structure that's
>> sorted by filename, or it could use a mapping with hash values, or it
>> could simply use the first available slot in a list, based on the
>> order of past create and delete operations.
>>
> "The operating system has nothing to do with the order of a directory
> listing"?
>
> Well, that depends on the operating system. It might guarantee the order.

That would be typically provide no benefit and be an unnecessary
expense in the kernel, especially for directories that contain
thousands of entries, considering applications typically need a
particular sort order anyway. Also, while such a system could make
this default order cheap for its own platform-restricted file systems,
supporting other file systems such as NTFS and ext3 would bear the
cost of having to dynamically sort directory listings instead of just
listing the entries as they're naturally stored in the file-system
data structures.



More information about the Python-list mailing list