Improve type hints on public interface#583
Conversation
methods affected: - `lineCap` - `underline` - `strikethrough` - `writingDirection` - `text` - `textBox` - `textBoxBaselines`
|
morning! @typemytype could you have a look at the PR? thanks : ) |
|
I think you should first make sure that the CI doesn't fail. There's currently a mypy error. |
|
Sure, I'll take care of it. I am curious to know what @typemytype thinks of the open discussions : ) |
a small change in booleanOperation causes this diff
|
fixed the tests only the |
this removes the fontVariations(None) deprecated option after 8 years.
openTypeFeatures(None) no longer supported after 8 years of deprecation
|
I have updated the |
|
I also took the liberty to move all the examples in the docstrings to |
I see your point, but since I've done some corrections to the docstrings in this PR, I thought to add this as well. Type hints add some form of functionalities for IDEs, but in the end they are documentation. I see both falling under the same umbrella. Either way, I can revert it, no problem. |
|
looks good to me! |

Hey!
I've recently noticed a couple of issues with hints:
dict[str, something]pyrightdoes infer most of them butmypyinstead defaults toAny, so better specify them)I've also left a few comments on the code on hints/validations that I'd like an input from you. I'll try to expose them as discussions here in the PR thread.
I propose to open a separate PR to complete the ruff integration. They can probably go in parallel.