Skip to content

Commit c13c380

Browse files
committed
Ruff lint and format
1 parent d23a7f3 commit c13c380

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

qrcode/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def __mod__(self, other):
281281

282282
num = [
283283
item ^ gexp(glog(other_item) + ratio)
284-
for item, other_item in zip(self, other)
284+
for item, other_item in zip(self, other, strict=False)
285285
]
286286
if difference:
287287
num.extend(self[-difference:])

qrcode/image/styles/colormasks.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def extrap_num(self, n1, n2, interped_num):
8080
# find the interpolation coefficient between two numbers
8181
def extrap_color(self, col1, col2, interped_color):
8282
normed = []
83-
for c1, c2, ci in zip(col1, col2, interped_color):
83+
for c1, c2, ci in zip(col1, col2, interped_color, strict=False):
8484
extrap = self.extrap_num(c1, c2, ci)
8585
if extrap is not None:
8686
normed.append(extrap)
@@ -221,5 +221,4 @@ def initialize(self, styledPilImage, image):
221221
self.color_img = self.color_img.resize(image.size)
222222

223223
def get_fg_pixel(self, image, x, y):
224-
width, _ = image.size
225224
return self.color_img.getpixel((x, y))

qrcode/main.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
import sys
44
import warnings
55
from bisect import bisect_left
6-
from typing import Generic, Literal, NamedTuple, Optional, TypeVar, cast, overload
6+
from typing import Generic, NamedTuple, TypeVar, cast, overload
77

88
from qrcode import constants, exceptions, util
99
from qrcode.image.base import BaseImage
1010
from qrcode.image.pure import PyPNGImage
1111

12-
ModulesType = list[list[Optional[bool]]]
12+
ModulesType = list[list[bool | None]]
1313
# Cache modules generated just based on the QR Code version
1414
precomputed_qr_blanks: dict[int, ModulesType] = {}
1515

@@ -320,9 +320,7 @@ def get_module(x, y) -> int:
320320
out.flush()
321321

322322
@overload
323-
def make_image(
324-
self, image_factory: Literal[None] = None, **kwargs
325-
) -> GenericImage: ...
323+
def make_image(self, image_factory: None = None, **kwargs) -> GenericImage: ...
326324

327325
@overload
328326
def make_image(

0 commit comments

Comments
 (0)