def task_has_custom(task, attr): """Return true if the task or one of its bases defines ``attr`` (excluding the one in BaseTask).""" return mro_lookup(task.__class__, attr, stop=(BaseTask, object), monkey_patched=['celery.app.task'])
def task_has_custom(task, attr): """Return true if the task overrides ``attr``.""" return mro_lookup( task.__class__, attr, stop={BaseTask, object}, monkey_patched=["celery.app.task"], )
def app_has_custom(app, attr): """Return true if app has customized method `attr`. Note: This is used for optimizations in cases where we know how the default behavior works, but need to account for someone using inheritance to override a method/property. """ return mro_lookup(app.__class__, attr, stop={Celery, object}, monkey_patched=[__name__])
def task_has_custom(task, attr): """Returns true if the task or one of its bases defines ``attr`` (excluding the one in BaseTask).""" return mro_lookup(task.__class__, attr, stop=(BaseTask, object), monkey_patched=['celery.app.task'])
def app_has_custom(app, attr): return mro_lookup(app.__class__, attr, stop=(Celery, object), monkey_patched=[__name__])
def task_has_custom(task, attr): """Return true if the task overrides ``attr``.""" return mro_lookup(task.__class__, attr, stop={BaseTask, object}, monkey_patched=['celery.app.task'])