ipython/ipython — Issue #1478: key function or lambda in sorted function doesn't find global variables
Author: amirouche
Created: 2012-03-08 15:00:20+00:00
State: open

This works in python shell but not in ipython

```python
letters_to_order = {'alpha': 0, 'beta': 10}
letters = ['beta', 'alpha']

h = sorted(letters, key=lambda x: letters_to_order[x])
```