fix(converter): prevent ColourConverter from returning non-Color types like tuples#1491
fix(converter): prevent ColourConverter from returning non-Color types like tuples#1491devbutlazy wants to merge 3 commits into
Conversation
|
The fix you are proposing is a band-aid. The library shouldn't be invoking any non-factory methods of To properly fix the issue, we should have some kind of mapping of valid names to the methods, or at least a set to validate input beforehand. |
If you provide such a set, I'd implement the proper issue fix. |
|
Take a look at the |
Summary
Fix #1488 => in
ColourConverter.convertwhere certain classmethods (likeholographic_style) return a tuple of colors instead of a singledisnake.Colorinstance. Previously, this caused the converter to return a tuple instead of raising an error.This PR adds a type check after invoking the color method and raises
BadColourArgumentif the returned value is not a singledisnake.Color.Checklist
uv run nox -s lintuv run nox -s pyright