Fixes #1641
There's no need to explicitly raise StopIteration as that's what a bare return statement does for a generator function - so yes they're the same. As of late 2014 return is correct and raise StopIteration for ending a generator is on a depreciation schedule. See PEP 479 for full details. https://stackoverflow.com/q/14183803/248296 https://www.python.org/dev/peps/pep-0479/
This commit is contained in:
		| @@ -92,7 +92,7 @@ class QuerySet(BaseQuerySet): | ||||
|             # Raise StopIteration if we already established there were no more | ||||
|             # docs in the db cursor. | ||||
|             if not self._has_more: | ||||
|                 raise StopIteration | ||||
|                 return | ||||
|  | ||||
|             # Otherwise, populate more of the cache and repeat. | ||||
|             if len(self._result_cache) <= pos: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user