Skip to content

Commit 7d994ee

Browse files
committed
Add missing docstring to Image.from_file class method.
1 parent c6967a8 commit 7d994ee

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/) since version
77
### Added
88
- Added PathLike support to more libtcodpy functions.
99
- New `tcod.sdl.mouse.show` function for querying or setting mouse visibility.
10+
- New class method `tcod.image.Image.from_file` to load images with. This replaces `tcod.image_load`.
1011

1112
### Deprecated
1213
- Deprecated the libtcodpy functions for images and noise generators.

tcod/image.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ def from_array(cls, array: ArrayLike) -> Image:
6767

6868
@classmethod
6969
def from_file(cls, path: str | PathLike[str]) -> Image:
70+
"""Return a new Image loaded from the given `path`.
71+
72+
.. versionadded:: Unreleased
73+
"""
7074
path = Path(path).resolve(strict=True)
7175
return cls._from_cdata(ffi.gc(lib.TCOD_image_load(bytes(path)), lib.TCOD_image_delete))
7276

0 commit comments

Comments
 (0)