How to use 'python reverse range' in Python

Every line of 'python reverse range' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
79def __reversed__(self):
80 """Return an xrange which represents a sequence whose
81 contents are the same as the sequence this xrange
82 represents, but in the opposite order."""
83 sign = self._step / abs(self._step)
84 last = self._start + ((self._len - 1) * self._step)
85 return xrange(last, self._start - sign, -1 * self._step)
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code


Related snippets