Skip to content

Commit 8e98214

Browse files
committed
-
1 parent 886f45c commit 8e98214

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

python_toolbox/comparison_tools.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ def total_ordering(cls):
5656

5757

5858
def process_key_function_or_attribute_name(key_function_or_attribute_name):
59+
'''
60+
Make a key function given either a key function or an attribute name.
61+
62+
Some functions let you sort stuff by entering a key function or an
63+
attribute name by which the elements will be sorted. This function tells
64+
whether we were given a key function or an attribute name, and generates a
65+
key function out of it if needed.
66+
'''
5967
if key_function_or_attribute_name is None:
6068
return None
6169
elif callable(key_function_or_attribute_name):

0 commit comments

Comments
 (0)