Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring batch_format_link_properties to Utilize Optional Return Type for in-place Mutation #96

Conversation

mohamedawnallah
Copy link
Member

@mohamedawnallah mohamedawnallah commented Dec 20, 2023

Description

The current functionality within batch_format_link_properties doesn't utilize the returned links when the inplace parameter is set to True. It's more conventionally sound not to return a value if we're already mutating in place.

Changes Made

  • Removed the return of links from batch_format_link_properties when the inplace parameter is True.
  • Utilized Optional from the typing module to denote the possible absence of a return value when inplace is set to True.

How Has This Been Tested?

No alterations to the logic's behavior have been made. Testing ensured that the removal of the return value was correctly implemented, specifically when the inplace parameter is True.

Additional References

Python Optional typing hint:
https://docs.python.org/3/library/typing.html#typing.Optional

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@mohamedawnallah mohamedawnallah changed the title Avoid returning links in batch_format_link_properties if inplace parameter is True Refactoring batch_format_link_properties to Utilize Optional Return Type for in-place Mutation Dec 20, 2023
Copy link
Member

@m-appel m-appel left a comment

Choose a reason for hiding this comment

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

Thanks, I added one comment. In general we don't use type hints much in this project, I think I added this one out of habit.

iyp/__init__.py Show resolved Hide resolved
@m-appel m-appel merged commit 62319e9 into InternetHealthReport:main Dec 21, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants