-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Update doubly linked list #3619
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
Update doubly linked list #3619
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.
There are really not enough tests here. This submission deletes a lot of tests which is going in the wrong direction. We need more tests, not fewer. It is OK to create a separate test file as long as pytest finds it via test discovery but it is too difficult to spot bugs without tests.
Please move the definition of Node before LinkedList.
The name of the file and the name of the main class should match so perhaps the class should be DoublyLinkedList.
add more test
Please add a doctest on
|
@cclauss Done. |
OPTIONAL: Create % python3 >>> from __future__ import annotations
>>> from dataclasses import dataclass
>>> from typing import Any, Optional
>>> @dataclass
... class Node:
... data: Any
... prev: Optional[Node] = None
... next: Optional[Node] = None
...
>>> Node("Data")
Node(data='Data', prev=None, next=None) |
I'am not familiar with this. I think current version is friendly to beginner. BTW. this PR can be merged ? :) |
More worried about merging than learning? |
I will study in a few days. 👍 :) |
* update doubly linked list * reformat code add more test * add test to iter * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* update doubly linked list * reformat code add more test * add test to iter * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* update doubly linked list * reformat code add more test * add test to iter * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* update doubly linked list * reformat code add more test * add test to iter * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.