Using empty tuple as default iterable argument in function

I can’t think of any downsides, for when you need an immutable iterable. I think it just isn’t used because the default_list=None and default_list = default_list or None pattern is what is used for mutable iterables, and people don’t bother to change it (as there is no real need) in the less frequently occuring cases when the iterable is immutable. There is certainly no unexpected behaviour as with mutable default arguments.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)