consistent map functionality for python3