title: python: the form of key in heaps.nsmallest
body: <p>when I study python cookbook, there raised a question really puzzle me:</p>
  
  <pre><code>portfolio = [
         {'name': 'IBM', 'shares': 100, 'price': 91.1},
         {'name': 'AAPL', 'shares': 50, 'price': 543.22},
         {'name': 'FB', 'shares': 200, 'price': 21.09},
         {'name': 'HPQ', 'shares': 35, 'price': 31.75},
         {'name': 'YHOO', 'shares': 45, 'price': 16.35},
         {'name': 'ACME', 'shares': 75, 'price': 115.65}
  ]
  
      cheap = heapq.nsmallest(3, portfolio, key=lambda s: s['price'])
  </code></pre>
  
  <p>here we can see the 's' is not defined, but how it can work? what should I do if I don't want to use lambda?</p>