Repository navigation
Make FontManager.score_weight less lenient. - #12565
Conversation
|
What's the reason/rationale for this change? And does it affect user functions such as |
|
Silently replacing invalid values by 500 just seems like a good way to shoot onself in the foot. |
| weightval2 = weight_dict.get(weight2, 500) | ||
| return 0.95*(abs(weightval1 - weightval2) / 1000.0) + 0.05 | ||
| w1 = weight1 if isinstance(weight1, Number) else weight_dict[weight1] | ||
| w2 = weight2 if isinstance(weight2, Number) else weight_dict[weight2] |
There was a problem hiding this comment.
Agree w the change. A little concerned that the error message will be mysterious? What is the actual error message here?
There was a problem hiding this comment.
They'd get a KeyError on the failing dict lookup, which may not be the nicest but should not be too confusing either. Frankly I'd rather wait for some version of #12232 (up to API discussion) to go in rather than add more custom error messages to this kind of things...
PR Summary
PR Checklist