Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typing to pens #2936

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Add typing to pens #2936

wants to merge 7 commits into from

Conversation

madig
Copy link
Contributor

@madig madig commented Dec 22, 2022

This an alternative to #2919 where I just apply the typing but keep the argument names the same. They could be changed in a separate PR.

This took way too long. In the process, I actually added arguments to methods like identifier, as they were missing in places. I had to take some liberties with # type: ignore, usually around the special qCurve case of None being the last point. I also ignore various addComponent cases where the keyword for an argument doesn't match the abstract class. I left some XXX comments in, for subsequent clean-up. I suppose mypy is stumbling over the, uh, organic design of various pens.

For review, I tried to batch the changes by what they're used for, singling out the Cu2Qu pens because I thought they might need a more careful look. WxPen seems weird to me, as the code before probably didn't work? There are no tests, so I looked at the wx API docs.

@madig madig force-pushed the type-pens branch 2 times, most recently from eb47341 to facf2dc Compare December 25, 2022 22:01
@madig madig marked this pull request as ready for review December 25, 2022 22:04
@benkiel
Copy link
Collaborator

benkiel commented Dec 26, 2022

@madig Can you comment on how merging this may impact things that aren't font tools that use the base pens?

@madig
Copy link
Contributor Author

madig commented Dec 26, 2022

It shouldn't impact any users. I kept the argument names unchanged, but added e.g. the identifier kwarg where it was missing; that shouldn't impact anyone either, because all of those instances were followed by kwargs anyway.

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.

None yet

2 participants