Yes, but why? Actually, it's No, because python culture aims to use one way to do thing, the least surprising one. In this case it's:
def f(x=None): if x is None: x = [] def f(x=None): if x is None: x = []That said, people still seem to favor your form as the more Pythonic way. Personally, I think that's just because the ternary expression is relatively new.