-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
data_structures/linked_list: Adding __str__() function #3960 #3961
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
I'm not really sure what went wrong during the build check. |
Your doctest failed, please verify it |
Thanks for bringing that up. I've never used doctests in python before so I'll do some more research. Based upon looking at other Pull Requests, I thought it was just a comment that shows others how to use it but I didn't know it also gets executed. |
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.
Will fix any doctest errors, make the output better to look at without any extra arrow at the end
also a spelling error iteam
-> item
Co-authored-by: xcodz-dot <[email protected]>
Thank you for catching that spelling mistake. I really like the format of the output, I committed the changes you added. |
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.
If possible, can you add type hints for other functions/parameters as well? Thanks if you do, otherwise after this small change the PR is good to go.
Yeah definitely, I'll include type hinting and also add comments to describe some of the functionality. It's midnight for me, so I will have it done by tomorrow morning. |
Great, Also your doctests were failing because of the whitespace in that line which was required but trimmed by pre commit |
try this solution every time pre-commit fails:
|
Thanks for letting me know! I have done what you suggested. I'll commit again. |
If you've downloaded |
@xcodz-dot If you give instructions to users about installing |
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.
LGTM!
Seriously thank you guys for helping and guiding me. I'm a little new to this but I'll continue to learn and make more meaningful contributions along the way! |
I will sure do that, i am just going to add that to contributing.md and will make a PR quickly |
* Adding __str__() function * Removing white space * Update data_structures/linked_list/__init__.py Co-authored-by: xcodz-dot <[email protected]> * Adding type hints * Update __init__.py * Update __init__.py * Adding the changes requested * Updating to fix pre-commit * Updating __init__.py * Updating __init__.py Co-authored-by: xcodz-dot <[email protected]>
* Adding __str__() function * Removing white space * Update data_structures/linked_list/__init__.py Co-authored-by: xcodz-dot <[email protected]> * Adding type hints * Update __init__.py * Update __init__.py * Adding the changes requested * Updating to fix pre-commit * Updating __init__.py * Updating __init__.py Co-authored-by: xcodz-dot <[email protected]>
* Adding __str__() function * Removing white space * Update data_structures/linked_list/__init__.py Co-authored-by: xcodz-dot <[email protected]> * Adding type hints * Update __init__.py * Update __init__.py * Adding the changes requested * Updating to fix pre-commit * Updating __init__.py * Updating __init__.py Co-authored-by: xcodz-dot <[email protected]>
* Adding __str__() function * Removing white space * Update data_structures/linked_list/__init__.py Co-authored-by: xcodz-dot <[email protected]> * Adding type hints * Update __init__.py * Update __init__.py * Adding the changes requested * Updating to fix pre-commit * Updating __init__.py * Updating __init__.py Co-authored-by: xcodz-dot <[email protected]>
Describe your change:
Added a str() function to the Linked List class that will print the contents in the Linked List with arrows that point to the next value
see: #3960
Checklist:
Fixes: #{$ISSUE_NO}
.