File: deconstruct.pyi

package info (click to toggle)
python-django-stubs 5.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: python: 5,185; makefile: 15; sh: 8
file content (18 lines) | stat: -rw-r--r-- 641 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from collections.abc import Callable, Sequence
from typing import Any, TypeVar, overload, type_check_only

from typing_extensions import Self

# Contains additions from a class being decorated with '@deconstructible'
@type_check_only
class _Deconstructible:
    def __new__(cls, *args: Any, **kwargs: Any) -> Self: ...
    def deconstruct(obj) -> tuple[str, Sequence[Any], dict[str, Any]]: ...

_T = TypeVar("_T")
_TCallable = TypeVar("_TCallable", bound=Callable[..., Any])

@overload
def deconstructible(_type: type[_T]) -> type[_T]: ...
@overload
def deconstructible(*, path: str | None = None) -> Callable[[_TCallable], _TCallable]: ...