I currently teach first year university students python, and I was surprised to learn that the seemingly innocuous
input function, that some of my students had decided to use (and were confused by the odd behaviour), was hiding a call to
eval behind it.
So my question is, why does the
input function call
eval, and what would this ever be useful for that it wouldn't be safer to do with
raw_input? I understand that this has been changed in Python 3, but it seems like an unusual design decision in the first place.