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

MAINT: Add deprecate_with_replacement to StreamObject.initializeFromD… #2728

Merged
merged 4 commits into from
Jun 27, 2024
Merged
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
9 changes: 6 additions & 3 deletions pypdf/generic/_data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,13 @@ def write_to_stream(
stream.write(b"\nendstream")

@staticmethod
def initializeFromDictionary( # TODO: mention when to deprecate
def initializeFromDictionary(
data: Dict[str, Any]
) -> Union["EncodedStreamObject", "DecodedStreamObject"]: # deprecated
return StreamObject.initialize_from_dictionary(data)
) -> Union["EncodedStreamObject", "DecodedStreamObject"]:
deprecate_with_replacement(
"initializeFromDictionary", "initialize_from_dictionary", "5.0.0"
) # pragma: no cover
return StreamObject.initialize_from_dictionary(data) # pragma: no cover

@staticmethod
def initialize_from_dictionary(
Expand Down
Loading