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

Suppress mismatched signature errors in type-checking #1146

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions GTG/core/base_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def __init__(self) -> None:
# --------------------------------------------------------------------------

def new(self) -> S:
"""Creates a new item in the store.
NOTE: Subclasses may override the signature of this method.
"""
raise NotImplementedError


Expand Down Expand Up @@ -177,6 +180,9 @@ def unparent(self, item_id: UUID, parent_id: UUID) -> None:
# --------------------------------------------------------------------------

def from_xml(self, xml: _Element) -> None:
"""Load data from XML.
NOTE: Subclasses may override the signature of this method.
"""
raise NotImplementedError


Expand Down
2 changes: 1 addition & 1 deletion GTG/core/saved_searches.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def to_xml(self) -> _Element:
return root


def new(self, name: str, query: str, parent: Optional[UUID] = None) -> SavedSearch:
def new(self, name: str, query: str, parent: Optional[UUID] = None) -> SavedSearch: # type: ignore[override]
"""Create a new saved search and add it to the store."""

search_id = uuid4()
Expand Down
2 changes: 1 addition & 1 deletion GTG/core/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def find(self, name: str) -> Tag:
return self.lookup_names[name]


def new(self, name: str, parent: Optional[UUID] = None) -> Tag:
def new(self, name: str, parent: Optional[UUID] = None) -> Tag: # type: ignore[override]
"""Create a new tag and add it to the store."""

name = name if not name.startswith('@') else name[1:]
Expand Down
4 changes: 2 additions & 2 deletions GTG/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ def duplicate_for_recurrent(self, task: Task) -> Task:
return new_task


def new(self, title: str = '', parent: Optional[UUID] = None) -> Task:
def new(self, title: str = '', parent: Optional[UUID] = None) -> Task: # type: ignore[override]
"""Create a new task and add it to the store."""

tid = uuid4()
Expand All @@ -784,7 +784,7 @@ def new(self, title: str = '', parent: Optional[UUID] = None) -> Task:
return task


def from_xml(self, xml: _Element, tag_store: TagStore) -> None:
def from_xml(self, xml: _Element, tag_store: TagStore) -> None: # type: ignore[override]
"""Load up tasks from a lxml object."""

elements = list(xml.iter(self.XML_TAG))
Expand Down
Loading