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 more mypy errors. #811

Merged
merged 4 commits into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Lib/fontParts/base/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
List,
Optional,
Tuple,
Type,
TypeVar,
Union,
)
Expand Down Expand Up @@ -65,8 +66,8 @@ class BaseContour(

"""

segmentClass = None
bPointClass = None
segmentClass: Optional[Type[BaseSegment]] = None
bPointClass: Optional[Type[BaseBPoint]] = None

def _reprContents(self) -> List[str]:
contents = []
Expand Down Expand Up @@ -935,10 +936,10 @@ def _get_segments(self) -> Tuple[BaseSegment, ...]:
for points in segments:
if self.segmentClass is None:
raise TypeError("segmentClass cannot be None.")
segment = self.segmentClass()
segment._setPoints(points)
self._setContourInSegment(segment)
wrapped.append(segment)
pointSegment = self.segmentClass()
pointSegment._setPoints(points)
self._setContourInSegment(pointSegment)
wrapped.append(pointSegment)
return tuple(wrapped)

def __getitem__(self, index: int) -> BaseSegment:
Expand Down
Loading