#32010: Unexpected behaviour of MultiValueDict.getlist in conjunction with map
-----------------------------+--------------------------------------
Reporter: Etienne Ott | Owner: nobody
Type: Bug | Status: closed
Component: Utilities | Version: 3.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------
Comment (by Etienne Ott):
It seems that when creating the example above I didn't reproduce any kind
of bug and instead constructed an incorrect use of `MultiValueDict`.
Further digging has revealed that using the membership operator `in` on
generators like `map` is also incorrect usage. The pythonic way is to
check a list made by list comprehension, e.g. `if number in [x for x in
map(int, somelist)]`. My apologies for wasting time with something
unrelated to Django.
--
Ticket URL: <https://code.djangoproject.com/ticket/32010#comment:2>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.fce105f4e63c4094a1118c0948b4cb54%40djangoproject.com.