On Tue, 2 Jun 2020 20:57:54 +0200
Aymeric Augustin <[email protected]> wrote:
>
> We're talking about a trade-off between preserving optimisations in
> existing code bases and expertise of advanced users versus doing the
> right thing by default for less experienced users.
I disagree.
The suggestion is to make
if obj in qs:
# do things which don't fetch qs
more performant, at the expense of
if obj in qs:
# do things that fetch qs
As well as
for obj in container:
if obj in qs:
# whatever
So, it is not a net optimization even in terms of its own.
Also, changing the performance characteristics of thousands, if not
millions of existing lines of code, and making a decade of online
comments and advice wrong (not just obsolete "there's better ways now"
but wrong "this points you away from truth and good"), is IMO a
non-starter.
Strong -1 on Aymeric's option 1. Strong +1 on adding ".contains()".
My 2 cents,
Shai.
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/20200605090349.559f3872.shai%40platonix.com.