mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-21 03:11:17 +08:00
BaseContext.__copy__ (#1012)
* Improved BaseContext.__copy__() * Update django-stubs/template/context.pyi Co-authored-by: Nikita Sobolev <mail@sobolevn.me> * Updated __copy__ to use private name. Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from contextlib import contextmanager
|
||||
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Type, Union
|
||||
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Type, TypeVar, Union
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.template.base import Node, Origin, Template
|
||||
@@ -7,6 +7,7 @@ from django.template.defaulttags import IfChangedNode
|
||||
from django.template.loader_tags import IncludeNode
|
||||
|
||||
_ContextValues = Union[Dict[str, Any], "Context"]
|
||||
_ContextCopy = TypeVar("_ContextCopy", bound="BaseContext")
|
||||
|
||||
class ContextPopException(Exception): ...
|
||||
|
||||
@@ -18,7 +19,7 @@ class ContextDict(dict):
|
||||
|
||||
class BaseContext(Iterable[Any]):
|
||||
def __init__(self, dict_: Any = ...) -> None: ...
|
||||
def __copy__(self) -> BaseContext: ...
|
||||
def __copy__(self: _ContextCopy) -> _ContextCopy: ...
|
||||
def __iter__(self) -> Iterator[Any]: ...
|
||||
def push(self, *args: Any, **kwargs: Any) -> ContextDict: ...
|
||||
def pop(self) -> ContextDict: ...
|
||||
|
||||
Reference in New Issue
Block a user