Replace inline defs with lambdas
Replace inline defs with lambdas

For two reasons:
- pyright complains about function defs obscuring each other
- black likes adding lots of spaces around function defs, which I find
  ugly in this case

djrobstep/sqlakeyset