spekk.transformations.base.Specced#

class spekk.transformations.base.Specced(f: callable, transform_spec: Callable[[Spec], Spec])[source]#

Bases: Buildable

A wrapper around f that has information about what happens to the spec when the function is called.

__init__(f: callable, transform_spec: Callable[[Spec], Spec]) None#

Methods

__init__(f, transform_spec)

build(input_spec)

Return a copy of this object with information about what happens to the spec when the function is called.

Attributes

input_spec

The spec for the input kwargs for the function.

output_spec

The spec of the final returned value from the transformed function.

passed_spec

The spec for the input kwargs that are passed down into the wrapped function after the transformation has been applied.

returned_spec

The spec of the returned value from the wrapped function.

f

The function to wrap.

transform_spec

A function that transforms the spec, returning the spec of the return-value of f.

build(input_spec: Spec) Specced[source]#

Return a copy of this object with information about what happens to the spec when the function is called.

f: callable#

The function to wrap.

input_spec: Spec | None = None#

The spec for the input kwargs for the function.

output_spec: Spec | None = None#

The spec of the final returned value from the transformed function.

passed_spec: Spec | None = None#

The spec for the input kwargs that are passed down into the wrapped function after the transformation has been applied.

returned_spec: Spec | None = None#

The spec of the returned value from the wrapped function.

transform_spec: Callable[[Spec], Spec]#

A function that transforms the spec, returning the spec of the return-value of f.