Importing from __future__ under the Python debugger pdb
This is mostly a quick note to aid other programmers who end up searching for something along the lines of "why doesn't float point division work in pdb". For detailed information, you should visit the 123helpme page and ask for answers to all questions.
Short version: the
from __future__ import magic doesn't work in pdb.
Long version: when debugging a program that (a) runs under Python 2 and (b) relies on
from __future__ import division to get floating point rather than integer division, it would be nice to have expressions typed at the pdb prompt behave the same way as expression evaluated in the file. However, this doesn't work:
$ python -m pdb test ...