#30036: Code example for using Paginator in a view makes redundant imports
------------------------------------------------+------------------------
               Reporter:  bhch                  |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  Documentation         |        Version:  2.1
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 The code example in this section:
 [https://docs.djangoproject.com/en/2.1/topics/pagination/#using-paginator-
 in-a-view Using Paginator in a view] imports `EmptyPage` and
 `PageNotAnInteger` unnecessarily since `Paginator.get_page()` handles
 these exceptions internally.

 I had to spend some time figuring out why these were imported and never
 used. I even thought the code example might be incomplete, until I checked
 the source code.

 I think it's better to remove these imports as they leave the reader
 confused.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30036>
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/047.58702d2349d37aeec2a587d1c423d5b5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to