Slide 44
Slide 44 text
Most places you need to used the identity selector,
lambda x: x it can be missed out, trigger optimizations.
44
Identity selectors can be omitted
>>> query(words).order_by(len).then_by(lambda w: w).to_list()
['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
'z', 'Ab', 'Ah', 'Al', 'Ao', 'As', 'Ay', 'Bu', 'Ed', 'Em', 'Fo', 'Ga', 'Ge', 'Gi,
...
'pseudolamellibranchiate', 'scientificogeographical', 'thymolsulphonephthalein',
'transubstantiationalist', 'formaldehydesulphoxylate', 'pathologicopsychological',
'scientificophilosophical', 'tetraiodophenolphthalein', 'thyroparathyroidectomize']
>>> query(words).order_by(len).then_by().to_list()
['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
'z', 'Ab', 'Ah', 'Al', 'Ao', 'As', 'Ay', 'Bu', 'Ed', 'Em', 'Fo', 'Ga', 'Ge', 'Gi,
...
'pseudolamellibranchiate', 'scientificogeographical', 'thymolsulphonephthalein',
'transubstantiationalist', 'formaldehydesulphoxylate', 'pathologicopsychological',
'scientificophilosophical', 'tetraiodophenolphthalein', 'thyroparathyroidectomize']
Wednesday, 24 October, 12