-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* typing: Adds type hints to the `utils` module. A `stubs` file was added with type definitions * typing: Removes `typing.TypedDict` to keep the project python3.7 compatible * typing: Adds hints to the `get_sorted_request_variable` * typing: Adds hints for `get_template_context` / `get_frame_info` on utils module * Typing: renames stubs to _stubs making it clear that it's a private module
- Loading branch information
1 parent
08f29f9
commit 19f1cf3
Showing
2 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from typing import Any, List, NamedTuple, Optional, Tuple | ||
|
||
from django import template as dj_template | ||
|
||
|
||
class InspectStack(NamedTuple): | ||
frame: Any | ||
filename: str | ||
lineno: int | ||
function: str | ||
code_context: str | ||
index: int | ||
|
||
|
||
TidyStackTrace = List[Tuple[str, int, str, str, Optional[Any]]] | ||
|
||
|
||
class RenderContext(dj_template.context.RenderContext): | ||
template: dj_template.Template | ||
|
||
|
||
class RequestContext(dj_template.RequestContext): | ||
template: dj_template.Template | ||
render_context: RenderContext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters