Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`trial`.`_dist`.`functional``

module documentation
(source)

General functional-style helpers for disttrial.

Function | `compose` | Create a function that calls one function with an argument and then another function with the result of the first function.
Function | `countingCalls` | Wrap a function with another that automatically passes an integer counter of the number of calls that have gone through the wrapper.
Function | `flip` | Create a function like another but with the order of the first two arguments flipped.
Function | `fromOptional` | Get a definite value from an optional value.
Async Function | `iterateWhile` | Call a function repeatedly until its result fails to satisfy a predicate.
Async Function | `sequence` | Wait for one action to complete and then another.
Function | `takeWhile` | :return: An iterable over C{xs} that stops when C{condition} returns ``False`` based on the value of iterated C{xs}.
Variable | `discardResult` | Undocumented
Type Variable | `_A` | Undocumented
Type Variable | `_B` | Undocumented
Type Variable | `_C` | Undocumented

def compose(fx: `Callable[[_B], _C]`, fy: `Callable[[_A], _B]`) -> `Callable[[_A], _C]`: (source)

Create a function that calls one function with an argument and then another function with the result of the first function.

def countingCalls(f: `Callable[[int], _A]`) -> `Callable[[], _A]`: (source)

Wrap a function with another that automatically passes an integer counter of the number of calls that have gone through the wrapper.

def flip(f: `Callable[[_A, _B], _C]`) -> `Callable[[_B, _A], _C]`: (source)

Create a function like another but with the order of the first two arguments flipped.

def fromOptional(default: `_A`, optional: `Optional[_A]`) -> `_A`: (source)

Get a definite value from an optional value.

Parameters
default:`_A` | The value to return if the optional value is missing.
optional:`Optional[_A]` | The optional value to return if it exists.
Returns
`_A` | Undocumented

async def iterateWhile(predicate: `Callable[[_A], bool]`, action: `Callable[[], Awaitable[_A]]`) -> `_A`: (source)

Call a function repeatedly until its result fails to satisfy a predicate.

Parameters
predicate:`Callable[[_A], bool]` | The check to apply.
action:`Callable[[], Awaitable[_A]]` | The function to call.
Returns
`_A` | The result of `action` which did not satisfy `predicate`.

async def sequence(a: `Awaitable[_A]`, b: `Awaitable[_B]`) -> `_B`: (source)

Wait for one action to complete and then another.

If either action fails, failure is propagated. If the first action fails, the second action is not waited on.

def takeWhile(condition: `Callable[[_A], bool]`, xs: `Iterable[_A]`) -> `Iterable[_A]`: (source)

:return: An iterable over C{xs} that stops when C{condition} returns ``False`` based on the value of iterated C{xs}.

discardResult: `Callable[[Awaitable[_A]], Deferred[None]]` = (source)

Undocumented

_A = (source)

Undocumented

Value

    TypeVar('_A')

_B = (source)

Undocumented

Value

    TypeVar('_B')

_C = (source)

Undocumented

Value

    TypeVar('_C')