You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 line
584 B

  1. from typing import Any, NewType, NoReturn, TypeVar
  2. from . import Attribute
  3. from attrs import _OnSetAttrType
  4. _T = TypeVar("_T")
  5. def frozen(
  6. instance: Any, attribute: Attribute[Any], new_value: Any
  7. ) -> NoReturn: ...
  8. def pipe(*setters: _OnSetAttrType) -> _OnSetAttrType: ...
  9. def validate(instance: Any, attribute: Attribute[_T], new_value: _T) -> _T: ...
  10. # convert is allowed to return Any, because they can be chained using pipe.
  11. def convert(
  12. instance: Any, attribute: Attribute[Any], new_value: Any
  13. ) -> Any: ...
  14. _NoOpType = NewType("_NoOpType", object)
  15. NO_OP: _NoOpType