fixed Py3k bug and simplified some redundant code by using macro in 3kcompat.h
fixed Py3k bug and simplified some redundant code by using macro in 3kcompat.h

numpy/numpy-refactor,numpy/numpy-refactor,numpy/numpy-refactor,numpy/numpy-refactor,numpy/numpy-refactor