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

Add type annotations to public API. Fix #172 #189

Merged
merged 1 commit into from
May 30, 2022
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
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 (
Expand All @@ -12,11 +14,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.