On Wed, Dec 17, 2014 at 9:48 PM, Aymeric Augustin
<aymeric.augus...@polytechnique.org> wrote:
Surprisingly, it seems that there isn’t a backwards compatibility
problem with changing the type to lists, as the following pattern
still works:
# myproject/settings.py
from django.conf.global_settings import FILE_UPLOAD_HANDLERS
FILE_UPLOAD_HANDLERS +=
('myproject.uploadhandler.FooBarUploadHandler',)
Proof:
foo = ['abc']
foo += ('def',)
foo
['abc', ‘def’]
Well, technically, there is a potential backward incompatibility: +=
for lists is a synonym for .extend().
Proof:
>>> a = [1,2,3]
>>> b = a
>>> b += (4,)
>>> a
[1, 2, 3, 4]
>>> b
[1, 2, 3, 4]
>>> a = (1,2,3)
>>> b = a
>>> b += (4,)
>>> a
(1, 2, 3)
>>> b
(1, 2, 3, 4)
--
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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
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/1418850209.5814.0%40smtp.gmail.com.
For more options, visit https://groups.google.com/d/optout.