Skip to content

Remove bytearray type hints from ImageFont - #10526

Merged
radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:bytearray_type_hint
Nov 16, 2026
Merged

radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:bytearray_type_hint

Conversation

@radarhere

Copy link
Copy Markdown
Member

Currently, ImageFont, FreeTypeFont and TransposedFont have type hints saying that getbbox() accepts bytearray, and ImageFont does as well for getlength(). However, if you try and use them, FreeTypeFont raises errors, and ImageFont returns zero width.

This removes the type hints.

Taken from #9908, along with removing bytearray from _has_separator().

Co-authored-by: Aarni Koskela <akx@iki.fi>
@radarhere
radarhere enabled auto-merge (squash) November 16, 2026 19:25
@radarhere
radarhere merged commit 67106a4 into python-pillow:main Nov 16, 2026
55 checks passed
@radarhere
radarhere deleted the bytearray_type_hint branch November 16, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant