3 ms·
You can also do: stuff = stuff is not None and stuff or [] That said, the `if stuff is not None:` is the most Pythonic way of doing it.
by tswicegood 16y ago
You can also do:
stuff = stuff is not None and stuff or []
That said, the `if stuff is not None:` is the most Pythonic way of doing it.