Closed Ondrej-Sulc closed 2 years ago
@Ondrej-Sulc Thanks for the comment! This is intended behavior, in so much as this is the typical behavior of sorting in Python:
>>> sorted(['Zuchini', 'banana', 'apple'])
['Zuchini', 'apple', 'banana']
seedir actually uses natsort, rather than the built-in sorted
, but the ranking of capital/lowercase letters does not change. The intended way to get your desired output is to use sort_key
when calling seedir. I.e.:
seedir.seedir('/your/path', sort_key = lambda x: x.lower())
It's the same idea as doing case-insensitive sorting with sorted
.
Hi, I ran into some sorting issues while using your library today.
While using "sort=True", It sorted the folder "COMPONENTS" before "Compensators" even though it should be the other way around. I fixed it by changing the folder name to "Components". I am guessing it's sorting the uppercase letters before the lowercase ones and it does not matter what's behind them. Is this intended behavior?