annotate mercurial/thirdparty/attr/converters.pyi @ 53042:cdd7bf612c7b stable tip

bundle-spec: properly format boolean parameter (issue6960) This was breaking automatic clone bundle generation. This changeset fixes it and add a test to catch it in the future.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 11 Mar 2025 02:29:42 +0100
parents e1c586b9a43c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49643
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
1 from typing import Callable, Optional, TypeVar, overload
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
2
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
3 from . import _ConverterType
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
4
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
5 _T = TypeVar("_T")
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
6
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
7 def pipe(*validators: _ConverterType) -> _ConverterType: ...
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
8 def optional(converter: _ConverterType) -> _ConverterType: ...
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
9 @overload
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
10 def default_if_none(default: _T) -> _ConverterType: ...
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
11 @overload
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
12 def default_if_none(*, factory: Callable[[], _T]) -> _ConverterType: ...
e1c586b9a43c attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
13 def to_bool(val: str) -> bool: ...