add doctest for python 2 & simple compatible python 3