Skip to main content
1 of 5
greybeard
  • 7.8k
  • 3
  • 21
  • 56

specify what is to happen with parameter values without "natural" meaning, e.g., index smaller zero or not smaller count.

  • provide docstrings for classes (and modules), too

[especially] insert, find, replace, at_index

  • insert fails to update count
  • find, replace: replace might use _find. With quality satisfied with more than one node's data, both are underspecified.
  • _at_index: if count/2 < index < count, walk backwards
    (it may be useful to allow indices from -count (even with at_index or generally) - cf. slicing)
  • delete looks non-adapted from a singly-linked list implementation
    should use _at_index
  • reverse: how about transmuting to an instance of ListLinkedDoubly, with roles of next and last(&head/tail) exchanged
  • __str__: return '[]' if 0 == self.count \
        else '[<-(' + ')<=>('.join(self.items()) + ')->]'
greybeard
  • 7.8k
  • 3
  • 21
  • 56