fontParts icon indicating copy to clipboard operation
fontParts copied to clipboard

Add type annotations to `fontshell`.

Open knutnergaard opened this issue 9 months ago • 2 comments

Includes:

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

knutnergaard avatar Mar 16 '25 12:03 knutnergaard

@benkiel See issues #824 and #825.

knutnergaard avatar Mar 16 '25 12:03 knutnergaard

@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.

knutnergaard avatar Mar 17 '25 08:03 knutnergaard