_attrs.pyi 559 B

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