You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MAINT: Return None instead of -1 when page is not attached (#2376)
If a page is not attached to a document, it does not have a page number. So we cannot return a "normal" number.
Before this PR, we returned -1.
Returning None compared to using `-1` has two advantages:
* It makes intuitive sense what it means
* It is part of the type annotation and mypy will complain about it if you don't handle that. If the callers (users) of pypdf are not careful, mypy might catch their error.
For this reason, we now return `None`.
See #2010Closes#2371
0 commit comments