From 3905e7e64059b45479894ba1fdfb0ef9cef64475 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sat, 16 Feb 2019 23:41:52 -0800 Subject: basic subscriptions system --- python/attr/converters.pyi | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 python/attr/converters.pyi (limited to 'python/attr/converters.pyi') diff --git a/python/attr/converters.pyi b/python/attr/converters.pyi new file mode 100644 index 0000000..63b2a38 --- /dev/null +++ b/python/attr/converters.pyi @@ -0,0 +1,12 @@ +from typing import TypeVar, Optional, Callable, overload +from . import _ConverterType + +_T = TypeVar("_T") + +def optional( + converter: _ConverterType[_T] +) -> _ConverterType[Optional[_T]]: ... +@overload +def default_if_none(default: _T) -> _ConverterType[_T]: ... +@overload +def default_if_none(*, factory: Callable[[], _T]) -> _ConverterType[_T]: ... -- cgit v1.2.3