https://github.com/careercup/CtCI-6th-Edition-Python/blame/653e50ccfa927179526879273062628996f392c1/chapter_02/p04_partition.py#L40
Regards to this below line in the method lr_partition(). Is it possible that left.tail is None in some cases? Consider the case where all the elements are greater or equal to x then all elements will go into right list.
left.tail.next = right.head