﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23088	Paginator.page_range is of inconsistent type in Py2/Py3	Keryn Knight <django@…>	mardini	"Currently, [https://github.com/django/django/blob/31f6421b134e4e83a459d2faa1009b33fefd6276/django/core/paginator.py Paginator.page_range] uses the implementation native version of `range`, which under Python 2.x yields a `list`, while on 3.x it is a class of type `range`, largely analogous to 2.x's `xrange`

`six` is already imported into the module for `Page.__getitem__` and so could be leveraged to at least be consistent.

In the pathological case, the python 2.x version could be considered problematic if yielding a large range, because the list is built up immediately in memory, where the 3.x version uses the efficient iterator.
I actually encountered this by passing a `page_range` in a template's context, which then gets copied into every child context (eg: via `{% include %}`) ... and gets worse when you try and figure out what happened by enabling debug-toolbar's context peeking panel ([https://github.com/kezabelle/django-haystackbrowser/commit/a4fc82903249fa3ba7c4cbdac70d23843417ce95 commit where I handled it] by basically removing a 65,000 item list)"	Cleanup/optimization	closed	Core (Other)	dev	Normal	fixed		cmawebsite@…	Accepted	1	0	0	0	0	0
