Skip to content

Commit

Permalink
Fix typing (add pydantic mypy plugin, add type)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuatz committed Nov 4, 2024
1 parent e949682 commit c0b435e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions django_utils_lib/lazy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from typing import Callable, Optional


class LazyDjango:
"""
Django has a few modules where if you import something from them,
Expand All @@ -9,6 +12,8 @@ class LazyDjango:
to just use lazy-imports.
"""

_redirect_to_login: Optional[Callable] = None

@property
def redirect_to_login(self):
if self._redirect_to_login is None:
Expand Down
3 changes: 3 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ ignore_missing_imports = True
check_untyped_defs = True
warn_unused_configs = True
warn_incomplete_stub = True

# == Plugins ==
plugins = pydantic.mypy

0 comments on commit c0b435e

Please sign in to comment.