move operator<< out of python ifdef