for python buffer