MIT-Emerging-Talent / 2024-group-02-collaboration-practice

MIT License
0 stars 0 forks source link

Data structure: Linked list #21

Closed Vlad421 closed 10 months ago

Vlad421 commented 10 months ago

README Documentation

Python Files

Function Docstring

Function Implementation

Unit Test Suite

Vlad421 commented 10 months ago

You forgot the dot between LinkedList and __data Should be like this:

self.assertEqual(linked_list._LinkedList.__data[0].value

Also you shouldn't be able to access the __data variable it's private. But who knows. Python has its flaws

tvsirius commented 10 months ago

python kind of like 'protect' marked with variables, but you still can access them with this constrution self.assertEqual(linked_list._LinkedListdata[0].value, 1) self.assertEqual(linked_list._LinkedListdata[0].next.value, 3)

run this code

MyClass.__protected - will give no access MyClass._MyClass__proctected - will give access

Vlad421 commented 10 months ago

python kind of like 'protect' marked with variables, but you still can access them with this constrution self.assertEqual(linked_list._LinkedListdata[0].value, 1) self.assertEqual(linked_list._LinkedListdata[0].next.value, 3)

run this code

MyClass.__protected - will give no access MyClass._MyClass__proctected - will give access

Indeed. You can access private vars through this construction.

Fixed issue.