[Django]-Why Django's ModelAdmin uses lists over tuples and vice-versa

8đź‘Ť

âś…

It doesn’t matter which you use because Django (and you) will never change them during runtime. All that’s important is that the value be an iterable of strings. I often use foo = ["something"] when there is only one element because I’ve gotten nailed so often when I accidentally say foo = ("somthing") instead of foo = ("something",).

I would put this one-element-tuple-notation issue on my list of Python irritants, right after “significant whitespace”. That said, I still love the language.

👤Peter Rowell

Leave a comment