spekk.transformations.base.Buildable#

class spekk.transformations.base.Buildable[source]#

Bases: ABC

An abstract class representing something that can be “built” with a Spec to get information about how the spec changes when transforming functions.

Parameters:
  • input_spec (Spec) – The spec that is passed into the function.

  • passed_spec (Spec) – The spec that is passed down into the wrapped function after the transformation has been applied.

  • returned_spec (Spec) – The spec that is returned up from the wrapped function.

  • output_spec (Spec) – The final spec that is returned after calling the transformed function.

__init__()#

Methods

__init__()

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.

abstract build(input_spec: Spec) TBuildableSelf[source]#

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

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.