MCPcopy Index your code
hub / github.com/lincolnloop/python-qrcode / best_mask_pattern

Method best_mask_pattern

qrcode/main.py:238–254  ·  view source on GitHub ↗

Find the most efficient mask pattern.

(self)

Source from the content-addressed store, hash-verified

236 return self.version
237
238 def best_mask_pattern(self):
239 """
240 Find the most efficient mask pattern.
241 """
242 min_lost_point = 0
243 pattern = 0
244
245 for i in range(8):
246 self.makeImpl(True, i)
247
248 lost_point = util.lost_point(self.modules)
249
250 if i == 0 or min_lost_point > lost_point:
251 min_lost_point = lost_point
252 pattern = i
253
254 return pattern
255
256 def print_tty(self, out=None):
257 """

Callers 1

makeMethod · 0.95

Calls 1

makeImplMethod · 0.95

Tested by

no test coverage detected