Skip to content

London | SDC-Nov-25 | Emiliano Uruena | Sprint 2 | Linked List Python#131

Open
Emilianouz wants to merge 3 commits intoCodeYourFuture:mainfrom
Emilianouz:Sprint2-linked-list
Open

London | SDC-Nov-25 | Emiliano Uruena | Sprint 2 | Linked List Python#131
Emilianouz wants to merge 3 commits intoCodeYourFuture:mainfrom
Emilianouz:Sprint2-linked-list

Conversation

@Emilianouz
Copy link

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

LinkedList implementation with double linked list.

@Emilianouz Emilianouz added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 28, 2026
Copy link

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

The code in linked_list_test.py expects both .next and .previous properties of the removed node to be assigned None. Currently your implementation could not pass the tests.

Note: Do you know the why it is a good practice to assign .next and .previous of the removed node to None?

class Node:
def __init__(self, value):
self.value = value
self.prev = None
Copy link

Choose a reason for hiding this comment

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

The tests in the linked_list_test.py expect the properties named in certain way.

Comment on lines +39 to +44
if self.head == self.tail: # if only one element
self.head = None
self.tail = None
else:
self.tail = self.tail.prev # move tail back
self.tail.next = None # remove old tail connection
Copy link

Choose a reason for hiding this comment

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

Could consider delegating the node removing task to self.remove() -- less code to maintain.

@cjyuan cjyuan 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 Mar 2, 2026
Renamed  for test, and updated references.
@Emilianouz
Copy link
Author

The code in linked_list_test.py expects both .next and .previous properties of the removed node to be assigned None. Currently your implementation could not pass the tests.

Note: Do you know the why it is a good practice to assign .next and .previous of the removed node to None?

To prevent accidental references. Thank you.

@Emilianouz Emilianouz added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 4, 2026
@cjyuan
Copy link

cjyuan commented Mar 4, 2026

Changes look good.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants