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