Skip to content

Comment on Perl6: Unary Sortparent

Comments

You can also pass in the method from the str type:

    key=str.lower
It will be faster, but it will break on elements that aren't strings (which could be good or bad).

Then you can use

  key=operator.methodcaller("lower")
and handle any type.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.