comparison mercurial/thirdparty/attr/converters.pyi @ 49643:e1c586b9a43c

attr: vendor 22.1.0 The previous version was 5 years old, and pytype 2022.06.30 started complaining about various uses (e.g. seeing `mercurial.thirdparty.attr._make._CountingAttr` instead of `bytearray`). Hopefully this helps. Additionally, this has official python 3.11 support. The `attrs` package is left out, because it is simply a bunch of *.pyi stubs and `from attr.X import *`, and that's not how they've been used up to this point. We'd probably need to customize those anyway to `from mercurial.thirdparty.attr import *`.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 21 Nov 2022 15:04:42 -0500
parents
children
comparison
equal deleted inserted replaced
49642:7e6f3c69c0fb 49643:e1c586b9a43c
1 from typing import Callable, Optional, TypeVar, overload
2
3 from . import _ConverterType
4
5 _T = TypeVar("_T")
6
7 def pipe(*validators: _ConverterType) -> _ConverterType: ...
8 def optional(converter: _ConverterType) -> _ConverterType: ...
9 @overload
10 def default_if_none(default: _T) -> _ConverterType: ...
11 @overload
12 def default_if_none(*, factory: Callable[[], _T]) -> _ConverterType: ...
13 def to_bool(val: str) -> bool: ...