OK, aa few things:
A. I would make head and size private, you don't want them changed from outside the class.
B. You should use __len__
instead of __sizeof__
- they have different meanings.
C. Implement __iter__
D. After doing C, Format the repr using:
"[{}]". format(", ". join(map(str, self)))
I would make
head
andsize
private
, you don't want them changed from outside the class.You should use
__len__
instead of__sizeof__
- they have different meanings.Implement
__iter__
After doing #3, format the
repr
using:"[{}]". format(", ". join(map(str, self)))