We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 886f45c commit 8e98214Copy full SHA for 8e98214
python_toolbox/comparison_tools.py
@@ -56,6 +56,14 @@ def total_ordering(cls):
56
57
58
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
67
if key_function_or_attribute_name is None:
68
return None
69
elif callable(key_function_or_attribute_name):
0 commit comments