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
Good question. I think I want to tackle this with the pypdf==4.0.0 release (if we do it at all), but not earlier. So it will stay open for quite a while.
I want to have that release in early January 2024.
-1 is not an issue for me : it is consistent with functions like "find_in".find("to_be_found") in any case we need to add a test is None or <0 as 0 is a valid result.
in any case an exception is not a good option
Explanation
If a page is not attached to a document, it does not have a page number. So we cannot return a "normal" number.
At the moment, we return
-1
.However, callers (users of the library) might not be careful with error handling.
For this reason I suggest to change the behavior to either return
None
or raise an Exception. I'm not sure what is better.Pro returning
None
:The text was updated successfully, but these errors were encountered: