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 type annotations to fontshell. #826

Draft
wants to merge 7 commits into
base: v1
Choose a base branch
from

Conversation

knutnergaard
Copy link
Contributor

Includes:

  • annotation of all fontshell modules
  • related fixes in base classes

knutnergaard and others added 2 commits March 16, 2025 13:18
Fix related inconsistencies in base classes.
@knutnergaard
Copy link
Contributor Author

@benkiel See issues #824 and #825.

@knutnergaard
Copy link
Contributor Author

knutnergaard commented Mar 17, 2025

@benkiel All modules in fontshell (except for the test module) are now annotated.

I've added a method to many of the modules to handle a potential non-value from the naked object. It will look something like:

def _getNaked(self) -> defcon.Info:
        info = self.naked()
        if info is None:
            raise ValueError("Info cannot be None.")
        return info

I'm not sure if the error message is sufficiently clear, so any for changes here are welcome.

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

1 participant