comparison tests/test-revlog-raw.py @ 51690:493034cc3265

black: format the codebase with 23.3.0 The CI has moved to 23.3.0, which is the last version that supports 3.7 at runtime, so we should honor this change. # skip-blame mass-reformating only
author Raphaël Gomès <rgomes@octobus.net>
date Thu, 18 Jul 2024 12:36:12 +0200
parents 8ed03f773eac
children 7f0cb9ee0534
comparison
equal deleted inserted replaced
51689:39e2b2d062c1 51690:493034cc3265
244 244
245 The combination of two adjacent numbers will cover all possible cases. 245 The combination of two adjacent numbers will cover all possible cases.
246 That is to say, given any x, y where both x, and y are in range(2 ** n), 246 That is to say, given any x, y where both x, and y are in range(2 ** n),
247 there is an x followed immediately by y in the generated sequence. 247 there is an x followed immediately by y in the generated sequence.
248 """ 248 """
249 m = 2 ** n 249 m = 2**n
250 250
251 # Gray Code. See https://en.wikipedia.org/wiki/Gray_code 251 # Gray Code. See https://en.wikipedia.org/wiki/Gray_code
252 gray = lambda x: x ^ (x >> 1) 252 gray = lambda x: x ^ (x >> 1)
253 reversegray = {gray(i): i for i in range(m)} 253 reversegray = {gray(i): i for i in range(m)}
254 254