Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STY: Use generator expressions #3021

Merged
merged 2 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pypdf/_doc_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ def indexed_key(k: str, fields: Dict[Any, Any]) -> str:
return (
k
+ "."
+ str(sum([1 for kk in fields if kk.startswith(k + ".")]) + 2)
+ str(sum(1 for kk in fields if kk.startswith(k + ".")) + 2)
)

# Retrieve document form fields
Expand Down
2 changes: 1 addition & 1 deletion pypdf/_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ def add_form_topname(self, name: str) -> Optional[DictionaryObject]:
interim[NameObject("/Kids")] = acroform[NameObject("/Fields")]
self.cache_indirect_object(
0,
max([i for (g, i) in self.resolved_objects if g == 0]) + 1,
max(i for (g, i) in self.resolved_objects if g == 0) + 1,
interim,
)
arr = ArrayObject()
Expand Down
Loading