patch to work also under Ipython