Skip to main content

task_has_custom

Return true if the task overrides attr.

def task_has_custom(
task: Task,
attr: string
) - > boolean

Return true if the task overrides attr.

Parameters

NameTypeDescription
taskTaskThe Celery task instance to inspect for custom attribute definitions.
attrstringThe name of the attribute or method to check for an override.

Returns

TypeDescription
booleanTrue if the attribute is defined in the task's subclass or monkey-patched, rather than inherited from BaseTask or object.