Why does Django use tuples for settings and not lists?

前端 未结 3 548

Quoting this answer:

Apart from tuples being immutable there is also a semantic distinction that should guide their usage. Tuples are heterogeneous data str
3条回答
  •  梦毁少年i
    2021-01-04 01:20

    This was changed in Django 1.9:

    Default settings that were tuples are now lists

    The default settings in django.conf.global_settings were a combination of lists and tuples. All settings that were formerly tuples are now lists.

    https://docs.djangoproject.com/en/1.9/releases/1.9/#default-settings-that-were-tuples-are-now-lists

提交回复
热议问题