-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Improve type safety of container_exists
#12053
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to LocalStack! Thanks for raising your first Pull Request and landing in your contributions. Our team will reach out with any reviews or feedbacks that we have shortly. We recommend joining our Slack Community and share your PR on the #community channel to share your contributions with us. Please make sure you are following our contributing guidelines and our Code of Conduct.
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
I unfortunately can't add a label to the PR, can someone please add the label |
container_exists
container_exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @martinfrancois for the contribution!
Additional type hints are always great! But to be honest, I am not sure if your change on the return statement really is more readable. 😄
This is obviously quite subjective, and I'm happy to discuss this further, but I don't really see a reason to explicitly change this line and given that there isn't much else to the PR, I am leaning towards closing this PR...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the contribution @martinfrancois! agree with @alexrashed here that i don't think the return condition is more readable than before. but i like that were adding type hints!
cf12a73
to
ebd3125
Compare
container_exists
container_exists
Hi, @alexrashed and @thrau; you're welcome; thanks a lot for the review! I understand that the way of writing the return condition is indeed a matter of preference. I now dropped the commit with the change to the return condition and left the one with the type safety improvements :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for including our review :-) type hints are always helpful 👍
Motivation
I added type annotations to the
container_exists
function to improve type safety, facilitate static type checking, and improve developer experience.Changes
While the code's external behavior remains unchanged, these changes improve the readability and maintainability of the code.