Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ sort_priority
Function
sort_priority
example_code/item_033.py:51–57 ·
view source on GitHub ↗
(values, group)
Source
from the content-addressed store, hash-verified
49
50
print(
"Example 1"
)
51
def
sort_priority(values, group):
52
def
helper(x):
53
if
x in group:
54
return
(0, x)
55
return
(1, x)
56
57
values.sort(key=helper)
58
59
60
print(
"Example 2"
)
Callers
1
item_033.py
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected