Does this mean people aren't going to move from shell scripting to other languages? No, it just means the task is particularly suited to scripting like this, and Python has affordances for scripting.
The only difference is I sort before uniquing, but the python code uniques before sorting. But the result is identical (and in shell scripting, you can't unique without sorting first).
Although FWIW I just checked and the `sort` tool actually has a flag for uniquing during the sort. I don't know if that's portable though.
You need the -f flag to sort as well to ignore case during the sorting. I don't know how portable the flags to sort are though which is why I didn't bother using them.