Skip to content

TASK: Add age_up method (#51)#68

Open
Aliipou wants to merge 2 commits intoTheGittyPerson:mainfrom
Aliipou:feature/age-up-method
Open

TASK: Add age_up method (#51)#68
Aliipou wants to merge 2 commits intoTheGittyPerson:mainfrom
Aliipou:feature/age-up-method

Conversation

@Aliipou
Copy link

@Aliipou Aliipou commented Mar 22, 2026

Summary

Adds an age_up() method to the Person class.

Changes

  • Added Person.age_up() method with type hints and docstring
  • increment parameter defaults to 1 (must be int)
  • Optional height_increment parameter to increase height simultaneously
  • check_birthday parameter (defaults to True) raises ValueError when today is not the person’s birthday
  • Follows PEP 8 style and matches existing code conventions

Closes #51

Add age_up() method that increases the person's age by a given
increment. Supports optional height_increment and check_birthday
parameter that validates today matches the person's birthday.

Closes TheGittyPerson#51
@TheGittyPerson TheGittyPerson added enhancement New feature or request task This is a task issue / PR completing a task labels Mar 23, 2026
Signed-off-by: Morpheus <167074500+thegittyperson@users.noreply.github.com>
Copy link
Owner

@TheGittyPerson TheGittyPerson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Here is just a tiny suggestion before we merge — let me know what you think.

Args:
increment: How many years to add to the person's age.
Defaults to 1.
height_increment: Optional amount (in metres) to increase
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to add a check for height_increment that raises a ValueError to prevent negative increments.

Also perhaps a type check for height_increment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request task This is a task issue / PR completing a task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TASK: Add age_up method

2 participants