Skip to content

Add detail strings to matrix shape asserts - #2933

Closed
theluckystrike wants to merge 1 commit into
Kozea:mainfrom
theluckystrike:improve-assert-messages
Closed

theluckystrike wants to merge 1 commit into
Kozea:mainfrom
theluckystrike:improve-assert-messages

Conversation

@theluckystrike

Copy link
Copy Markdown

When #464 first raised the idea of giving shape asserts a terse detail string, the two asserts in the Matrix class stayed bare. This adds that detail. If a dimension check fails now, the error shows the actual row and column counts instead of nothing.

The change touches weasyprint/matrix.py and nothing else. Both asserts keep their exact behavior, they only report the local state on the failure path.

Closes #600

@liZe liZe closed this Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve assert statements

2 participants