Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In Python 2, this is legal: a = [{'masterid': 20, 'builderid': 10}, {'masterid': 30, 'builderid': 5}] a.sort() but on Python 3, a.sort() will give this error: TypeError: '<' not supported between instances of 'dict' and 'dict' Fix the code by changing: a.sort() to sorted(a, key=keyFunc) Create two key functions: configOnKey -> for sorting workerdict['config_on'] workerKey -> for sorting workerdicts
- Loading branch information
Showing
1 changed file
with
66 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters