Even more awesome: vim-repl (https://github.com/sillybun/vim-repl) uses the :term feature to provide convenient communication with any REPL, with extra support for some languages such as Python.
(In fact there are a host of these; for example, vim-slime now can communicate with Vim’s built-in terminal.)
PS: And when the terminal session exits, the history is still a vim buffer - that's awesome!