Skip to content

Add docstring to Task #162

@MarkoM-dot

Description

@MarkoM-dot

Hi!

The task class has multiple docstrings and perhaps there is a good reason for it but I cannot think of any. But there are a few undesirable consequences. Below I have the output of the __doc__ and the help command that do not look like documentation. Also, any docstring documentation generation would read this value and I am reasonably sure you'd rather the comments you've written show up here.

>>> Task.__doc__
"Task(priority: int, func: Callable[~P, ~T], backend: str, queue_name: str = 'default', run_after: Optional[datetime.datetime] = None, enqueue_on_commit: Optional[bool] = None)"
help(Task)

Help on class Task in module django_tasks.task:

class Task(typing.Generic)
 |  Task(priority: int, func: Callable[~P, ~T], backend: str, queue_name: str = 'default', run_after: Optional[datetime.datetime] = N
one, enqueue_on_commit: Optional[bool] = None) -> None
 |
 |  Task(priority: int, func: Callable[~P, ~T], backend: str, queue_name: str = 'default', run_after: Optional[datetime.datetime] = N
one, enqueue_on_commit: Optional[bool] = None)
 |
 |  Method resolution order:
 |      Task
 |      typing.Generic
 |      builtins.object
 |
 |  Methods defined here:

Let me know if you'd like to have this fixed. I don't mind contributing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomerstasks-apiIssues relating to the tasks API and general API contract from the library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions