-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Description:
The current implementation of the add_task method allows the title and description parameters to be optional. However, for a task management system, having a title and description for each task is crucial for clarity and organization. Allowing these parameters to be optional can lead to tasks without meaningful identifiers or context, which reduces the usability of the system.
Suggested Changes
Make title and description Mandatory:
Update the add_task method to require title and description parameters. This ensures that every task has a meaningful identifier and context.
Example Code Changes
Original Code
def add_task(self, title='', description="", deadline='',
category=None, priority=0, status="To Do",
completion_time=None, duration_planned=None,
duration=None, points=0):
"""Add a task to the tasklist."""Improved Code
Code kopieren
def add_task(self, title, description, deadline='',
category=None, priority=0, status="To Do",
completion_time=None, duration_planned=None,
duration=None, points=0):
"""
Add a task to the tasklist.
Args:
title (str): The title of the task.
description (str): The description of the task.
deadline (str, optional): The deadline for the task.
category (str, optional): The category of the task.
priority (int, optional): The priority level of the task.
status (str, optional): The current status of the task.
completion_time (str, optional): The completion time of the task.
duration_planned (str, optional): The planned duration for the task.
duration (str, optional): The actual duration of the task.
points (int, optional): The points assigned to the task.
""" Metadata
Metadata
Assignees
Labels
No labels