Skip to content

Commit 4fd07f8

Browse files
authored
STY: Remove intermediate conversion to list (#3224)
1 parent 1a78d86 commit 4fd07f8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pypdf/_doc_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ def _flatten(
11831183
"Maximum recursion depth reached during page flattening."
11841184
)
11851185
elif t == "/Page":
1186-
for attr_in, value in list(inherit.items()):
1186+
for attr_in, value in inherit.items():
11871187
# if the page has it's own value, it does not inherit the
11881188
# parent's value:
11891189
if attr_in not in pages:

pypdf/generic/_data_structures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ def write_to_stream(
511511
"the encryption_key parameter of write_to_stream", "5.0.0"
512512
)
513513
stream.write(b"<<\n")
514-
for key, value in list(self.items()):
514+
for key, value in self.items():
515515
if len(key) > 2 and key[1] == "%" and key[-1] == "%":
516516
continue
517517
key.write_to_stream(stream, encryption_key)

0 commit comments

Comments
 (0)