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

Resolve mypy errors. #807

Merged
merged 9 commits into from
Dec 5, 2024
3 changes: 1 addition & 2 deletions Lib/fontParts/base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ def __repr__(self) -> str:
contentString = ""
return f"<{self.__class__.__name__}{contentString} at {id(self)}>"

@classmethod
def _reprContents(cls) -> List[str]:
def _reprContents(self) -> List[str]:
"""Provide a list of strings for inclusion in :meth:`BaseObject.__repr__.

:return: A :class:`list` of :class:`str` items.
Expand Down
2 changes: 1 addition & 1 deletion Lib/fontParts/base/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def _decompose(self) -> None:
compatibilityReporterClass = ComponentCompatibilityReporter

def isCompatible(
self, other: BaseComponent
self, other: BaseComponent, cls=None
) -> Tuple[bool, ComponentCompatibilityReporter]:
"""Evaluate interpolation compatibility with another component.

Expand Down
2 changes: 1 addition & 1 deletion Lib/fontParts/base/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def _transformBy(
compatibilityReporterClass = ContourCompatibilityReporter

def isCompatible(
self, other: BaseContour
self, other: BaseContour, cls=None
) -> Tuple[bool, ContourCompatibilityReporter]:
"""Evaluate interpolation compatibility with another contour.

Expand Down
4 changes: 3 additions & 1 deletion Lib/fontParts/base/font.py
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,9 @@ def _interpolate(

compatibilityReporterClass = FontCompatibilityReporter

def isCompatible(self, other: BaseFont) -> Tuple[bool, FontCompatibilityReporter]:
def isCompatible(
self, other: BaseFont, cls=None
) -> Tuple[bool, FontCompatibilityReporter]:
"""Evaluate interpolation compatibility with another font.

This method will return a :class:`bool` indicating if the font is
Expand Down
4 changes: 3 additions & 1 deletion Lib/fontParts/base/glyph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2795,7 +2795,9 @@ def _checkPairs(
reporter.warning = True
reporterObject.append(compatibility)

def isCompatible(self, other: BaseGlyph) -> Tuple[bool, GlyphCompatibilityReporter]:
def isCompatible(
self, other: BaseGlyph, cls=None
) -> Tuple[bool, GlyphCompatibilityReporter]:
"""Evaluate interpolation compatibility with another glyph.

:param other: The other :class:`BaseGlyph` instance to check
Expand Down
4 changes: 3 additions & 1 deletion Lib/fontParts/base/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,9 @@ def _interpolate(

compatibilityReporterClass = LayerCompatibilityReporter

def isCompatible(self, other: BaseLayer) -> Tuple[bool, LayerCompatibilityReporter]:
def isCompatible(
self, other: BaseLayer, cls=None
) -> Tuple[bool, LayerCompatibilityReporter]:
"""Evaluate interpolation compatibility with another layer.

:param other: The other :class:`BaseLayer` instance to check
Expand Down
2 changes: 1 addition & 1 deletion Lib/fontParts/base/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def _transformBy(self, matrix: SextupleCollectionType[IntFloatType], **kwargs: A
compatibilityReporterClass = SegmentCompatibilityReporter

def isCompatible(
self, other: BaseSegment
self, other: BaseSegment, cls=None
) -> Tuple[bool, SegmentCompatibilityReporter]:
"""Evaluate interpolation compatibility with another segment.

Expand Down
Loading