Skip to content

London | 26-Jul-SDC | Roman Sanaye | Sprint 5 | Prep Exercises - #650

Open
RomanSanaye wants to merge 1 commit into
CodeYourFuture:mainfrom
RomanSanaye:sprint5-prep-exercises
Open

London | 26-Jul-SDC | Roman Sanaye | Sprint 5 | Prep Exercises#650
RomanSanaye wants to merge 1 commit into
CodeYourFuture:mainfrom
RomanSanaye:sprint5-prep-exercises

Conversation

@RomanSanaye

Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Added the Sprint 5 preparation exercises, including Python dataclasses, type annotations, enums, inheritance, methods, and type-guided refactoring.

I also tested the exercises using Python and mypy to check the code and type annotations.

Questions

@RomanSanaye RomanSanaye added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 6, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good work on this, lots of good implementations. I have a few comments on some files

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you mean to commit this file? How could you prevent it from being comitted in future?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Have you tried added the type annotations to this file?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good explanations


def is_adult(self):
today = date.today()
age = today.year - self.date_of_birth.year

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will this definitely give the correct age for all possible days?



people = [
Person(name="Imran", age=22, preferred_operating_systems="Ubuntu"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I get a mypy warning here, can you figure out why?

input("What is your preferred operating system? ")
)
except ValueError:
print("Invalid operating system.", file=sys.stderr)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you think of a more graceful UX for handling invalid inputs?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants