I think Florian's point would be that you can still do:
from django.conf import settings
settings.TEMPLATE_DIRS += ('foo',)
if it is a tuple, so I don't really see how it being a tuple is making it
necessarily more safe than a list - is the above code really much different
to:
from django.conf import settings
settings.TEMPLATE_DIRS.append('foo')
On 19 January 2015 at 14:45, Andreas Kahnert <[email protected]>
wrote:
> I'm not talking about modifications inside the settings.py but in other
> place. With lists, unexperienced devs might do things like: from
> django.conf import settings; settings.TEMPLATE_DIRS[3] = '/my_tpls'; and
> expect to work out good. (This doesn't violate the docs, since technicaly
> settings.TEMPLATE_DIRS is still the same list, means the settings variable
> itself hasn't been changed.) This is realy just a question of logic: lists
> are mutable - settings are immutable; see the conflict?
>
> Am Montag, 19. Januar 2015 14:20:51 UTC+1 schrieb Florian Apolloner:
>
>>
>>
>> On Monday, January 19, 2015 at 12:35:10 PM UTC+1, Andreas Kahnert wrote:
>>>
>>> I'm strongly against lists. Lists are mutable objects, their components
>>> can be changed in place. The settings are initialized at server start and
>>> after that changes on them arn't reflected. Therefore all settings should
>>> be tuples from my point of view. Using a custom list/tuple class for "easy"
>>> notation within the settings.py might be an option, but after server
>>> startup all of those should be immutable. So for the sake of logic, take
>>> tuples, please.
>>>
>>
>> As long as something like settings.MY_SETTING=(1,);
>> settings.MY_SETTING+=(1,2,3) works, that argument is kinda moot imo.
>>
>> Cheers,
>> Florian
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/5b974048-0c9f-4ae2-8ff2-8db1fbd736f4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/5b974048-0c9f-4ae2-8ff2-8db1fbd736f4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/CAMwjO1FOBDj3V5KaPBNkMbg__cgkLAQjHXYpx3GyUQB1waWfEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.