#29581: MultiValueDict behaviour does not match dict behaviour for single values
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  nobody
  pvanagtmaal                        |
                   Type:  Bug        |         Status:  new
              Component:  Utilities  |        Version:  2.0
               Severity:  Normal     |       Keywords:  dict,
           Triage Stage:             |  MultiValueDict
  Unreviewed                         |      Has patch:  0
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 **Description:**
 When using a MultiValueDict, retrieving the value for a key with only a
 single value yields unexpected and inconsistent results compared to a
 regular dictionary. See the code sample below.

 {{{
 >>> from django.utils.datastructures import MultiValueDict
 >>> mvd = MultiValueDict()
 >>> mvd['test'] = 1
 >>> mvd['test']
 1
 >>> dict(mvd)['test']
 [1]
 }}}

 **Expected:**
 {{{ dict(mvd)['test'] }}} yields {{{1}}}, like {{{ mvd['test'] }}} does

 **Actual:**
 {{{ dict(mvd)['test'] }}} yields {{{[1]}}} instead

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29581>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/054.830d4124566e784605ba1c5071893dde%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to