Is there a way to do the following in python with a builtin, or does it require a user function?
l = [1,]
l.pop(0)
# 1
l.pop(0)
# IndexError: pop from empty list <-- I want it to return None
In other words, something for the following:
popsafe = lambda l: l.pop(0) if l else None