MCPcopy Create free account
hub / github.com/Lauriat/funct / sortBy

Method sortBy

funct/Array.py:672–681  ·  view source on GitHub ↗

Sorts this Array according to a function defining the sorting criteria.

(self, l, reverse=False, inplace=False)

Source from the content-addressed store, hash-verified

670 return min(self, key=l)
671
672 def sortBy(self, l, reverse=False, inplace=False):
673 """
674 Sorts this Array according to a function
675 defining the sorting criteria.
676 """
677 if inplace:
678 self.__validate_bool_arg(inplace, "inplace")
679 super().sort(key=l, reverse=reverse)
680 return self
681 return Array(sorted(self, key=l, reverse=reverse))
682
683 def sortBy_(self, l, reverse=False):
684 """

Callers 3

argsortByMethod · 0.80
argsortMethod · 0.80
testMethod · 0.80

Calls 3

__validate_bool_argMethod · 0.95
ArrayClass · 0.85
sortMethod · 0.80

Tested by 1

testMethod · 0.64