Open
Conversation
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
Signed-off-by: Morpheus <167074500+thegittyperson@users.noreply.github.com>
TheGittyPerson
requested changes
Mar 23, 2026
Owner
TheGittyPerson
left a comment
There was a problem hiding this comment.
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 |
Owner
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
age_up()method to thePersonclass.Changes
Person.age_up()method with type hints and docstringincrementparameter defaults to1(must beint)height_incrementparameter to increase height simultaneouslycheck_birthdayparameter (defaults toTrue) raisesValueErrorwhen today is not the person’s birthdayCloses #51