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

AbstractPointPen and GLIFPointPen use different argument names #2911

Open
jenskutilek opened this issue Dec 7, 2022 · 3 comments
Open

AbstractPointPen and GLIFPointPen use different argument names #2911

jenskutilek opened this issue Dec 7, 2022 · 3 comments

Comments

@jenskutilek
Copy link
Collaborator

Type-checking code found this inconsistency:

Stubs/fontTools/ufoLib/glifLib.pyi:25: error: Signature of "addComponent" incompatible with supertype "AbstractPointPen"  [override]
Stubs/fontTools/ufoLib/glifLib.pyi:25: note:      Superclass:
Stubs/fontTools/ufoLib/glifLib.pyi:25: note:          def addComponent(self, baseGlyphName: str, transform: Tuple[float, float, float, float, float, float], identifier: Optional[str] = ..., **kwargs: Any) -> None
Stubs/fontTools/ufoLib/glifLib.pyi:25: note:      Subclass:
Stubs/fontTools/ufoLib/glifLib.pyi:25: note:          def addComponent(self, glyphName: str, transformation: Tuple[float, float, float, float, float, float], identifier: Optional[str] = ..., **kwargs: Any) -> None

It looks like an easy fix, but who knows what may break ...

@anthrotype
Copy link
Member

anthrotype commented Dec 7, 2022

interesting. who made those typing stubs?

in any case, it's only the name of the parameters, not their type that is different b/w super and subclass. I think the subclass should use the same names as the superclass, not the other way around.

Send a PR and if anything blows up we'll find out

@jenskutilek
Copy link
Collaborator Author

I made some basic stubs to enable type checking for my own modules.

I’ve unified the argument names in #2919.

@anthrotype
Copy link
Member

I made some basic stubs to enable type checking for my own modules.

nice! maybe we can add those hints directly inline in the python modules, I think @madig has already set up mypy on the CI.

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

No branches or pull requests

2 participants