Would you consider
seq = seq or 
a viable alternative to your if-construction?
Yes, I would see that as a viable alternative :-) — although I would argue that:
if X is None
Another option is using a non mutable type like a tuple
Yep, that would solve it if your argument can be transformed to use a non-mutable version.
However, Python is already so confusing on types that I wouldn’t recommend providing a tuple if you’re to use a list afterwards.
I like to use type annotations, so annotating an argument as a List while providing an empty tool for the default would look suspicious. ;)
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.