Issue 382 (#384)

* WIP fix, pushed for testing

* added _ prefix for internal types

Co-authored-by: Kacper Szmigiel <szmigielkacper@gmai.com>
This commit is contained in:
Kacper
2020-06-03 11:58:03 +02:00
committed by GitHub
parent dac2b31fb2
commit 197cb4058e
2 changed files with 15 additions and 6 deletions

View File

@@ -8,13 +8,13 @@ class InvalidPage(Exception): ...
class PageNotAnInteger(InvalidPage): ...
class EmptyPage(InvalidPage): ...
class SupportsLen(Protocol):
class _SupportsLen(Protocol):
def __len__(self) -> int: ...
class SupportsCount(Protocol):
class _SupportsCount(Protocol):
def count(self) -> int: ...
class SupportsOrdered(Protocol):
class _SupportsOrdered(Protocol):
ordered: bool = ...
class Paginator:
@@ -24,7 +24,7 @@ class Paginator:
allow_empty_first_page: bool = ...
def __init__(
self,
object_list: Union[SupportsLen, SupportsCount, SupportsOrdered],
object_list: Union[_SupportsLen, _SupportsCount, _SupportsOrdered],
per_page: Union[int, str],
orphans: int = ...,
allow_empty_first_page: bool = ...,