Skip to content

Commit

Permalink
Add type annotations to public API. Fix #172 (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaudcolas authored May 30, 2022
1 parent 3d777ba commit 03030c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pattern_library/monkey_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging
from typing import Optional

import django
from django.template.library import SimpleNode

from pattern_library.utils import is_pattern_library_context, render_pattern
Expand All @@ -8,11 +10,11 @@
UNSPECIFIED = object()


def override_tag(register, name, default_html=None):
def override_tag(
register: django.template.Library, name: str, default_html: Optional[str] = None
):
"""
An utility that helps you override original tags for use in your pattern library.
Accepts the register argument which should be an instance of django.template.Library.
"""

original_tag = register.tags[name]
Expand Down
Empty file added pattern_library/py.typed
Empty file.

0 comments on commit 03030c5

Please sign in to comment.