#34758: Paginator.validate_number implementation has undocumented change in 4.2
-------------------------------+--------------------------------------
     Reporter:  ruidc          |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  closed
    Component:  Core (Other)   |                  Version:  4.2
     Severity:  Normal         |               Resolution:  invalid
     Keywords:  pagination     |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by ruidc):

 Replying to [comment:1 Mariusz Felisiak]:
 > In the current implementation `num_pages` cannot be less than 1, so this
 branch was unused. This looks like an issue in your custom paginator.

 From the code in main, that doesn't seem to be the case:
 ```
 @cached_property
     def num_pages(self):
         """Return the total number of pages."""
         if self.count == 0 and not self.allow_empty_first_page:
             return 0
        ...
 ```
 Even so, the behavior for this public function changed when a valid
 integer of zero is passed. Is documentation of this change not in order at
 least?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34758#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/01070189b59046e5-68010b75-5694-43d5-9a16-6d3514a2bbb8-000000%40eu-central-1.amazonses.com.

Reply via email to