mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-23 20:31:32 +08:00
finish strict_optional support, enable it for typechecking of django tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Type, Union
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Type, Union, Iterable
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.template.base import Node, Origin, Template
|
||||
@@ -15,10 +15,10 @@ class ContextDict(dict):
|
||||
def __enter__(self) -> ContextDict: ...
|
||||
def __exit__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
class BaseContext:
|
||||
class BaseContext(Iterable[Any]):
|
||||
def __init__(self, dict_: Any = ...) -> None: ...
|
||||
def __copy__(self) -> BaseContext: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def __iter__(self) -> Iterator[Any]: ...
|
||||
def push(self, *args: Any, **kwargs: Any) -> ContextDict: ...
|
||||
def pop(self) -> ContextDict: ...
|
||||
def __setitem__(self, key: Union[Node, str], value: Any) -> None: ...
|
||||
@@ -50,7 +50,6 @@ class Context(BaseContext):
|
||||
class RenderContext(BaseContext):
|
||||
dicts: List[Dict[Union[IncludeNode, str], str]]
|
||||
template: Optional[Template] = ...
|
||||
def __iter__(self) -> None: ...
|
||||
def push_state(self, template: Template, isolated_context: bool = ...) -> Iterator[None]: ...
|
||||
|
||||
class RequestContext(Context):
|
||||
|
||||
Reference in New Issue
Block a user