_attrs.pyi 573 B

123456789101112131415161718192021
  1. from collections.abc import Callable
  2. from typing import Any, TypeVar
  3. from attr import attrib, field
  4. class UnsupportedSubclassing(Exception): ...
  5. _T = TypeVar("_T")
  6. def __dataclass_transform__(
  7. *,
  8. frozen_default: bool = False,
  9. field_descriptors: tuple[type | Callable[..., Any], ...] = ...,
  10. ) -> Callable[[_T], _T]: ...
  11. @__dataclass_transform__(field_descriptors=(attrib, field))
  12. def define(cls: type[_T]) -> type[_T]: ...
  13. @__dataclass_transform__(
  14. frozen_default=True,
  15. field_descriptors=(attrib, field),
  16. )
  17. def frozen(cls: type[_T]) -> type[_T]: ...