pynenc.arguments

Module Contents

Classes

Arguments

Represents a distinctive set of arguments used in a task call.

API

class pynenc.arguments.Arguments(kwargs: Optional[pynenc.types.Args] = None)[source]

Represents a distinctive set of arguments used in a task call.

This class facilitates the handling of arguments by providing functionalities such as generating a unique identifier for a set of arguments, and supporting hashability and equality checks.

Parameters:

kwargs (Optional[Args]) – Keyword arguments to initialize the Arguments object. Defaults to an empty dictionary if None is provided.

Initialization

classmethod from_call(func: pynenc.types.Func, *args: Any, **kwargs: Any) pynenc.arguments.Arguments[source]

Creates an Arguments object from a function call.

It uses inspect.signature to determine the function’s signature and binds the provided arguments to it.

Parameters:
  • func (Func) – The function whose arguments are to be processed.

  • args (Any) – Positional arguments of the function call.

  • kwargs (Any) – Keyword arguments of the function call.

Returns:

An instance of Arguments representing the arguments of the call.

args_id() str

Generates a unique identifier for the set of arguments.

The identifier is a SHA-256 hash of the sorted argument names and values, ensuring uniqueness.

Returns:

A string representing the unique identifier of the arguments.

__hash__() int[source]
__eq__(__value: object) bool[source]
__str__() str[source]
__repr__() str[source]