Skip to content

Commit 029ee45

Browse files
committed
Add missing migration overload for Console.print
1 parent acc775e commit 029ee45

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ This project adheres to [Semantic Versioning](https://semver.org/) since version
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- `Console.print` methods using `string` keyword were marked as invalid instead of deprecated.
12+
913
## [19.0.0] - 2025-06-13
1014

1115
Finished port to SDL3, this has caused several breaking changes from SDL such as lowercase key constants now being uppercase and mouse events returning `float` instead of `int`.

tcod/console.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,24 @@ def print(
10381038
string: str = "",
10391039
) -> int: ...
10401040

1041+
@overload
1042+
@deprecated(
1043+
"Replace text, fg, bg, bg_blend, and alignment with keyword arguments."
1044+
"\n'string' keyword should be renamed to `text`"
1045+
)
1046+
def print(
1047+
self,
1048+
x: int,
1049+
y: int,
1050+
text: str = "",
1051+
fg: tuple[int, int, int] | None = None,
1052+
bg: tuple[int, int, int] | None = None,
1053+
bg_blend: int = tcod.constants.BKGND_SET,
1054+
alignment: int = tcod.constants.LEFT,
1055+
*,
1056+
string: str,
1057+
) -> int: ...
1058+
10411059
def print( # noqa: PLR0913
10421060
self,
10431061
x: int,

0 commit comments

Comments
 (0)