Skip to content

Commit

Permalink
Use a scoped mypy type ignore
Browse files Browse the repository at this point in the history
JSONSettings override dict but the signature of get is different.

Just silence that type of warning while getting type check for the type of the
arguments.
  • Loading branch information
marcospri committed Sep 3, 2024
1 parent 91a8caa commit 09a4847
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lms/models/json_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class JSONSettings(MutableDict):
An optional spec for the acceptable fields and types.
"""

def get(self, group, key, default=None): # type: ignore
def get(self, group: str, key: str, default=None): # type: ignore[override]
"""
Return the requested setting or None.
Expand Down
4 changes: 2 additions & 2 deletions lms/resources/_js_config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from lms.error_code import ErrorCode
from lms.events import LTIEvent
from lms.js_config_types import DashboardConfig, DashboardRoutes, User
from lms.models import Assignment, Course, Grouping
from lms.models import ApplicationInstance, Assignment, Course, Grouping
from lms.product.blackboard import Blackboard
from lms.product.canvas import Canvas
from lms.product.d2l import D2L
Expand Down Expand Up @@ -48,7 +48,7 @@ def _h_user(self):
return self._lti_user.h_user

@property
def _application_instance(self):
def _application_instance(self) -> ApplicationInstance:
return self._lti_user.application_instance

def add_document_url( # pylint: disable=too-complex,too-many-branches,useless-suppression # noqa: PLR0912
Expand Down

0 comments on commit 09a4847

Please sign in to comment.