histogram() in pure Python, better support for int