#23662: QuerySet __nonzero__, __len__ cause queryset evaluation
-------------------------------------+-------------------------------------
     Reporter:  smishlayev           |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |                  Version:  1.7
    Component:  Database layer       |               Resolution:
  (models, ORM)                      |             Triage Stage:
     Severity:  Normal               |  Unreviewed
     Keywords:                       |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  1
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by tchaumeny):

 In my opinion, that could almost be considered as a backward incompatible
 change as people might rely on the fact that doing `len(qs)` followed by
 `for  ... in qs:` will only perform one query (which is important on
 Postgres as a `COUNT(*)` query is rather expensive). Same goes for
 `bool(qs)`.

--
Ticket URL: <https://code.djangoproject.com/ticket/23662#comment:4>
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/068.da499f46669f926eff481837f7226bbd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to