Skip to main content

task_name_from

Returns the 'name' attribute of the task object if it exists; otherwise, returns the task object itself.

def task_name_from(
task: object
) - > string

Extracts the name attribute from a task object or returns the object itself if the attribute is missing.

Parameters

NameTypeDescription
taskobjectThe task object to inspect for a name attribute or the fallback value to return.

Returns

TypeDescription
stringThe name of the task if available, otherwise the original task object.