News for hackers. Stuff that matters.
Re:Special Cases Are a Code Smell by elephantum on Friday January 25, 2019 @12:21AM (#18995775)
It means you have two extra special cases: 1) list is empty; 2) left edge is the right edge (I.e. length is 1)
Re:Special Cases Are a Code Smell by riskable on Friday January 25, 2019 @09:34AM (#18998161)
Nothing that can't be solved with more conditionals!

Conditionals are great because they're clear and concise...

    if not list: # Can't do anything with this
         return # or raise error
    if len(list) < 3: # Ditto
         return #ditto
Sure, there's more code but it's not bad code. It's just straightforward stuff that's easy to read and debug (if necessary).