added missing `_range` definition for Python 3