Skip to content

Commit de0758e

Browse files
committed
Remove old type ignores for new Mypy version.
1 parent 3083218 commit de0758e

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

tcod/color.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def r(self) -> int:
3131
"""
3232
return int(self[0])
3333

34-
@r.setter # type: ignore
34+
@r.setter
3535
@deprecate("Setting color attributes has been deprecated.")
3636
def r(self, value: int) -> None:
3737
self[0] = value & 0xFF
@@ -45,7 +45,7 @@ def g(self) -> int:
4545
"""
4646
return int(self[1])
4747

48-
@g.setter # type: ignore
48+
@g.setter
4949
@deprecate("Setting color attributes has been deprecated.")
5050
def g(self, value: int) -> None:
5151
self[1] = value & 0xFF
@@ -59,7 +59,7 @@ def b(self) -> int:
5959
"""
6060
return int(self[2])
6161

62-
@b.setter # type: ignore
62+
@b.setter
6363
@deprecate("Setting color attributes has been deprecated.")
6464
def b(self, value: int) -> None:
6565
self[2] = value & 0xFF
@@ -102,7 +102,7 @@ def __eq__(self, other: Any) -> bool:
102102
return False
103103

104104
@deprecate("Use NumPy instead for color math operations.")
105-
def __add__(self, other: Any) -> Color:
105+
def __add__(self, other: Any) -> Color: # type: ignore[override]
106106
"""Add two colors together.
107107
108108
.. deprecated:: 9.2

tcod/console.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def ch(self) -> NDArray[np.intc]:
245245
"""
246246
return self._tiles["ch"].T if self._order == "F" else self._tiles["ch"]
247247

248-
@property # type: ignore
248+
@property
249249
@deprecate("This attribute has been renamed to `rgba`.")
250250
def tiles(self) -> NDArray[Any]:
251251
"""An array of this consoles raw tile data.
@@ -261,7 +261,7 @@ def tiles(self) -> NDArray[Any]:
261261
"""
262262
return self.rgba
263263

264-
@property # type: ignore
264+
@property
265265
@deprecate("This attribute has been renamed to `rgba`.")
266266
def buffer(self) -> NDArray[Any]:
267267
"""An array of this consoles raw tile data.
@@ -273,7 +273,7 @@ def buffer(self) -> NDArray[Any]:
273273
"""
274274
return self.rgba
275275

276-
@property # type: ignore
276+
@property
277277
@deprecate("This attribute has been renamed to `rgb`.")
278278
def tiles_rgb(self) -> NDArray[Any]:
279279
"""An array of this consoles data without the alpha channel.
@@ -285,7 +285,7 @@ def tiles_rgb(self) -> NDArray[Any]:
285285
"""
286286
return self.rgb
287287

288-
@property # type: ignore
288+
@property
289289
@deprecate("This attribute has been renamed to `rgb`.")
290290
def tiles2(self) -> NDArray[Any]:
291291
"""This name is deprecated in favour of :any:`rgb`.
@@ -347,7 +347,7 @@ def default_bg(self) -> Tuple[int, int, int]:
347347
color = self._console_data.back
348348
return color.r, color.g, color.b
349349

350-
@default_bg.setter # type: ignore
350+
@default_bg.setter
351351
@deprecate("Console defaults have been deprecated.")
352352
def default_bg(self, color: Tuple[int, int, int]) -> None:
353353
self._console_data.back = color
@@ -358,7 +358,7 @@ def default_fg(self) -> Tuple[int, int, int]:
358358
color = self._console_data.fore
359359
return color.r, color.g, color.b
360360

361-
@default_fg.setter # type: ignore
361+
@default_fg.setter
362362
@deprecate("Console defaults have been deprecated.")
363363
def default_fg(self, color: Tuple[int, int, int]) -> None:
364364
self._console_data.fore = color
@@ -368,7 +368,7 @@ def default_bg_blend(self) -> int:
368368
"""int: The default blending mode."""
369369
return self._console_data.bkgnd_flag # type: ignore
370370

371-
@default_bg_blend.setter # type: ignore
371+
@default_bg_blend.setter
372372
@deprecate("Console defaults have been deprecated.")
373373
def default_bg_blend(self, value: int) -> None:
374374
self._console_data.bkgnd_flag = value
@@ -378,7 +378,7 @@ def default_alignment(self) -> int:
378378
"""int: The default text alignment."""
379379
return self._console_data.alignment # type: ignore
380380

381-
@default_alignment.setter # type: ignore
381+
@default_alignment.setter
382382
@deprecate("Console defaults have been deprecated.")
383383
def default_alignment(self, value: int) -> None:
384384
self._console_data.alignment = value

tcod/noise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def __repr__(self) -> str:
180180
def dimensions(self) -> int:
181181
return int(self._tdl_noise_c.dimensions)
182182

183-
@property # type: ignore
183+
@property
184184
@deprecate("This is a misspelling of 'dimensions'.")
185185
def dimentions(self) -> int:
186186
return self.dimensions

tests/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def console(session_console: tcod.console.Console) -> tcod.console.Console:
3333
tcod.console_flush()
3434
with warnings.catch_warnings():
3535
warnings.simplefilter("ignore")
36-
console.default_fg = (255, 255, 255) # type: ignore
37-
console.default_bg = (0, 0, 0) # type: ignore
38-
console.default_bg_blend = tcod.BKGND_SET # type: ignore
39-
console.default_alignment = tcod.LEFT # type: ignore
36+
console.default_fg = (255, 255, 255)
37+
console.default_bg = (0, 0, 0)
38+
console.default_bg_blend = tcod.BKGND_SET
39+
console.default_alignment = tcod.LEFT
4040
console.clear()
4141
return console
4242

tests/test_console.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ def test_array_read_write() -> None:
4444
def test_console_defaults() -> None:
4545
console = tcod.console.Console(width=12, height=10)
4646

47-
console.default_bg = [2, 3, 4] # type: ignore
47+
console.default_bg = [2, 3, 4] # type: ignore[assignment]
4848
assert console.default_bg == (2, 3, 4)
4949

50-
console.default_fg = (4, 5, 6) # type: ignore
50+
console.default_fg = (4, 5, 6)
5151
assert console.default_fg == (4, 5, 6)
5252

53-
console.default_bg_blend = tcod.BKGND_ADD # type: ignore
53+
console.default_bg_blend = tcod.BKGND_ADD
5454
assert console.default_bg_blend == tcod.BKGND_ADD
5555

56-
console.default_alignment = tcod.RIGHT # type: ignore
56+
console.default_alignment = tcod.RIGHT
5757
assert console.default_alignment == tcod.RIGHT
5858

5959

tests/test_tcod.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ def test_color_class() -> None:
117117
assert tcod.black + (2, 2, 2) - (1, 1, 1) == (1, 1, 1)
118118

119119
color = tcod.Color()
120-
color.r = 1 # type: ignore
121-
color.g = 2 # type: ignore
122-
color.b = 3 # type: ignore
120+
color.r = 1
121+
color.g = 2
122+
color.b = 3
123123
assert color == (1, 2, 3)
124124

125125

0 commit comments

Comments
 (0)